From a43fb5d02a651a5d0ae92f06cb7282557bc045b3 Mon Sep 17 00:00:00 2001 From: Claude Hemberger Date: Sat, 28 Jan 2017 13:32:29 +0100 Subject: example documentation fix for BinaryWriter --- python/binaryview.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'python') diff --git a/python/binaryview.py b/python/binaryview.py index 476f2be6..def04077 100644 --- a/python/binaryview.py +++ b/python/binaryview.py @@ -3591,7 +3591,7 @@ class BinaryWriter(object): >>> hex(bw.offset) '0x100000008L' >>> bw.seek(0x100000000) - >>> hex(br.offset) + >>> hex(bw.offset) '0x100000000L' >>> """ @@ -3608,7 +3608,7 @@ class BinaryWriter(object): >>> hex(bw.offset) '0x100000008L' >>> bw.seek_relative(-8) - >>> hex(br.offset) + >>> hex(bw.offset) '0x100000000L' >>> """ -- cgit v1.3.1 From fa8006024f68a3c924cce95b2ffb62880aa99bed Mon Sep 17 00:00:00 2001 From: Andrew Lamoureux Date: Wed, 15 Mar 2017 12:02:06 -0400 Subject: convenience function for bytes->IL new function: get_low_leveil_il_from_bytes() in Architecture example use: >>> arch.get_low_level_il_from_bytes('\xeb\xfe', 0x40DEAD) --- python/architecture.py | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'python') diff --git a/python/architecture.py b/python/architecture.py index 39e5e72d..079d3f5f 100644 --- a/python/architecture.py +++ b/python/architecture.py @@ -1191,6 +1191,24 @@ class Architecture(object): core.BNGetInstructionLowLevelIL(self.handle, buf, addr, length, il.handle) return length.value + def get_low_level_il_from_bytes(self, data, addr): + """ + ``get_low_level_il_from_bytes`` converts the instruction in bytes to ``il`` at the given virtual address + + :param str data: the bytes of the instruction + :param int addr: virtual address of bytes in ``data`` + :return: the instruction + :rtype: LowLevelILInstruction + :Example: + + >>> arch.get_low_level_il_from_bytes('\xeb\xfe', 0x40DEAD) + + >>> + """ + func = lowlevelil.LowLevelILFunction(self) + self.get_instruction_low_level_il(data, addr, func) + return func[0] + def get_reg_name(self, reg): """ ``get_reg_name`` gets a register name from a register number. -- cgit v1.3.1 From b049ec1662df13d409d149d937fa3366c33b32a1 Mon Sep 17 00:00:00 2001 From: Jordan Wiens Date: Sun, 19 Mar 2017 01:19:38 -0400 Subject: change types in documentation for lowlevelil so the results will be clickable, resolves #583 --- python/function.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'python') diff --git a/python/function.py b/python/function.py index 86c93bf7..e1c202f9 100644 --- a/python/function.py +++ b/python/function.py @@ -289,12 +289,12 @@ class Function(object): @property def low_level_il(self): - """Function low level IL (read-only)""" + """returns LowLevelILFunction used to represent Function low level IL (read-only)""" return lowlevelil.LowLevelILFunction(self.arch, core.BNGetFunctionLowLevelIL(self.handle), self) @property def lifted_il(self): - """Function lifted IL (read-only)""" + """returns LowLevelILFunction used to represent lifted IL (read-only)""" return lowlevelil.LowLevelILFunction(self.arch, core.BNGetFunctionLiftedIL(self.handle), self) @property -- cgit v1.3.1 From b7509f379376a828b99cf71294b74d4f47ddbf91 Mon Sep 17 00:00:00 2001 From: Jordan Wiens Date: Wed, 22 Mar 2017 19:27:52 -0400 Subject: update documentation for get_instruction_low_level_il --- python/architecture.py | 3 +++ 1 file changed, 3 insertions(+) (limited to 'python') diff --git a/python/architecture.py b/python/architecture.py index 079d3f5f..d3778613 100644 --- a/python/architecture.py +++ b/python/architecture.py @@ -1177,6 +1177,9 @@ class Architecture(object): ``get_instruction_low_level_il`` appends LowLevelILExpr objects to ``il`` for the instruction at the given virtual address ``addr`` with data ``data``. + This is used to analyze arbitrary data at an address, if you are working with an existing binary, you likely + want to be using ``Function.get_low_level_il_at``. + :param str data: max_instruction_length bytes from the binary at virtual address ``addr`` :param int addr: virtual address of bytes in ``data`` :param LowLevelILFunction il: The function the current instruction belongs to -- cgit v1.3.1 From ddaf7506e1802cfd4f9c78bcfb14deb0180b04d8 Mon Sep 17 00:00:00 2001 From: Jordan Wiens Date: Wed, 22 Mar 2017 19:28:43 -0400 Subject: update basicblock.annotations to new argument order for function.get_block_annotations --- python/basicblock.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'python') diff --git a/python/basicblock.py b/python/basicblock.py index 9f256aa7..5bec391b 100644 --- a/python/basicblock.py +++ b/python/basicblock.py @@ -194,7 +194,7 @@ class BasicBlock(object): @property def annotations(self): """List of automatic annotations for the start of this block (read-only)""" - return self.function.get_block_annotations(self.arch, self.start) + return self.function.get_block_annotations(self.start, self.arch) @property def disassembly_text(self): -- cgit v1.3.1