diff options
| author | Peter LaFosse <peter@vector35.com> | 2021-11-09 09:03:26 -0500 |
|---|---|---|
| committer | Peter LaFosse <peter@vector35.com> | 2021-11-10 10:52:49 -0500 |
| commit | 9ec0b9b5a5b03fcd9201cd9acd649f13c31f24fb (patch) | |
| tree | b70d126af074313eb8aedba7a76a08286dc259b4 /python | |
| parent | c61d108ad726a713e69e072da736206db4b29e85 (diff) | |
Fix name collision on 'ILInstruction'
Diffstat (limited to 'python')
| -rw-r--r-- | python/commonil.py | 32 | ||||
| -rw-r--r-- | python/highlevelil.py | 4 | ||||
| -rw-r--r-- | python/lowlevelil.py | 4 | ||||
| -rw-r--r-- | python/mediumlevelil.py | 6 |
4 files changed, 23 insertions, 23 deletions
diff --git a/python/commonil.py b/python/commonil.py index 4f0eb7f2..8a04d140 100644 --- a/python/commonil.py +++ b/python/commonil.py @@ -26,11 +26,11 @@ from .log import log_warn # This file contains a list of top level abstract classes for implementing BNIL instructions @dataclass(frozen=True, repr=False) -class ILInstruction: +class BaseILInstruction: @classmethod def prepend_parent(cls, graph:FlowGraph, node:FlowGraphNode, nodes={}): for parent in cls.__bases__: - if not issubclass(parent, ILInstruction): + if not issubclass(parent, BaseILInstruction): continue if parent.__name__ in nodes: nodes[parent.__name__].add_outgoing_edge(BranchType.UnconditionalBranch, node) @@ -55,17 +55,17 @@ class ILInstruction: show_graph_report(f"{cls.__name__}", cls.add_subgraph(FlowGraph(), {})) @dataclass(frozen=True, repr=False) -class Constant(ILInstruction): +class Constant(BaseILInstruction): pass @dataclass(frozen=True, repr=False) -class BinaryOperation(ILInstruction): +class BinaryOperation(BaseILInstruction): pass @dataclass(frozen=True, repr=False) -class UnaryOperation(ILInstruction): +class UnaryOperation(BaseILInstruction): pass @@ -75,7 +75,7 @@ class Comparison(BinaryOperation): @dataclass(frozen=True, repr=False) -class SSA(ILInstruction): +class SSA(BaseILInstruction): pass @@ -85,12 +85,12 @@ class Phi(SSA): @dataclass(frozen=True, repr=False) -class FloatingPoint(ILInstruction): +class FloatingPoint(BaseILInstruction): pass @dataclass(frozen=True, repr=False) -class ControlFlow(ILInstruction): +class ControlFlow(BaseILInstruction): pass @@ -124,12 +124,12 @@ class Return(Terminal): @dataclass(frozen=True, repr=False) -class Signed(ILInstruction): +class Signed(BaseILInstruction): pass @dataclass(frozen=True, repr=False) -class Arithmetic(ILInstruction): +class Arithmetic(BaseILInstruction): pass @@ -144,32 +144,32 @@ class DoublePrecision(Arithmetic): @dataclass(frozen=True, repr=False) -class Memory(ILInstruction): +class Memory(BaseILInstruction): pass @dataclass(frozen=True, repr=False) -class Load(ILInstruction): +class Load(BaseILInstruction): pass @dataclass(frozen=True, repr=False) -class Store(ILInstruction): +class Store(BaseILInstruction): pass @dataclass(frozen=True, repr=False) -class RegisterStack(ILInstruction): +class RegisterStack(BaseILInstruction): pass @dataclass(frozen=True, repr=False) -class SetVar(ILInstruction): +class SetVar(BaseILInstruction): pass @dataclass(frozen=True, repr=False) -class StackOperation(ILInstruction): +class StackOperation(BaseILInstruction): pass diff --git a/python/highlevelil.py b/python/highlevelil.py index 44985fd4..4beeb789 100644 --- a/python/highlevelil.py +++ b/python/highlevelil.py @@ -39,7 +39,7 @@ from . import flowgraph from . import variable from .log import log_info from .interaction import show_graph_report -from .commonil import (ILInstruction, Call, Tailcall, Syscall, Comparison, Signed, UnaryOperation, BinaryOperation, +from .commonil import (BaseILInstruction, Call, Tailcall, Syscall, Comparison, Signed, UnaryOperation, BinaryOperation, SSA, Phi, Loop, ControlFlow, Memory, Constant, Arithmetic, DoublePrecision, Terminal, FloatingPoint) @@ -130,7 +130,7 @@ class CoreHighLevelILInstruction: @dataclass(frozen=True) -class HighLevelILInstruction(ILInstruction): +class HighLevelILInstruction(BaseILInstruction): """ ``class HighLevelILInstruction`` High Level Intermediate Language Instructions form an abstract syntax tree of the code. Control flow structures are present as high level constructs in the HLIL tree. diff --git a/python/lowlevelil.py b/python/lowlevelil.py index 3bf8a592..49b7a408 100644 --- a/python/lowlevelil.py +++ b/python/lowlevelil.py @@ -36,7 +36,7 @@ from . import binaryview from . import architecture from . import types from .interaction import show_graph_report -from .commonil import (ILInstruction, Constant, BinaryOperation, UnaryOperation, Comparison, SSA, +from .commonil import (BaseILInstruction, Constant, BinaryOperation, UnaryOperation, Comparison, SSA, Phi, FloatingPoint, ControlFlow, Terminal, Call, StackOperation, Return, Signed, Arithmetic, Carry, DoublePrecision, Memory, Load, Store, RegisterStack, SetReg) @@ -300,7 +300,7 @@ class CoreLowLevelILInstruction: @dataclass(frozen=True) -class LowLevelILInstruction(ILInstruction): +class LowLevelILInstruction(BaseILInstruction): """ ``class LowLevelILInstruction`` Low Level Intermediate Language Instructions are infinite length tree-based instructions. Tree-based instructions use infix notation with the left hand operand being the destination operand. diff --git a/python/mediumlevelil.py b/python/mediumlevelil.py index c4e77af2..0808b8ad 100644 --- a/python/mediumlevelil.py +++ b/python/mediumlevelil.py @@ -36,7 +36,7 @@ from . import variable from . import architecture from . import binaryview from .interaction import show_graph_report -from .commonil import (ILInstruction, Constant, BinaryOperation, UnaryOperation, Comparison, SSA, +from .commonil import (BaseILInstruction, Constant, BinaryOperation, UnaryOperation, Comparison, SSA, Phi, FloatingPoint, ControlFlow, Terminal, Call, Syscall, Tailcall, Return, Signed, Arithmetic, Carry, DoublePrecision, Memory, Load, Store, RegisterStack, SetVar) @@ -106,7 +106,7 @@ class CoreMediumLevelILInstruction: @dataclass(frozen=True) -class MediumLevelILInstruction(ILInstruction): +class MediumLevelILInstruction(BaseILInstruction): """ ``class MediumLevelILInstruction`` Medium Level Intermediate Language Instructions are infinite length tree-based instructions. Tree-based instructions use infix notation with the left hand operand being the destination operand. @@ -255,7 +255,7 @@ class MediumLevelILInstruction(ILInstruction): def show_mlil_hierarchy(): graph = flowgraph.FlowGraph() nodes = {} - for instruction in ILOperations.values(): + for instruction in ILInstruction.values(): instruction.add_subgraph(graph, nodes) show_graph_report("MLIL Class Hierarchy Graph", graph) |
