diff options
| author | Rusty Wagner <rusty@vector35.com> | 2020-04-21 18:05:18 -0400 |
|---|---|---|
| committer | Rusty Wagner <rusty@vector35.com> | 2020-04-21 18:05:18 -0400 |
| commit | ceafa572d0a05cc9afa0f19838f28174aeea5e46 (patch) | |
| tree | 5f22b286ee79c4b3c0b1df8326756379c4342412 /python/function.py | |
| parent | cbeab416149ca94692826497867b7f7150d97be5 (diff) | |
Add indentation option for text renderer
Diffstat (limited to 'python/function.py')
| -rw-r--r-- | python/function.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/python/function.py b/python/function.py index 97f832d1..81cfc6b6 100644 --- a/python/function.py +++ b/python/function.py @@ -3153,7 +3153,7 @@ class DisassemblyTextRenderer(object): core.BNFreeDisassemblyTextLines(lines, count.value) return (result, length.value) - def post_process_lines(self, addr, length, in_lines): + def post_process_lines(self, addr, length, in_lines, indent_spaces=""): if isinstance(in_lines, str): in_lines = in_lines.split('\n') line_buf = (core.BNDisassemblyTextLine * len(in_lines))() @@ -3184,7 +3184,7 @@ class DisassemblyTextRenderer(object): line_buf[i].tokens = InstructionTextToken.get_instruction_lines(line.tokens) count = ctypes.c_ulonglong() lines = ctypes.POINTER(core.BNDisassemblyTextLine)() - lines = core.BNPostProcessDisassemblyTextRendererLines(self.handle, addr, length, line_buf, len(in_lines), count) + lines = core.BNPostProcessDisassemblyTextRendererLines(self.handle, addr, length, line_buf, len(in_lines), count, indent_spaces) il_function = self.il_function result = [] for i in range(0, count.value): @@ -3250,7 +3250,7 @@ class DisassemblyTextRenderer(object): tokens += result core.BNFreeInstructionText(new_tokens, count.value) - def wrap_comment(self, lines, cur_line, comment, has_auto_annotations, leading_spaces = " "): + def wrap_comment(self, lines, cur_line, comment, has_auto_annotations, leading_spaces = " ", indent_spaces = ""): cur_line_obj = core.BNDisassemblyTextLine() cur_line_obj.addr = cur_line.address if cur_line.il_instruction is None: @@ -3262,7 +3262,7 @@ class DisassemblyTextRenderer(object): cur_line_obj.count = len(cur_line.tokens) count = ctypes.c_ulonglong() new_lines = core.BNDisassemblyTextRendererWrapComment(self.handle, cur_line_obj, count, comment, - has_auto_annotations, leading_spaces) + has_auto_annotations, leading_spaces, indent_spaces) il_function = self.il_function for i in range(0, count.value): addr = new_lines[i].addr |
