summaryrefslogtreecommitdiff
path: root/python/binaryview.py
diff options
context:
space:
mode:
authorJosh Ferrell <josh@vector35.com>2020-04-17 01:30:10 -0400
committerRusty Wagner <rusty@vector35.com>2020-04-17 14:20:43 -0400
commit6070bce9061fcfa21292ee30f56f10f05643bf30 (patch)
tree85e1363a110a107dd694ec8b01042d7807ed7eff /python/binaryview.py
parent41fbac37456f91b8085ceb0726ab7f9799a55b17 (diff)
Fix python API for new linear disassembly structure
Diffstat (limited to 'python/binaryview.py')
-rw-r--r--python/binaryview.py20
1 files changed, 8 insertions, 12 deletions
diff --git a/python/binaryview.py b/python/binaryview.py
index 6c13f7a9..c110dc7d 100644
--- a/python/binaryview.py
+++ b/python/binaryview.py
@@ -4425,33 +4425,30 @@ class BinaryView(object):
>>> settings = DisassemblySettings()
>>> pos = bv.get_linear_disassembly_position_at(0x1000149f, settings)
- >>> lines = bv.get_previous_linear_disassembly_lines(pos, settings)
+ >>> lines = bv.get_previous_linear_disassembly_lines(pos)
>>> lines
[<0x1000149a: pop esi>, <0x1000149b: pop ebp>,
<0x1000149c: retn 0xc>, <0x1000149f: >]
"""
- if settings is not None:
- settings = settings.handle
pos = lineardisassembly.LinearViewCursor(lineardisassembly.LinearViewObject.disassembly(self, settings))
pos.seek_to_address(addr)
return pos
- def get_previous_linear_disassembly_lines(self, pos, settings=None):
+ def get_previous_linear_disassembly_lines(self, pos):
"""
``get_previous_linear_disassembly_lines`` retrieves a list of :py:class:`LinearDisassemblyLine` objects for the
previous disassembly lines, and updates the LinearViewCursor passed in. This function can be called
repeatedly to get more lines of linear disassembly.
:param LinearViewCursor pos: Position to start retrieving linear disassembly lines from
- :param DisassemblySettings settings: DisassemblySettings display settings for the linear disassembly, defaults to None which will use default settings
:return: a list of :py:class:`LinearDisassemblyLine` objects for the previous lines.
:Example:
>>> settings = DisassemblySettings()
>>> pos = bv.get_linear_disassembly_position_at(0x1000149a, settings)
- >>> bv.get_previous_linear_disassembly_lines(pos, settings)
+ >>> bv.get_previous_linear_disassembly_lines(pos)
[<0x10001488: push dword [ebp+0x10 {arg_c}]>, ... , <0x1000149a: >]
- >>> bv.get_previous_linear_disassembly_lines(pos, settings)
+ >>> bv.get_previous_linear_disassembly_lines(pos)
[<0x10001483: xor eax, eax {0x0}>, ... , <0x10001488: >]
"""
result = []
@@ -4461,22 +4458,21 @@ class BinaryView(object):
result = pos.lines
return result
- def get_next_linear_disassembly_lines(self, pos, settings=None):
+ def get_next_linear_disassembly_lines(self, pos):
"""
``get_next_linear_disassembly_lines`` retrieves a list of :py:class:`LinearDisassemblyLine` objects for the
next disassembly lines, and updates the LinearViewCursor passed in. This function can be called
repeatedly to get more lines of linear disassembly.
:param LinearViewCursor pos: Position to start retrieving linear disassembly lines from
- :param DisassemblySettings settings: DisassemblySettings display settings for the linear disassembly, defaults to None which will use default settings
:return: a list of :py:class:`LinearDisassemblyLine` objects for the next lines.
:Example:
>>> settings = DisassemblySettings()
>>> pos = bv.get_linear_disassembly_position_at(0x10001483, settings)
- >>> bv.get_next_linear_disassembly_lines(pos, settings)
+ >>> bv.get_next_linear_disassembly_lines(pos)
[<0x10001483: xor eax, eax {0x0}>, <0x10001485: inc eax {0x1}>, ... , <0x10001488: >]
- >>> bv.get_next_linear_disassembly_lines(pos, settings)
+ >>> bv.get_next_linear_disassembly_lines(pos)
[<0x10001488: push dword [ebp+0x10 {arg_c}]>, ... , <0x1000149a: >]
>>>
"""
@@ -4517,7 +4513,7 @@ class BinaryView(object):
pos = lineardisassembly.LinearViewCursor(lineardisassembly.LinearViewObject.disassembly(
self.view, self.settings))
while True:
- lines = self._view.get_next_linear_disassembly_lines(pos, self.settings)
+ lines = self._view.get_next_linear_disassembly_lines(pos)
if len(lines) == 0:
break
for line in lines: