diff options
| author | Rusty Wagner <rusty@vector35.com> | 2018-04-02 23:30:56 -0400 |
|---|---|---|
| committer | Rusty Wagner <rusty@vector35.com> | 2018-04-02 23:31:59 -0400 |
| commit | fa716fe2da53a4f136380b1f60197bd197b2793a (patch) | |
| tree | 9a8baea24f8d40072e75f33f76900fde5ee473fc /python/basicblock.py | |
| parent | 5055d38ef59c570d21dcb6ce6855961e270f1042 (diff) | |
Add plugin commands for LLIL and MLIL
Diffstat (limited to 'python/basicblock.py')
| -rw-r--r-- | python/basicblock.py | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/python/basicblock.py b/python/basicblock.py index 1d932c5e..4dc783c3 100644 --- a/python/basicblock.py +++ b/python/basicblock.py @@ -256,6 +256,21 @@ class BasicBlock(object): def highlight(self, value): self.set_user_highlight(value) + @property + def is_il(self): + """Whether the basic block contains IL""" + return core.BNIsILBasicBlock(self.handle) + + @property + def is_low_level_il(self): + """Whether the basic block contains Low Level IL""" + return core.BNIsLowLevelILBasicBlock(self.handle) + + @property + def is_medium_level_il(self): + """Whether the basic block contains Medium Level IL""" + return core.BNIsMediumLevelILBasicBlock(self.handle) + @classmethod def get_iterated_dominance_frontier(self, blocks): if len(blocks) == 0: @@ -322,6 +337,10 @@ class BasicBlock(object): result = [] for i in xrange(0, count.value): addr = lines[i].addr + if (lines[i].instrIndex != 0xffffffffffffffff) and hasattr(self, 'il_function'): + il_instr = self.il_function[lines[i].instrIndex] + else: + il_instr = None tokens = [] for j in xrange(0, lines[i].count): token_type = InstructionTextTokenType(lines[i].tokens[j].type) @@ -333,7 +352,7 @@ class BasicBlock(object): confidence = lines[i].tokens[j].confidence address = lines[i].tokens[j].address tokens.append(function.InstructionTextToken(token_type, text, value, size, operand, context, address, confidence)) - result.append(function.DisassemblyTextLine(addr, tokens)) + result.append(function.DisassemblyTextLine(addr, tokens, il_instr)) core.BNFreeDisassemblyTextLines(lines, count.value) return result |
