Class AbstractCFGReorganizer<InsnType extends IInstruction>
java.lang.Object
com.pnfsoftware.jeb.core.units.code.asm.cfg.AbstractCFGReorganizer<InsnType>
Facility for CFG graph nodes reordering. Trampoline blocks will be created to ensure the original
execution flow is maintained.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract booleancanFallthrough(InsnType insn) Determine if the provided instruction is a flow breaker that falls-through (or may, if it's a conditional branch) into the first instruction of the next block.protected abstract InsnTypecreateNop(int insnSize) protected abstract InsnTypecreateTrampoline(long tempTarget) Create a trampoline instruction whose size must be 1.Retrieve a map holding the old offsets to their corresponding new offsets, in the reorganized CFG.Retrieve a CFG reorganized byreorder(int[]).protected abstract booleanhasTargets(InsnType insn) Determine whether the instruction has targets that may be updated.reorder(int[] newOrder) protected abstract voidupdateTargets(InsnType insn, Map<Long, Long> map) protected abstract voidupdateTrampolineTarget(InsnType insn, long target)
-
Constructor Details
-
AbstractCFGReorganizer
-
-
Method Details
-
reorder
- Parameters:
newOrder- an array of 0-based indices from 0 to n-1; providing [0, 1, ..., n-1] does nothing- Returns:
- a reordered CFG; null if the provided order was the original order
-
getReorganizedCfg
Retrieve a CFG reorganized byreorder(int[]).- Returns:
-
getConversionMap
Retrieve a map holding the old offsets to their corresponding new offsets, in the reorganized CFG.- Returns:
-
canFallthrough
Determine if the provided instruction is a flow breaker that falls-through (or may, if it's a conditional branch) into the first instruction of the next block.- Parameters:
insn-- Returns:
-
createTrampoline
Create a trampoline instruction whose size must be 1.- Parameters:
tempTarget-- Returns:
-
createNop
- Parameters:
insnSize-- Returns:
-
updateTrampolineTarget
- Parameters:
insn- must be a trampoline instructiontarget-
-
hasTargets
Determine whether the instruction has targets that may be updated.- Parameters:
insn-- Returns:
-
updateTargets
- Parameters:
insn-map-
-
buildCFG
- Parameters:
statements-- Returns:
-