diff options
| author | Brian Potchik <brian@vector35.com> | 2021-01-20 10:53:04 -0500 |
|---|---|---|
| committer | Brian Potchik <brian@vector35.com> | 2021-01-20 10:53:04 -0500 |
| commit | f1166563f54d28a745eb781dfe27c13a099bb7d9 (patch) | |
| tree | 7d34521fa7189085cd193bf45ca05ad1f9e91753 /python/function.py | |
| parent | 13f6e450824dbce2e73b9139dc7283ef903210d1 (diff) | |
Add get_lifted_ils_at API.
Diffstat (limited to 'python/function.py')
| -rw-r--r-- | python/function.py | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/python/function.py b/python/function.py index 3cf27dc3..0c85ed19 100644 --- a/python/function.py +++ b/python/function.py @@ -2243,6 +2243,29 @@ class Function(object): return self.lifted_il[idx] + def get_lifted_ils_at(self, addr, arch=None): + """ + ``get_lifted_ils_at`` gets the Lifted IL Instruction(s) corresponding to the given virtual address + + :param int addr: virtual address of the function to be queried + :param Architecture arch: (optional) Architecture for the given function + :rtype: list(LowLevelILInstruction) + :Example: + + >>> func = bv.functions[0] + >>> func.get_lifted_ils_at(func.start) + [<il: push(rbp)>] + """ + if arch is None: + arch = self.arch + count = ctypes.c_ulonglong() + instrs = core.BNGetLiftedILInstructionsForAddress(self.handle, arch.handle, addr, count) + result = [] + for i in range(0, count.value): + result.append(self.lifted_il[instrs[i]]) + core.BNFreeILInstructionList(instrs) + return result + def get_lifted_il_flag_uses_for_definition(self, i, flag): flag = self.arch.get_flag_index(flag) count = ctypes.c_ulonglong() |
