mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2025-10-06 03:50:02 +02:00
Merge remote-tracking branch 'origin/patch'
Conflicts: Ghidra/Features/FunctionID/src/main/java/ghidra/feature/fid/analyzer/FidAnalyzer.java
This commit is contained in:
commit
36f7352c78
1 changed files with 25 additions and 2 deletions
|
@ -129,6 +129,11 @@ public class FidAnalyzer extends AbstractAnalyzer {
|
||||||
Msg.warn(this, "No FID Libraries apply for language " + program.getLanguageID());
|
Msg.warn(this, "No FID Libraries apply for language " + program.getLanguageID());
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!isFullExecutable(program, set)) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
ApplyFidEntriesCommand cmd;
|
ApplyFidEntriesCommand cmd;
|
||||||
cmd = new ApplyFidEntriesCommand(set, scoreThreshold, multiScoreThreshold,
|
cmd = new ApplyFidEntriesCommand(set, scoreThreshold, multiScoreThreshold,
|
||||||
alwaysApplyFidLabels, createBookmarksEnabled);
|
alwaysApplyFidLabels, createBookmarksEnabled);
|
||||||
|
@ -137,11 +142,29 @@ 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)
|
AutoAnalysisManager.getAnalysisManager(program)
|
||||||
.functionModifierChanged(
|
.functionModifierChanged(cmd.getFIDLocations());
|
||||||
cmd.getFIDLocations());
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Check if set contains the full executable or loaded/initialized memory areas.
|
||||||
|
*
|
||||||
|
* @param program program to check
|
||||||
|
* @param set set to check
|
||||||
|
* @return true if all program executable or load/initialized memory is in set
|
||||||
|
*/
|
||||||
|
private boolean isFullExecutable(Program program, AddressSetView set) {
|
||||||
|
// if has an execute set, then set to FID, must contain the execute set
|
||||||
|
AddressSetView executeSet = program.getMemory().getExecuteSet();
|
||||||
|
if (!executeSet.isEmpty()) {
|
||||||
|
return set.contains(executeSet);
|
||||||
|
}
|
||||||
|
|
||||||
|
// if there are no execute blocks, then use loaded/initialized for program blocks
|
||||||
|
AddressSetView loadSet = program.getMemory().getLoadedAndInitializedAddressSet();
|
||||||
|
return set.contains(loadSet);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void registerOptions(Options options, Program program) {
|
public void registerOptions(Options options, Program program) {
|
||||||
options.registerOption(SCORE_THRESHOLD_OPTION_NAME, service.getDefaultScoreThreshold(),
|
options.registerOption(SCORE_THRESHOLD_OPTION_NAME, service.getDefaultScoreThreshold(),
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue