mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2025-10-05 10:49:34 +02:00
Merge remote-tracking branch 'origin/GP-1689-dragonmacher-option-names'
This commit is contained in:
commit
d80c18b23f
2 changed files with 29 additions and 21 deletions
|
@ -36,45 +36,52 @@ import ghidra.util.task.TaskMonitor;
|
||||||
public class DWARFAnalyzer extends AbstractAnalyzer {
|
public class DWARFAnalyzer extends AbstractAnalyzer {
|
||||||
private static final String DWARF_LOADED_OPTION_NAME = "DWARF Loaded";
|
private static final String DWARF_LOADED_OPTION_NAME = "DWARF Loaded";
|
||||||
|
|
||||||
private static final String OPTION_IMPORT_DATATYPES = "Import data types";
|
private static final String OPTION_IMPORT_DATATYPES = "Import Data Types";
|
||||||
private static final String OPTION_IMPORT_DATATYPES_DESC =
|
private static final String OPTION_IMPORT_DATATYPES_DESC =
|
||||||
"Import data types defined in the DWARF debug info.";
|
"Import data types defined in the DWARF debug info.";
|
||||||
|
|
||||||
private static final String OPTION_PRELOAD_ALL_DIES = "Preload all DIEs";
|
private static final String OPTION_PRELOAD_ALL_DIES = "Preload All DIEs";
|
||||||
private static final String OPTION_PRELOAD_ALL_DIES_DESC =
|
private static final String OPTION_PRELOAD_ALL_DIES_DESC =
|
||||||
"Preload all DIE records. Requires more memory, but necessary for some non-standard layouts.";
|
"Preload all DIE records. Requires more memory, but necessary for some non-standard " +
|
||||||
|
"layouts.";
|
||||||
|
|
||||||
private static final String OPTION_IMPORT_FUNCS = "Import functions";
|
private static final String OPTION_IMPORT_FUNCS = "Import Functions";
|
||||||
private static final String OPTION_IMPORT_FUNCS_DESC =
|
private static final String OPTION_IMPORT_FUNCS_DESC =
|
||||||
"Import function information defined in the DWARF debug info. (implies import data types)";
|
"Import function information defined in the DWARF debug info\n" +
|
||||||
|
"(implies 'Import Data Types' is selected).";
|
||||||
|
|
||||||
private static final String OPTION_IMPORT_LIMIT_DIE_COUNT = "Debug item count limit";
|
private static final String OPTION_IMPORT_LIMIT_DIE_COUNT = "Debug Item Limit";
|
||||||
private static final String OPTION_IMPORT_LIMIT_DIE_COUNT_DESC =
|
private static final String OPTION_IMPORT_LIMIT_DIE_COUNT_DESC =
|
||||||
"If the number of DWARF debug items are greater than this setting, DWARF analysis will be skipped.";
|
"If the number of DWARF debug items are greater than this setting, DWARF analysis will " +
|
||||||
|
"be skipped.";
|
||||||
|
|
||||||
private static final String OPTION_OUTPUT_SOURCE_INFO = "Output Source info";
|
private static final String OPTION_OUTPUT_SOURCE_INFO = "Output Source Info";
|
||||||
private static final String OPTION_OUTPUT_SOURCE_INFO_DESC =
|
private static final String OPTION_OUTPUT_SOURCE_INFO_DESC =
|
||||||
"Include source code location info (filename:linenumber) in comments attached to the Ghidra datatype or function or variable created.";
|
"Include source code location info (filename:linenumber) in comments attached to the " +
|
||||||
|
"Ghidra datatype or function or variable created.";
|
||||||
|
|
||||||
private static final String OPTION_OUTPUT_DWARF_DIE_INFO = "Output DWARF DIE info";
|
private static final String OPTION_OUTPUT_DWARF_DIE_INFO = "Output DWARF DIE Info";
|
||||||
private static final String OPTION_OUTPUT_DWARF_DIE_INFO_DESC =
|
private static final String OPTION_OUTPUT_DWARF_DIE_INFO_DESC =
|
||||||
"Include DWARF DIE offset info in comments attached to the Ghidra datatype or function or variable created.";
|
"Include DWARF DIE offset info in comments attached to the Ghidra datatype or function " +
|
||||||
|
"or variable created.";
|
||||||
|
|
||||||
private static final String OPTION_NAME_LENGTH_CUTOFF = "Name length cutoff";
|
private static final String OPTION_NAME_LENGTH_CUTOFF = "Maximum Name Length";
|
||||||
private static final String OPTION_NAME_LENGTH_CUTOFF_DESC =
|
private static final String OPTION_NAME_LENGTH_CUTOFF_DESC =
|
||||||
"Truncate symbol and type names longer than this limit. Range 20..2000";
|
"Truncate symbol and type names longer than this limit. Range 20..2000";
|
||||||
|
|
||||||
private static final String OPTION_OUTPUT_LEXICAL_BLOCK_COMMENTS = "Lexical block comments";
|
private static final String OPTION_OUTPUT_LEXICAL_BLOCK_COMMENTS = "Add Lexical Block Comments";
|
||||||
private static final String OPTION_OUTPUT_LEXICAL_BLOCK_COMMENTS_DESC =
|
private static final String OPTION_OUTPUT_LEXICAL_BLOCK_COMMENTS_DESC =
|
||||||
"Add comments to the start of lexical blocks";
|
"Add comments to the start of lexical blocks";
|
||||||
|
|
||||||
private static final String OPTION_OUTPUT_INLINE_FUNC_COMMENTS = "Inlined functions comments";
|
private static final String OPTION_OUTPUT_INLINE_FUNC_COMMENTS =
|
||||||
|
"Add Inlined Functions Comments";
|
||||||
private static final String OPTION_OUTPUT_INLINE_FUNC_COMMENTS_DESC =
|
private static final String OPTION_OUTPUT_INLINE_FUNC_COMMENTS_DESC =
|
||||||
"Add comments to the start of inlined functions";
|
"Add comments to the start of inlined functions";
|
||||||
|
|
||||||
private static final String OPTION_OUTPUT_FUNC_SIGS = "Output function signatures";
|
private static final String OPTION_OUTPUT_FUNC_SIGS = "Create Function Signatures";
|
||||||
private static final String OPTION_OUTPUT_FUNC_SIGS_DESC =
|
private static final String OPTION_OUTPUT_FUNC_SIGS_DESC =
|
||||||
"Create function signature data types for each function encountered in the DWARF debug data.";
|
"Create function signature data types for each function encountered in the DWARF debug " +
|
||||||
|
"data.";
|
||||||
|
|
||||||
private static final String DWARF_ANALYZER_NAME = "DWARF";
|
private static final String DWARF_ANALYZER_NAME = "DWARF";
|
||||||
private static final String DWARF_ANALYZER_DESCRIPTION =
|
private static final String DWARF_ANALYZER_DESCRIPTION =
|
||||||
|
|
|
@ -42,7 +42,7 @@ public class FidAnalyzer extends AbstractAnalyzer {
|
||||||
private static final String OPTION_DESCRIPTION_CREATE_BOOKMARKS =
|
private static final String OPTION_DESCRIPTION_CREATE_BOOKMARKS =
|
||||||
"If checked, an analysis bookmark will be created for each function which was matched " +
|
"If checked, an analysis bookmark will be created for each function which was matched " +
|
||||||
"against one or more known library functions.";
|
"against one or more known library functions.";
|
||||||
private static final String APPLY_ALL_FID_LABELS_OPTION_NAME = "Always apply FID labels";
|
private static final String APPLY_ALL_FID_LABELS_OPTION_NAME = "Always Apply FID Labels";
|
||||||
private static final String APPLY_ALL_FID_LABELS_OPTION_DESCRIPTION = "Enable this option to " +
|
private static final String APPLY_ALL_FID_LABELS_OPTION_DESCRIPTION = "Enable this option to " +
|
||||||
"always apply FID labels at functions regardless of existing labels at that function." +
|
"always apply FID labels at functions regardless of existing labels at that function." +
|
||||||
" When enabled, FID labels will always be added." +
|
" When enabled, FID labels will always be added." +
|
||||||
|
@ -57,13 +57,13 @@ public class FidAnalyzer extends AbstractAnalyzer {
|
||||||
private boolean alwaysApplyFidLabels = APPLY_ALL_FID_LABELS_DEFAULT;
|
private boolean alwaysApplyFidLabels = APPLY_ALL_FID_LABELS_DEFAULT;
|
||||||
private boolean createBookmarksEnabled = OPTION_DEFAULT_CREATE_BOOKMARKS_ENABLED;
|
private boolean createBookmarksEnabled = OPTION_DEFAULT_CREATE_BOOKMARKS_ENABLED;
|
||||||
|
|
||||||
private static final String SCORE_THRESHOLD_OPTION_NAME = "Instruction count threshold";
|
private static final String SCORE_THRESHOLD_OPTION_NAME = "Instruction Count Threshold";
|
||||||
private static final String SCORE_THRESHOLD_OPTION_DESCRIPTION =
|
private static final String SCORE_THRESHOLD_OPTION_DESCRIPTION =
|
||||||
"The minimum score that a potential match must meet to be labeled by the analyzer. " +
|
"The minimum score that a potential match must meet to be labeled by the analyzer. " +
|
||||||
"Score corresponds roughly to the number of instructions in the function.";
|
"Score corresponds roughly to the number of instructions in the function.";
|
||||||
private float scoreThreshold;
|
private float scoreThreshold;
|
||||||
|
|
||||||
private static final String MULTIMATCH_THRESHOLD_OPTION_NAME = "Multiple match threshold";
|
private static final String MULTIMATCH_THRESHOLD_OPTION_NAME = "Multiple Match Threshold";
|
||||||
private static final String MULTIMATCH_THRESHOLD_OPTION_DESCRIPTION =
|
private static final String MULTIMATCH_THRESHOLD_OPTION_DESCRIPTION =
|
||||||
"If there are multiple conflicting matches for a function, its score must exceed " +
|
"If there are multiple conflicting matches for a function, its score must exceed " +
|
||||||
"this secondary threshold in order to be labeled by the analyzer";
|
"this secondary threshold in order to be labeled by the analyzer";
|
||||||
|
@ -112,7 +112,8 @@ public class FidAnalyzer extends AbstractAnalyzer {
|
||||||
|
|
||||||
// Name Change can change the nature of a function from a system
|
// Name Change can change the nature of a function from a system
|
||||||
// library. Probably a better way to do this.
|
// library. Probably a better way to do this.
|
||||||
AutoAnalysisManager.getAnalysisManager(program).functionModifierChanged(
|
AutoAnalysisManager.getAnalysisManager(program)
|
||||||
|
.functionModifierChanged(
|
||||||
cmd.getFIDLocations());
|
cmd.getFIDLocations());
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue