| java.lang.Object | |
| ↳ | com.pnfsoftware.jeb.core.units.code.asm.cfg.CFGUtil |
Static utility routines for control flow graphs.
| Public Constructors | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| CFGUtil() | |||||||||||
| Public Methods | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| static <T extends IInstruction> boolean |
compare(CFG<T> cfg1, CFG<T> cfg2)
Basic CFG comparison.
| ||||||||||
| static <T extends IInstruction> boolean |
compare(int failmode, Comparator<T> comparator, CFG<T> cfg1, CFG<T> cfg2)
Basic CFG comparison.
| ||||||||||
| static <T extends IInstruction> CFG<T> |
duplicateShallow(CFG<T> cfg)
Shallow duplication of a CFG.
| ||||||||||
| static <T extends IInstruction> Collection<BasicBlock<T>> |
getReachableBlocks(CFG<T> cfg)
Collect the list of all blocks reachable from the entry point.
| ||||||||||
| static <T extends IInstruction> int |
removeUnreachableBlocks(CFG<T> cfg)
Remove all blocks not reachable from the entry-point.
| ||||||||||
| static <T extends IInstruction> int |
removeUnreachableBlocks(CFG<T> cfg, List<BasicBlock<T>> tbr)
Remove a list of blocks from the CFG.
| ||||||||||
|
[Expand]
Inherited Methods | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Object
| |||||||||||
Basic CFG comparison. Expect same flags, same addresses, same blocks, same instruction in blocks. What is not checked: DFA data (N/A), flow/edges information (theoretically equal if comparison succeeds since flow information is derived from CFG flags + instructions).
| cfg1 | first CFG |
|---|---|
| cfg2 | second CFG |
Basic CFG comparison. Expect same flags, same addresses, same blocks, same instruction in blocks. What is not checked: DFA data (N/A), flow/edges information (theoretically equal if comparison succeeds since flow information is derived from CFG flags + instructions).
| failmode | 0=normal failure (no log, return false) 1=normal failure with log, return false 2=throw a RuntimeException with message |
|---|---|
| comparator | custom instruction comparator (optional) |
| cfg1 | first CFG |
| cfg2 | second CFG |
Shallow duplication of a CFG. The duplicated CFG references the instructions of the original CFG.
| cfg | original CFG |
|---|
Collect the list of all blocks reachable from the entry point.
Remove all blocks not reachable from the entry-point.
If the CFG is composed of IResizableInstruction, instruction sizes may be adjusted to
avoid the introduction of gaps between blocks.
| cfg | CFG |
|---|
Remove a list of blocks from the CFG.
If the CFG is composed of IResizableInstruction, instruction sizes may be adjusted to
avoid the introduction of gaps between blocks.
| cfg | CFG |
|---|---|
| tbr | bootstrap list of blocks to be removed: those blocks will be removed as well as all blocks no longer reachable from the entry point from the result of those deletions |