Class DFA4<InsnType extends IInstruction>
- All Implemented Interfaces:
IDFA<InsnType>
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intCache basic def/use information at the instruction levelstatic final intCACHE_DUI+ cache standard ud-chains and du-chainsstatic final intDeprecated.static final intNothing is cachedstatic final AtomicLongstatic final AtomicLongstatic final AtomicLongstatic final AtomicLongstatic final AtomicLongstatic final AtomicLongstatic final AtomicLongstatic final AtomicLongstatic final AtomicLongFields inherited from interface com.pnfsoftware.jeb.core.units.code.IDFA
STANDARD_COLLECTION_FLAGS, STANDARD_INTEGRATE_INPUTS -
Constructor Summary
ConstructorsConstructorDescriptionDFA4(IControlFlowGraph<InsnType, ? extends IBasicBlock<InsnType>> cfg) Create a DFA object with CFG-provided default collection flags and basic caching for instruction-level def-use information.DFA4(IControlFlowGraph<InsnType, ? extends IBasicBlock<InsnType>> cfg, int collectionFlags, int cacheConfig) Create a DFA object. -
Method Summary
Modifier and TypeMethodDescriptionbooleancheckInput(int varid) checkInputWithUses(int varid) booleancheckNoUse(long addr, int varid) Check whether a variable, defined at the provided instruction, is not used.booleancheckNoUse(long insnAddress, int varId, boolean reachOutIsUse) Check whether a variable, defined at the provided instruction, is not used.intcheckNoUse(long addr, int varid, boolean reachOutIsUse, int maxBlocks) Check whether a variable, defined at the provided instruction, is not used.booleancheckOutput(int varid) booleancheckOutput(IBasicBlock<InsnType> blk, int varid) checkOutputsWithDefs(int varid) checkOutputsWithDefs(IBasicBlock<InsnType> blk, int varid) checkSingleDef(long addr, int varid) Check whether a used variable has a single definition point.checkSingleDef(long addr, int varid, boolean liveInIsDef) Check whether a used variable has a single explicit definition point (i.e.checkSingleDefNoInput(long addr, int varid) Check whether a used variable has a single explicit definition point.checkSingleSource(long addr, int varid) checkSingleSource(long addr, int varid, boolean liveInIsDef) checkSingleUse(long addr, int varid) checkSingleUse(long addr, int varid, boolean reachOutIsUse) voidcollectInstructionAllDefs(long addr, Collection<Integer> r) voidcollectInstructionAllUses(long addr, Collection<Integer> r) filterInputs(Collection<Integer> varids) filterInputsWithUses(Collection<Integer> varids) filterOutputs(IBasicBlock<InsnType> blk, Collection<Integer> varids) filterOutputs(Collection<Integer> varids) filterOutputsWithDefs(IBasicBlock<InsnType> blk, Collection<Integer> varids) filterOutputsWithDefs(Collection<Integer> varids) getBlockDefUses(long addr, int varid) getBlockDefUses(long addr, int varid, int stopCount) getBlockUseDefs(long addr, int varid) intRetrieve the cache configuration.getCfg()Retrieve a reference to the CFG object that will be accessed and modified when performing an analysis.getDefUseChains(long addr) getDefUseChains(long addr, boolean recordReachOut) getDefUses(long addr, int varid) getDefUses(long addr, int varid, int stopCount) getDefUses(long addr, int varid, int stopCount, boolean recordReachOut) getDefUses(long addr, int varid, int stopcount, boolean verifyStartOnDefPoint, boolean recordReachOut, IBasicBlock<InsnType> blkForLiveChains, int idxForLiveChains, int maxBlocks, boolean limitToStartBlock) Find the list of usage points for a defined variable.getDUI(long addr) getInputMap(int varid) getInstructionAllDefs(long addr) getInstructionAllUses(long addr) getInstructionDefs(long addr) getInstructionPotentialDefs(long addr) getInstructionPotentialUses(long addr) getInstructionSpoiledDefs(long addr) getInstructionUses(long addr) getLiveChains(IBasicBlock<InsnType> b, int idx) getLiveChains(IBasicBlock<InsnType> b, int idx, int varid) getLiveChains(IBasicBlock<InsnType> b, int idx, int varid, int stopcount) getLiveChains(IBasicBlock<InsnType> b, int idx, Collection<Integer> varids, int stopcount) intRetrieve the maximum block count used for common DFA operations.getOutputMap(int varid) getOutputMap(IBasicBlock<InsnType> blk) getOutputMap(IBasicBlock<InsnType> blk, int varid) getOutputs(IBasicBlock<InsnType> blk) getReachChains(IBasicBlock<InsnType> b, int idx) getReachChains(IBasicBlock<InsnType> b, int idx, int varid) getReachChains(IBasicBlock<InsnType> b, int idx, int varid, int stopcount) getReachChains(IBasicBlock<InsnType> b, int idx, Collection<Integer> varids, int stopcount) getUseDefChains(long addr) getUseDefChains(long addr, boolean recordLiveIn) getUseDefs(long addr, int varid) getUseDefs(long addr, int varid, int stopCount) getUseDefs(long addr, int varid, int stopcount, boolean verifyStartOnUsePoint, boolean recordLiveIn, IBasicBlock<InsnType> blkForReachChains, int idxForReachChains, boolean[] aDetectedUseDiscrepancy, boolean treatSpoiledAsDefs, int maxBlocks, boolean limitToStartBlock) Find the list of definition points for a used variable.getUseDiscrepancies(long addr) Retrieve the list of use-discrepancies at the provided instruction address.intRetrieve the variable collection flags.voidInvalidate the analysis.voidinvalidateForRemoval(long addr0) Selectively invalidate the cache in preparation for an instruction pseudo-removal (neutering).voidinvalidateForSubstitution(long addr0, Collection<Long> addr1coll, Collection<Long> srccoll) Selectively invalidate the cache in preparation for an expression-substitution.voidinvalidatePostSimpleSubstitutionWithMultiDefs(Collection<Long> addr0coll, long addr1, int varid) Selectively invalidate DFA cache after the substitution of a variableXby an immediate.booleanisAlive(IBasicBlock<InsnType> b, int idx, int varid) booleanbooleanbooleanisNotRedefined(int varid, long addr0, long addr1) booleanisNotRedefined(int varid, IBasicBlock<InsnType> b0, int i0, IBasicBlock<InsnType> b1, int i1) booleanisReaching(IBasicBlock<InsnType> b, int idx, int varid) booleanisTerminator(IBasicBlock<InsnType> blk) Determine whether the provided block is a terminator.booleanisUseDiscrepancy(long addr, int varid) booleanisValid()Determine whether the current analysis was performed and is valid.isVarReachingFromTo(int varid, long addr0, long addr1) Determine if a variable used by the start instruction reaches the final instruction with the same value.isVarReachingFromTo(int varid, IBasicBlock<InsnType> b0, int i0, IBasicBlock<InsnType> b1, int i1) Determine if a variable used by the start instruction reaches the final instruction with the same value.isVarReachingFromTo(int varid, IBasicBlock<InsnType> b0, int i0, IBasicBlock<InsnType> b1, int i1, boolean allowRedef, boolean performExtendedChecks, int maxBlocks) isVarReachingFromTo(int varid, IBasicBlock<InsnType> b0, int i0, IBasicBlock<InsnType> b1, int i1, boolean performExtendedChecks, int maxBlocks) Determine if a variable used by the start instruction reaches the final instruction with the same value.voidnotifyInstructionUpdate(long addr) voidperform()Perform data flow analysis on the CFG.voidbooleansetAlwaysExamineIrregularFlows(boolean enabled) voidsetCacheConfiguration(int value) Set or update the cache configuration of this object.booleansetIntegrateCalculatedInputRegisters(boolean enabled) intsetMaxBlocks(int maxBlocks) Set an exploration threshold for most DFA operations.voidsetVariableCollectionFlags(int flags) Set the variable collection flags.toString()verifyNoRedefAfterSink(int varid, long addr0, long addr1) verifyNoRedefAfterSink(int varid, IBasicBlock<InsnType> b0, int i0, IBasicBlock<InsnType> b1, int i1, int maxBlocks) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface com.pnfsoftware.jeb.core.units.code.IDFA
checkSingleDef, checkSingleSource, checkSingleUse, isConservative, setConservative
-
Field Details
-
CACHE_NONE
public static final int CACHE_NONENothing is cached- See Also:
-
CACHE_DUI
public static final int CACHE_DUICache basic def/use information at the instruction level- See Also:
-
CACHE_DUI_CHAINS
public static final int CACHE_DUI_CHAINSCACHE_DUI+ cache standard ud-chains and du-chains- See Also:
-
CACHE_DUI_UDC_DUC
public static final int CACHE_DUI_UDC_DUCDeprecated.useCACHE_DUI_CHAINSinstead- See Also:
-
dbgDuCacheTotalQueryCount
-
dbgDuCacheTotalHitCount
-
dbgDuCalculationTotalExectimeNs
-
dbgUdCacheTotalQueryCount
-
dbgUdCacheTotalHitCount
-
dbgUdCalculationTotalExectimeNs
-
dbgVrCacheTotalQueryCount
-
dbgVrCacheTotalHitCount
-
dbgVrCalculationTotalExectimeNs
-
-
Constructor Details
-
DFA4
Create a DFA object with CFG-provided default collection flags and basic caching for instruction-level def-use information. This object can be further configured by invoking its various setters.- Parameters:
cfg-
-
DFA4
public DFA4(IControlFlowGraph<InsnType, ? extends IBasicBlock<InsnType>> cfg, int collectionFlags, int cacheConfig) Create a DFA object. This object can be further configured by invoking its various setters.- Parameters:
cfg-collectionFlags- collection flags, see constants inDefUseInfocacheConfig- 0= no cache, 1= cached for instruction-level def-use information; 2= 1 + cache for ud-chains and du-chains
-
-
Method Details
-
perform
public void perform()Description copied from interface:IDFAPerform data flow analysis on the CFG. Upon return, basic blocks will have their data chains (ud and du, full and simple) set up and accessible.- Specified by:
performin interfaceIDFA<InsnType extends IInstruction>
-
isValid
public boolean isValid()Description copied from interface:IDFADetermine whether the current analysis was performed and is valid.- Specified by:
isValidin interfaceIDFA<InsnType extends IInstruction>- Returns:
-
invalidate
public void invalidate()Description copied from interface:IDFAInvalidate the analysis. Clients have the responsibility to invalidate an analysis if the CFG was modified in such a way that data flow should be recalculated.- Specified by:
invalidatein interfaceIDFA<InsnType extends IInstruction>
-
notifyInstructionUpdate
public void notifyInstructionUpdate(long addr) - Specified by:
notifyInstructionUpdatein interfaceIDFA<InsnType extends IInstruction>
-
resetChainCaches
public void resetChainCaches() -
invalidateForRemoval
public void invalidateForRemoval(long addr0) Description copied from interface:IDFASelectively invalidate the cache in preparation for an instruction pseudo-removal (neutering). This method should be called before neutering takes place.- Specified by:
invalidateForRemovalin interfaceIDFA<InsnType extends IInstruction>- Parameters:
addr0- address of the start instruction; it is assumed that this instruction is no-throw
-
invalidateForSubstitution
public void invalidateForSubstitution(long addr0, Collection<Long> addr1coll, Collection<Long> srccoll) Description copied from interface:IDFASelectively invalidate the cache in preparation for an expression-substitution. This method should be called before the substitution by an immediate took place.- Specified by:
invalidateForSubstitutionin interfaceIDFA<InsnType extends IInstruction>- Parameters:
addr0- address of the start instruction, which defines the variable being substituted; it is assumed that this instruction is no-throwaddr1coll- mandatory collection of addresses where the substitutions will take place placesrccoll- optional collection of source instructions; if not provided, all instructions defining some of the substituted variables will be invalidated from the cache
-
invalidatePostSimpleSubstitutionWithMultiDefs
public void invalidatePostSimpleSubstitutionWithMultiDefs(Collection<Long> addr0coll, long addr1, int varid) Description copied from interface:IDFASelectively invalidate DFA cache after the substitution of a variableXby an immediate. This method should be called after the substitution by an immediate took place.- Specified by:
invalidatePostSimpleSubstitutionWithMultiDefsin interfaceIDFA<InsnType extends IInstruction>- Parameters:
addr0coll- collection of equivalent source instructions defining a target varX(e.g. X=3); these instructions must be left as-is when calling this method; it is assumed that these instructions are no-throwaddr1- destination instruction, whose target variableXwas replaced by a constantvarid- the variable that was propagated (X)
-
getCfg
Description copied from interface:IDFARetrieve a reference to the CFG object that will be accessed and modified when performing an analysis.- Specified by:
getCfgin interfaceIDFA<InsnType extends IInstruction>- Returns:
-
setVariableCollectionFlags
public void setVariableCollectionFlags(int flags) Description copied from interface:IDFASet the variable collection flags.- Specified by:
setVariableCollectionFlagsin interfaceIDFA<InsnType extends IInstruction>- Parameters:
flags- flags, seeDefUseInfo
-
getVariableCollectionFlags
public int getVariableCollectionFlags()Description copied from interface:IDFARetrieve the variable collection flags.- Specified by:
getVariableCollectionFlagsin interfaceIDFA<InsnType extends IInstruction>- Returns:
- flags, see
DefUseInfo
-
setCacheConfiguration
public void setCacheConfiguration(int value) Set or update the cache configuration of this object.- Parameters:
value- one ofCACHE_xxxattribute
-
getCacheConfiguration
public int getCacheConfiguration()Retrieve the cache configuration.- Returns:
- value one of
CACHE_xxxattribute
-
setIntegrateCalculatedInputRegisters
public boolean setIntegrateCalculatedInputRegisters(boolean enabled) - Specified by:
setIntegrateCalculatedInputRegistersin interfaceIDFA<InsnType extends IInstruction>- Parameters:
integrateCalculatedInputRegisters- if true, the live registers determined after analysis will be integrated in the use-def chains- Returns:
- the previous value for this setting
-
isIntegrateCalculatedInputRegisters
public boolean isIntegrateCalculatedInputRegisters()- Specified by:
isIntegrateCalculatedInputRegistersin interfaceIDFA<InsnType extends IInstruction>
-
setAlwaysExamineIrregularFlows
public boolean setAlwaysExamineIrregularFlows(boolean enabled) - Specified by:
setAlwaysExamineIrregularFlowsin interfaceIDFA<InsnType extends IInstruction>- Returns:
- the previous value for this setting
-
isAlwaysExamineIrregularFlows
public boolean isAlwaysExamineIrregularFlows()- Specified by:
isAlwaysExamineIrregularFlowsin interfaceIDFA<InsnType extends IInstruction>
-
setVariableInformationProvider
- Specified by:
setVariableInformationProviderin interfaceIDFA<InsnType extends IInstruction>- Returns:
- the previously set provider
-
getVariableInformationProvider
- Specified by:
getVariableInformationProviderin interfaceIDFA<InsnType extends IInstruction>
-
setMaxBlocks
public int setMaxBlocks(int maxBlocks) Description copied from interface:IDFASet an exploration threshold for most DFA operations. By default, there is no threshold. The threshold is a block count; if a block count is reached, a chain may contain a reference to the invalid address -2 in order to indicate an incomplete result.- Specified by:
setMaxBlocksin interfaceIDFA<InsnType extends IInstruction>- Parameters:
maxBlocks- -1 means no limit- Returns:
- the previous value for this setting
-
getMaxBlocks
public int getMaxBlocks()Description copied from interface:IDFARetrieve the maximum block count used for common DFA operations. SeeIDFA.setMaxBlocks(int)for details.- Specified by:
getMaxBlocksin interfaceIDFA<InsnType extends IInstruction>- Returns:
-
formatDUI
-
getDUI
- Specified by:
getDUIin interfaceIDFA<InsnType extends IInstruction>- Returns:
-
getDUI
- Specified by:
getDUIin interfaceIDFA<InsnType extends IInstruction>- Returns:
-
getDUI
- Specified by:
getDUIin interfaceIDFA<InsnType extends IInstruction>- Returns:
-
getUseDefs
public Collection<Long> getUseDefs(long addr, int varid, int stopcount, boolean verifyStartOnUsePoint, boolean recordLiveIn, IBasicBlock<InsnType> blkForReachChains, int idxForReachChains, boolean[] aDetectedUseDiscrepancy, boolean treatSpoiledAsDefs, int maxBlocks, boolean limitToStartBlock) Find the list of definition points for a used variable.- Parameters:
addr- initial instruction address (disregarded if computing reachability, in which case, blkForReachChains must be provided)varid- used variable, for which definitions are to be collectedstopcount- the search will stop if the def-count reaches that threshold; use <=0 to mean no stopcountverifyStartOnUsePoint- if true, the variable must be used at the provided instruction (else the method will return null)recordLiveIn- if true, a candidate argument-definition is recorded as -1 in the returned listblkForReachChains- optional basic block used to record reaching variablesidxForReachChains- optional block index used to record reaching variablesaDetectedUseDiscrepancy- optional one-element array, if provided, any use discrepancy (using a potentially undefined variable) will interrupt the search, and this flag will be set to truetreatSpoiledAsDefs- if true, spoiled information for variables will be treated as a regular definitionmaxBlocks- maximum number of basic blocks to be examined; use -1 to mean all; if a positive value is provided, the returned list of addresses may contain -2 to indicate that a definition may be located in an unexplored blocklimitToStartBlock-- Returns:
- a read-only collection of addresses where the variable was defined; the list may contain -1 to indicate a candidate argument-definition; never return null unless verifyStartOnUsePoint was true
-
getUseDefs
- Specified by:
getUseDefsin interfaceIDFA<InsnType extends IInstruction>- Parameters:
addr- instruction addressvarid- a variable, which must be used by the provided instruction- Returns:
- a collection (possibly empty) or null if the variable is not used by the instruction
-
getUseDefs
- Specified by:
getUseDefsin interfaceIDFA<InsnType extends IInstruction>- Parameters:
addr- instruction addressvarid- a variable, which must be used by the provided instruction- Returns:
- a collection (possibly empty) or null if the variable is not used by the instruction
-
getBlockUseDefs
- Specified by:
getBlockUseDefsin interfaceIDFA<InsnType extends IInstruction>
-
isTerminator
Description copied from interface:IDFADetermine whether the provided block is a terminator. A terminator has no output and its final instruction is a clean routine terminator.- Specified by:
isTerminatorin interfaceIDFA<InsnType extends IInstruction>- Parameters:
blk- block to test- Returns:
- true if the block is a clean terminator
-
getDefUses
public Collection<Long> getDefUses(long addr, int varid, int stopcount, boolean verifyStartOnDefPoint, boolean recordReachOut, IBasicBlock<InsnType> blkForLiveChains, int idxForLiveChains, int maxBlocks, boolean limitToStartBlock) Find the list of usage points for a defined variable.- Parameters:
addr- initial instruction address (disregarded if computing liveness, in which case, blkForLiveChains must be provided)varid- defined variablestopcount- the search will stop if the use-count reaches that threshold; use <= 0 to mean no stopcountverifyStartOnDefPoint- if true, the variable must be defined by the provided initial instruction (else the method will return null)recordReachOut- if true, if the variable reaches the CFG output, a pseudo usage will be recorded as -1blkForLiveChains- optional basic block used to record live variablesidxForLiveChains- optional block index used to record live variablesmaxBlocks- maximum number of basic blocks to be examined; use -1 to mean all; if a positive value is provided, the returned list of addresses may contain -2 to indicate that a usage may be located in an unexplored blocklimitToStartBlock- if true, the exploration will stop as soon as a use is detected outside the provided starting block, where the def took place, and -2 will be added to the returned list (if true, blkForLiveChains should be null); note: unlike what maxBlocks intends to do, a -2 in the resulting collection will indicate a definite out-of-block use- Returns:
- a read-only collection of addresses where the variable is used; the list may contain -1 to indicate the the variable reached an output; never returns null unless verifyStartOnDefPoint was true
-
getDefUses
- Specified by:
getDefUsesin interfaceIDFA<InsnType extends IInstruction>- Parameters:
addr- instruction addressvarid- a variable, which must be defined by the provided instruction- Returns:
- a collection (possibly empty) or null if the variable is not defined by the instruction
-
getDefUses
- Specified by:
getDefUsesin interfaceIDFA<InsnType extends IInstruction>- Parameters:
addr- instruction addressvarid- a variable, which must be defined by the provided instructionstopCount- optional stop count (-1 to collect as many uses as possible)- Returns:
- a collection (possibly empty) or null if the variable is not defined by the instruction
-
getDefUses
- Specified by:
getDefUsesin interfaceIDFA<InsnType extends IInstruction>- Parameters:
addr- instruction addressvarid- a variable, which must be defined by the provided instructionstopCount- optional stop count (-1 to collect as many uses as possible)recordReachOut- if true, a variable reaching is considered used (if so, the output list will contain -1)- Returns:
- a collection (possibly empty) or null if the variable is not defined by the instruction
-
getBlockDefUses
- Specified by:
getBlockDefUsesin interfaceIDFA<InsnType extends IInstruction>
-
getBlockDefUses
- Specified by:
getBlockDefUsesin interfaceIDFA<InsnType extends IInstruction>
-
checkNoUse
public int checkNoUse(long addr, int varid, boolean reachOutIsUse, int maxBlocks) Description copied from interface:IDFACheck whether a variable, defined at the provided instruction, is not used.- Specified by:
checkNoUsein interfaceIDFA<InsnType extends IInstruction>- Parameters:
addr- initial instruction addressvarid- defined variable at the initial instruction- Returns:
- 1: some uses; 0: no use; -1: no use, but may be a meaningful output; -2: unknown (may be returned only if maxBlocks is positive); -3: error
-
checkNoUse
public boolean checkNoUse(long insnAddress, int varId, boolean reachOutIsUse) Description copied from interface:IDFACheck whether a variable, defined at the provided instruction, is not used.- Specified by:
checkNoUsein interfaceIDFA<InsnType extends IInstruction>- Parameters:
insnAddress- initial instruction addressvarId- defined variable at the initial instruction- Returns:
- true if the variable is not used, and optionally (if reachOutIsUse is true), is overwritten before reaching possible end-blocks
-
checkNoUse
public boolean checkNoUse(long addr, int varid) Description copied from interface:IDFACheck whether a variable, defined at the provided instruction, is not used.- Specified by:
checkNoUsein interfaceIDFA<InsnType extends IInstruction>- Parameters:
addr- initial instruction addressvarid- defined variable at the initial instruction- Returns:
- true if the variable is not used; reaching-out is not considered a use
-
checkSingleUse
- Parameters:
addr-varid-reachOutIsUse-- Returns:
-
checkSingleUse
- Specified by:
checkSingleUsein interfaceIDFA<InsnType extends IInstruction>- Returns:
-
checkSingleDef
Check whether a used variable has a single explicit definition point (i.e. it is a non-input defined at a unique address).- Parameters:
addr- initial instruction addressvarid- used variable at the initial instructionliveInIsDef-- Returns:
- the instruction address, if the variable used at the provided instruction has a single def-point; -1 is returned if the variable has no explicit def-point (as would be the case for method arguments); on error, or if multiple def-points are detected, null is returned
-
checkSingleDefNoInput
Description copied from interface:IDFACheck whether a used variable has a single explicit definition point. The def point cannot be a routine input (i.e. the definition must be explicit).- Specified by:
checkSingleDefNoInputin interfaceIDFA<InsnType extends IInstruction>- Parameters:
addr- initial instruction addressvarid- used variable at the initial instruction- Returns:
-
checkSingleDef
Description copied from interface:IDFACheck whether a used variable has a single definition point. The def point may be explicit (e.g. resulting from an assignment) or implicit (e.g. provided as a parameter to the routine, which is always represented as the address -1).- Specified by:
checkSingleDefin interfaceIDFA<InsnType extends IInstruction>- Parameters:
addr- initial instruction addressvarid- used variable at the initial instruction (it must be used at the provided address; else, refer tocheckSingleSource)- Returns:
-
checkSingleSource
- Specified by:
checkSingleSourcein interfaceIDFA<InsnType extends IInstruction>- Returns:
-
checkSingleSource
- Specified by:
checkSingleSourcein interfaceIDFA<InsnType extends IInstruction>- Returns:
-
collectInstructionAllDefs
- Specified by:
collectInstructionAllDefsin interfaceIDFA<InsnType extends IInstruction>
-
collectInstructionAllUses
- Specified by:
collectInstructionAllUsesin interfaceIDFA<InsnType extends IInstruction>
-
getInstructionAllDefs
- Specified by:
getInstructionAllDefsin interfaceIDFA<InsnType extends IInstruction>
-
getInstructionAllUses
- Specified by:
getInstructionAllUsesin interfaceIDFA<InsnType extends IInstruction>
-
getInstructionDefs
- Specified by:
getInstructionDefsin interfaceIDFA<InsnType extends IInstruction>- Returns:
- a list of variables defined by the instruction at index in the block
-
getInstructionUses
- Specified by:
getInstructionUsesin interfaceIDFA<InsnType extends IInstruction>- Returns:
- a list of variables used by the instruction at index in the block
-
getInstructionPotentialDefs
- Specified by:
getInstructionPotentialDefsin interfaceIDFA<InsnType extends IInstruction>- Returns:
- a list of variables potentially defined by the instruction at index in the block; note that this data may not be present (empty lists) depending on DFA settings
-
getInstructionPotentialUses
- Specified by:
getInstructionPotentialUsesin interfaceIDFA<InsnType extends IInstruction>- Returns:
- a list of variables potentially used by the instruction at index in the block; note that this data may not be present (empty lists) depending on DFA settings
-
getInstructionSpoiledDefs
- Specified by:
getInstructionSpoiledDefsin interfaceIDFA<InsnType extends IInstruction>- Returns:
- a list of variables potentially spoiled by the instruction at index in the block; note that this data may not be present (empty lists) depending on DFA settings
-
getUseDefChains
-
getUseDefChains
- Specified by:
getUseDefChainsin interfaceIDFA<InsnType extends IInstruction>
-
getDefUseChains
-
getDefUseChains
- Specified by:
getDefUseChainsin interfaceIDFA<InsnType extends IInstruction>
-
getLiveChains
public Map<Integer,Collection<Long>> getLiveChains(IBasicBlock<InsnType> b, int idx, Collection<Integer> varids, int stopcount) -
getLiveChains
- Specified by:
getLiveChainsin interfaceIDFA<InsnType extends IInstruction>
-
getLiveChains
- Specified by:
getLiveChainsin interfaceIDFA<InsnType extends IInstruction>
-
getLiveChains
- Specified by:
getLiveChainsin interfaceIDFA<InsnType extends IInstruction>
-
isAlive
- Specified by:
isAlivein interfaceIDFA<InsnType extends IInstruction>
-
getReachChains
public Map<Integer,Collection<Long>> getReachChains(IBasicBlock<InsnType> b, int idx, Collection<Integer> varids, int stopcount) -
getReachChains
- Specified by:
getReachChainsin interfaceIDFA<InsnType extends IInstruction>
-
getReachChains
- Specified by:
getReachChainsin interfaceIDFA<InsnType extends IInstruction>
-
getReachChains
- Specified by:
getReachChainsin interfaceIDFA<InsnType extends IInstruction>
-
isReaching
- Specified by:
isReachingin interfaceIDFA<InsnType extends IInstruction>
-
getUseDiscrepancies
Description copied from interface:IDFARetrieve the list of use-discrepancies at the provided instruction address.- Specified by:
getUseDiscrepanciesin interfaceIDFA<InsnType extends IInstruction>- Parameters:
addr- instruction address- Returns:
- a list of variables whose usage at the provided location appears to be incorrect (i.e. not all paths to this usage carry a definition if the variable)
-
isUseDiscrepancy
public boolean isUseDiscrepancy(long addr, int varid) - Specified by:
isUseDiscrepancyin interfaceIDFA<InsnType extends IInstruction>- Returns:
-
checkInput
public boolean checkInput(int varid) -
getInputs
- Specified by:
getInputsin interfaceIDFA<InsnType extends IInstruction>
-
filterInputs
- Parameters:
varids- optional collection of potential argument variables for which we want to verify uses; leave null to retrieve all potential arguments- Returns:
- a collection of variables that are used in the routine, that look like they have definitions outside the routine (if `varids` was provided, this output collection is a subset of it)
-
getInputsWithUses
- Returns:
-
checkInputWithUses
-
filterInputsWithUses
- Parameters:
varids-- Returns:
-
getInputMap
- Specified by:
getInputMapin interfaceIDFA<InsnType extends IInstruction>
-
getInputMap
- Specified by:
getInputMapin interfaceIDFA<InsnType extends IInstruction>
-
checkOutput
-
getOutputs
- Specified by:
getOutputsin interfaceIDFA<InsnType extends IInstruction>
-
filterOutputs
-
getOutputsWithDefs
-
checkOutputsWithDefs
-
filterOutputsWithDefs
public Map<Integer,Collection<Long>> filterOutputsWithDefs(IBasicBlock<InsnType> blk, Collection<Integer> varids) -
getOutputMap
- Specified by:
getOutputMapin interfaceIDFA<InsnType extends IInstruction>
-
getOutputMap
- Specified by:
getOutputMapin interfaceIDFA<InsnType extends IInstruction>
-
checkOutput
public boolean checkOutput(int varid) -
getOutputs
- Specified by:
getOutputsin interfaceIDFA<InsnType extends IInstruction>
-
filterOutputs
-
getOutputsWithDefs
-
checkOutputsWithDefs
-
filterOutputsWithDefs
-
getOutputMap
- Specified by:
getOutputMapin interfaceIDFA<InsnType extends IInstruction>
-
getOutputMap
- Specified by:
getOutputMapin interfaceIDFA<InsnType extends IInstruction>
-
isNotRedefined
public boolean isNotRedefined(int varid, long addr0, long addr1) -
isNotRedefined
public boolean isNotRedefined(int varid, IBasicBlock<InsnType> b0, int i0, IBasicBlock<InsnType> b1, int i1) -
isVarReachingFromTo
Description copied from interface:IDFADetermine if a variable used by the start instruction reaches the final instruction with the same value.Important notes:
- This method provides a must-reach result: if a multiple paths exist from source to sink, where the variable reaches the sink via some paths, but not on others (it is overwritten), the method returns false.
- This method works from the source to the sink, and provides the guarantee that the variable was not overwritten when it reached the sink. There is no guarantee provided at the sink itself regarding other paths that may exist from different sources to the same sink.
- This method also checks that the paths from the sink back that may connect back to the sink do not overwrite the variable defined at the source.- Specified by:
isVarReachingFromToin interfaceIDFA<InsnType extends IInstruction>- Parameters:
varid- variable idaddr0- source: start address, exclusiveaddr1- sink: final address, also exclusive- Returns:
- success indicator; null means unknown
-
isVarReachingFromTo
public Boolean isVarReachingFromTo(int varid, IBasicBlock<InsnType> b0, int i0, IBasicBlock<InsnType> b1, int i1) Description copied from interface:IDFADetermine if a variable used by the start instruction reaches the final instruction with the same value.Important notes:
- This method provides a must-reach result: if a multiple paths exist from source to sink, where the variable reaches the sink via some paths, but not on others (it is overwritten), the method returns false.
- This method works from the source to the sink, and provides the guarantee that the variable was not overwritten when it reached the sink. There is no guarantee provided at the sink itself regarding other paths that may exist from different sources to the same sink.
- This method also checks that the paths from the sink back that may connect back to the sink do not overwrite the variable defined at the source.- Specified by:
isVarReachingFromToin interfaceIDFA<InsnType extends IInstruction>- Parameters:
varid- variable idb0- start block (source)i0- final block (sink)b1- index of the start instruction in the start block, exclusivei1- index of the final instruction in the final block, also exclusive- Returns:
- success indicator; null means unknown
-
isVarReachingFromTo
public Boolean isVarReachingFromTo(int varid, IBasicBlock<InsnType> b0, int i0, IBasicBlock<InsnType> b1, int i1, boolean performExtendedChecks, int maxBlocks) Description copied from interface:IDFADetermine if a variable used by the start instruction reaches the final instruction with the same value.Important notes:
- This method provides a must-reach result: if a multiple paths exist from source to sink, where the variable reaches the sink via some paths, but not on others (it is overwritten), the method returns false.
- This method works from the source to the sink, and provides the guarantee that the variable was not overwritten when it reached the sink. There is no guarantee provided at the sink itself regarding other paths that may exist from different sources to the same sink.
- if `performExtendedChecks` is true, this method also checks that the paths from the sink back that may connect back to the sink do not overwrite the variable defined at the source.- Specified by:
isVarReachingFromToin interfaceIDFA<InsnType extends IInstruction>- Parameters:
varid- variable idb0- start block (source)i0- final block (sink)b1- index of the start instruction in the start block, exclusivei1- index of the final instruction in the final block, also exclusivemaxBlocks- optional maximum count of blocks to be explored before failing- Returns:
- success indicator; null means unknown
-
isVarReachingFromTo
public Boolean isVarReachingFromTo(int varid, IBasicBlock<InsnType> b0, int i0, IBasicBlock<InsnType> b1, int i1, boolean allowRedef, boolean performExtendedChecks, int maxBlocks) -
verifyNoRedefAfterSink
-
verifyNoRedefAfterSink
public Boolean verifyNoRedefAfterSink(int varid, IBasicBlock<InsnType> b0, int i0, IBasicBlock<InsnType> b1, int i1, int maxBlocks) -
toString
-
CACHE_DUI_CHAINSinstead