diff options
| author | Peter LaFosse <peter@vector35.com> | 2021-10-27 07:33:08 -0400 |
|---|---|---|
| committer | Peter LaFosse <peter@vector35.com> | 2021-11-05 10:30:12 -0400 |
| commit | 64797d7c23824a991fe6285a6a3bb0dcee2dd495 (patch) | |
| tree | dd974f93a349a8486533f91c817f51ab9d8d8909 /python/lowlevelil.py | |
| parent | 2386158d10d402b7783ab6f1253f548d230896c8 (diff) | |
Add IL class heirarchy graph report
Diffstat (limited to 'python/lowlevelil.py')
| -rw-r--r-- | python/lowlevelil.py | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/python/lowlevelil.py b/python/lowlevelil.py index 80349987..a301dc2a 100644 --- a/python/lowlevelil.py +++ b/python/lowlevelil.py @@ -35,6 +35,7 @@ from . import variable from . import binaryview from . import architecture from . import types +from .interaction import show_graph_report from .commonil import (ILInstruction, Constant, BinaryOperation, UnaryOperation, Comparison, SSA, Phi, FloatingPoint, ControlFlow, Terminal, Call, StackOperation, Return, Signed, Arithmetic, Carry, DoublePrecision, Memory, Load, Store, RegisterStack, SetReg) @@ -448,6 +449,14 @@ class LowLevelILInstruction(ILInstruction): LowLevelILOperation.LLIL_MEM_PHI: [("dest_memory", "int"), ("src_memory", "int_list")] } + @staticmethod + def show_llil_hierarchy(): + graph = flowgraph.FlowGraph() + nodes = {} + for instruction in ILInstruction.values(): + instruction.add_subgraph(graph, nodes) + show_graph_report("LLIL Class Hierarchy Graph", graph) + @classmethod def create(cls, func:'LowLevelILFunction', expr_index:ExpressionIndex, instr_index:Optional[InstructionIndex]=None) -> 'LowLevelILInstruction': assert func.arch is not None, "Attempted to create IL instruction with function missing an Architecture" @@ -1514,7 +1523,7 @@ class LowLevelILCall_param(LowLevelILInstruction, SSA): @dataclass(frozen=True, repr=False) -class LowLevelILMem_phi(LowLevelILInstruction, Memory, SSA): +class LowLevelILMem_phi(LowLevelILInstruction, Memory, Phi): @property def dest_memory(self) -> int: @@ -2102,7 +2111,7 @@ class LowLevelILLoad_ssa(LowLevelILInstruction, Load, SSA): @dataclass(frozen=True, repr=False) -class LowLevelILReg_phi(LowLevelILInstruction, SSA): +class LowLevelILReg_phi(LowLevelILInstruction, Phi): @property def dest(self) -> SSARegister: @@ -2118,7 +2127,7 @@ class LowLevelILReg_phi(LowLevelILInstruction, SSA): @dataclass(frozen=True, repr=False) -class LowLevelILReg_stack_phi(LowLevelILInstruction, RegisterStack, SSA): +class LowLevelILReg_stack_phi(LowLevelILInstruction, RegisterStack, Phi): @property def dest(self) -> SSARegisterStack: @@ -2134,7 +2143,7 @@ class LowLevelILReg_stack_phi(LowLevelILInstruction, RegisterStack, SSA): @dataclass(frozen=True, repr=False) -class LowLevelILFlag_phi(LowLevelILInstruction, SSA): +class LowLevelILFlag_phi(LowLevelILInstruction, Phi): @property def dest(self) -> SSAFlag: |
