Package ghidra.app.services
Class AbstractAnalyzer
java.lang.Object
ghidra.app.services.AbstractAnalyzer
- All Implemented Interfaces:
Analyzer,ExtensionPoint
- Direct Known Subclasses:
AbstractBinaryFormatAnalyzer,AggressiveInstructionFinderAnalyzer,AnalyzerAdapter,ArmAggressiveInstructionFinderAnalyzer,CondenseFillerBytesAnalyzer,GccExceptionAnalyzer
-
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedAbstractAnalyzer(String name, String description, AnalyzerType type) -
Method Summary
Modifier and TypeMethodDescriptionvoidanalysisEnded(Program program) Called when an auto-analysis session ends.analyzeLocation(Program program, Address start, AddressSetView set, TaskMonitor monitor) Analyze a single locationbooleancanAnalyze(Program program) Can this analyzer work on this program.final AnalyzerTypeGet the type of analysis this analyzer performsbooleangetDefaultEnablement(Program program) Returns true if this analyzer should be enabled by default.final StringGet a longer description of what this analyzer does.final StringgetName()Get the name of this analyzerfinal AnalysisPriorityGet the priority that this analyzer should run at.final booleanReturns true if this analyzer is a prototype.voidoptionsChanged(Options options, Program program) Analyzers should initialize their options from the values in the given Options, providing appropriate default values.voidregisterOptions(Options options, Program program) Analyzers should register their options with associated default value, help content and descriptionbooleanremoved(Program program, AddressSetView set, TaskMonitor monitor, MessageLog log) Called when the requested information type has been removed, for example, when a function is removed.protected AddressSetViewrunParallelAddressAnalysis(Program program, Set<Address> locations, AddressSetView restrictedSet, int maxThreads, TaskMonitor monitor) Run constant an analysis at each location in parallelprotected voidsetDefaultEnablement(boolean b) protected voidsetPriority(AnalysisPriority priority) protected voidprotected voidprotected voidsetSupportsOneTimeAnalysis(boolean supportsOneTimeAnalysis) final booleanReturns true if it makes sense for this analyzer to directly invoked on an address or addressSet.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface ghidra.app.services.Analyzer
added, getOptionsUpdater
-
Field Details
-
EMPTY_ADDRESS_SET
-
-
Constructor Details
-
AbstractAnalyzer
-
-
Method Details
-
setPriority
-
setDefaultEnablement
protected void setDefaultEnablement(boolean b) -
setSupportsOneTimeAnalysis
protected void setSupportsOneTimeAnalysis() -
setSupportsOneTimeAnalysis
protected void setSupportsOneTimeAnalysis(boolean supportsOneTimeAnalysis) -
setPrototype
protected void setPrototype() -
getName
Description copied from interface:AnalyzerGet the name of this analyzer -
getAnalysisType
Description copied from interface:AnalyzerGet the type of analysis this analyzer performs- Specified by:
getAnalysisTypein interfaceAnalyzer- Returns:
- analyze type
-
getDefaultEnablement
Description copied from interface:AnalyzerReturns true if this analyzer should be enabled by default. Generally useful analyzers should return true. Specialized analyzers should return false;- Specified by:
getDefaultEnablementin interfaceAnalyzer- Parameters:
program- the program- Returns:
- true if enabled by default
-
supportsOneTimeAnalysis
public final boolean supportsOneTimeAnalysis()Description copied from interface:AnalyzerReturns true if it makes sense for this analyzer to directly invoked on an address or addressSet. The AutoAnalyzer plug-in will automatically create an action for each analyzer that returns true.- Specified by:
supportsOneTimeAnalysisin interfaceAnalyzer- Returns:
- true if supports one-time analysis
-
getDescription
Description copied from interface:AnalyzerGet a longer description of what this analyzer does.- Specified by:
getDescriptionin interfaceAnalyzer- Returns:
- analyzer description
-
getPriority
Description copied from interface:AnalyzerGet the priority that this analyzer should run at.- Specified by:
getPriorityin interfaceAnalyzer- Returns:
- analyzer priority
-
removed
public boolean removed(Program program, AddressSetView set, TaskMonitor monitor, MessageLog log) throws CancelledException Description copied from interface:AnalyzerCalled when the requested information type has been removed, for example, when a function is removed.- Specified by:
removedin interfaceAnalyzer- Parameters:
program- program to analyzeset- AddressSet of locations that have been addedmonitor- monitor that indicates progress and indicates whether the user canceled the analysislog- a message log to record analysis information- Returns:
- true if the analysis succeeded
- Throws:
CancelledException- if the analysis is cancelled
-
canAnalyze
Description copied from interface:AnalyzerCan this analyzer work on this program.- Specified by:
canAnalyzein interfaceAnalyzer- Parameters:
program- program to be analyzed- Returns:
- true if this analyzer can analyze this program
-
optionsChanged
Description copied from interface:AnalyzerAnalyzers should initialize their options from the values in the given Options, providing appropriate default values.- Specified by:
optionsChangedin interfaceAnalyzer- Parameters:
options- the program options/property list that contains the optionsprogram- program to be analyzed
-
analysisEnded
Description copied from interface:AnalyzerCalled when an auto-analysis session ends. This notifies the analyzer so it can clean up any resources that only needed to be maintained during a single auto-analysis session.- Specified by:
analysisEndedin interfaceAnalyzer- Parameters:
program- the program that was just completed being analyzed
-
isPrototype
public final boolean isPrototype()Description copied from interface:AnalyzerReturns true if this analyzer is a prototype.- Specified by:
isPrototypein interfaceAnalyzer- Returns:
- true if this analyzer is a prototype
-
registerOptions
Description copied from interface:AnalyzerAnalyzers should register their options with associated default value, help content and description- Specified by:
registerOptionsin interfaceAnalyzer- Parameters:
options- the program options/property list that contains the optionsprogram- program to be analyzed
-
analyzeLocation
public AddressSetView analyzeLocation(Program program, Address start, AddressSetView set, TaskMonitor monitor) throws CancelledException Analyze a single location- Parameters:
program- - program to analyzestart- - location to start flowing constantsset- - restriction set of addresses to analyzemonitor- - monitor to check canceled- Returns:
- - set of addresses actually flowed to
- Throws:
CancelledException
-
runParallelAddressAnalysis
protected AddressSetView runParallelAddressAnalysis(Program program, Set<Address> locations, AddressSetView restrictedSet, int maxThreads, TaskMonitor monitor) throws CancelledException, InterruptedException, Exception Run constant an analysis at each location in parallel- Parameters:
program- programlocations- points to analyzerestrictedSet- set to restrict analysis to, null if nonemaxThreads- maximum number of threads to usemonitor- to cancel- Returns:
- set of addresses covered during analysis
- Throws:
CancelledException- if cancelledInterruptedException- if interruptedException- any exception
-