Package ghidra.util.state
Interface FunctionAnalyzer
-
- All Known Implementing Classes:
MySwitchAnalyzer
public interface FunctionAnalyzer
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
dataReference(PcodeOp op, int instrOpIndex, Varnode storageVarnode, RefType refType, TaskMonitor monitor)
Callback indicating that an absolute memory reference was encounteredvoid
indirectDataReference(PcodeOp op, int instrOpIndex, Varnode offsetVarnode, int size, int storageSpaceID, RefType refType, TaskMonitor monitor)
Callback indicating that an indirect/computed memory reference was encountered using an indirect/computed offsetboolean
resolvedFlow(PcodeOp op, int instrOpIndex, Address destAddr, ContextState currentState, ResultsState results, TaskMonitor monitor)
Callback indicating that a call/branch destination was identified.void
stackReference(PcodeOp op, int instrOpIndex, int stackOffset, int size, int storageSpaceID, RefType refType, TaskMonitor monitor)
Callback indicating that an absolute stack reference was encountered.void
stackReference(PcodeOp op, int instrOpIndex, VarnodeOperation computedStackOffset, int size, int storageSpaceID, RefType refType, TaskMonitor monitor)
Callback indicating that a computed stack reference was encountered.java.util.List<Address>
unresolvedIndirectFlow(PcodeOp op, int instrOpIndex, Varnode destination, ContextState currentState, ResultsState results, TaskMonitor monitor)
Callback indicating that a computed call/branch destination was not resolved.
-
-
-
Method Detail
-
stackReference
void stackReference(PcodeOp op, int instrOpIndex, int stackOffset, int size, int storageSpaceID, RefType refType, TaskMonitor monitor) throws CancelledException
Callback indicating that an absolute stack reference was encountered. A non-load/store operation will have a -1 for both storageSpaceId and size.- Parameters:
op
- pcode operationinstrOpIndex
- opIndex associated with reference or -1 if it could not be determinedstackOffset
- stack offsetsize
- access size or -1 if not applicablestorageSpaceID
- storage space ID or -1 if not applicablerefType
- read/write/data reference typemonitor
- task monitor- Throws:
CancelledException
- if callback canceled by monitor
-
stackReference
void stackReference(PcodeOp op, int instrOpIndex, VarnodeOperation computedStackOffset, int size, int storageSpaceID, RefType refType, TaskMonitor monitor) throws CancelledException
Callback indicating that a computed stack reference was encountered. A non-load/store operation will have a -1 for both storageSpaceId and size.- Parameters:
op
- pcode operationinstrOpIndex
- opIndex associated with reference or -1 if it could not be determinedcomputedStackOffset
- stack offset computation (i.e., VarnodeOperation w/ stack pointer)size
- access size or -1 if not applicablestorageSpaceID
- storage space ID or -1 if not applicablerefType
- read/write/data reference typemonitor
- task monitor- Throws:
CancelledException
- if callback canceled by monitor
-
dataReference
void dataReference(PcodeOp op, int instrOpIndex, Varnode storageVarnode, RefType refType, TaskMonitor monitor) throws CancelledException
Callback indicating that an absolute memory reference was encountered- Parameters:
op
- pcode operationinstrOpIndex
- opIndex associated with reference or -1 if it could not be determinedstorageVarnode
- absolute storage VarnoderefType
- read/write/data reference typemonitor
- task monitor- Throws:
CancelledException
- if callback canceled by monitor
-
indirectDataReference
void indirectDataReference(PcodeOp op, int instrOpIndex, Varnode offsetVarnode, int size, int storageSpaceID, RefType refType, TaskMonitor monitor) throws CancelledException
Callback indicating that an indirect/computed memory reference was encountered using an indirect/computed offset- Parameters:
op
- pcode operationinstrOpIndex
- opIndex associated with reference or -1 if it could not be determinedoffsetVarnode
- indirect/computed offsetsize
- access size or -1 if not applicablestorageSpaceID
- storage space IDrefType
- read/write/data reference typemonitor
- task monitor- Throws:
CancelledException
- if callback canceled by monitor
-
resolvedFlow
boolean resolvedFlow(PcodeOp op, int instrOpIndex, Address destAddr, ContextState currentState, ResultsState results, TaskMonitor monitor) throws CancelledException
Callback indicating that a call/branch destination was identified. Analyzer should create reference if appropriate Keep in mind that there could be other unidentified destinations.- Parameters:
op
- branch or call flow operationinstrOpIndex
- opIndex associated with reference or -1 if it could not be determineddestAddr
- destination addressresults
- contains previous states leading upto the currentStatecurrentState
- current state at the branch/callmonitor
- task monitor- Returns:
- true if destination should be disassembled if not already
- Throws:
CancelledException
- if callback canceled by monitor
-
unresolvedIndirectFlow
java.util.List<Address> unresolvedIndirectFlow(PcodeOp op, int instrOpIndex, Varnode destination, ContextState currentState, ResultsState results, TaskMonitor monitor) throws CancelledException
Callback indicating that a computed call/branch destination was not resolved.- Parameters:
op
- indirect branch or call flow operationinstrOpIndex
- opIndex associated with reference or -1 if it could not be determineddestination
- destination identified as a Varnode (may be an expression represented by aVarnodeOperation
results
- contains previous states leading upto the currentStatecurrentState
- current state at the branch/callmonitor
- task monitor- Returns:
- list of resolved destinations which should be used or null. List of destination addresses will trigger disassembly where necessary.
- Throws:
CancelledException
- if callback cancelled by monitor
-
-