diff options
| author | Peter LaFosse <peter@vector35.com> | 2018-04-04 14:11:55 -0400 |
|---|---|---|
| committer | Peter LaFosse <peter@vector35.com> | 2018-04-04 14:11:55 -0400 |
| commit | d990d5ebf56eb0f1a7d96e98577cb9ace9dac19d (patch) | |
| tree | 752649d87db23f95a59384f5325b94b734e1c27b /python/basicblock.py | |
| parent | 1eb3683b3a1ee0d263267b1e84957fadea7fadaa (diff) | |
| parent | fa716fe2da53a4f136380b1f60197bd197b2793a (diff) | |
Merging with dev
Diffstat (limited to 'python/basicblock.py')
| -rw-r--r-- | python/basicblock.py | 23 |
1 files changed, 21 insertions, 2 deletions
diff --git a/python/basicblock.py b/python/basicblock.py index 8e64c1c1..4dc783c3 100644 --- a/python/basicblock.py +++ b/python/basicblock.py @@ -100,7 +100,7 @@ class BasicBlock(object): arch = core.BNGetBasicBlockArchitecture(self.handle) if arch is None: return None - self._arch = architecture.Architecture(arch) + self._arch = architecture.CoreArchitecture._from_cache(arch) return self._arch @property @@ -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 |
