Skip to content

Commit 2a79f99

Browse files
XploitBengineerBen R
andauthored
Fixed issue with code view when running context command. (#27)
Previously, using the context command would cause llef to render the disassembly without the correct current instruction. This is because the code looked for the presense of an arrow marker to indicate the current instruction, which is not outputted by LLDB when refreshing the context. To fix this, this patch pulls the value of the pc and compares this instead Co-authored-by: Ben R <[email protected]>
1 parent cf1f961 commit 2a79f99

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

common/context_handler.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -223,8 +223,9 @@ def display_code(self) -> None:
223223
if self.frame.disassembly:
224224
instructions = self.frame.disassembly.split("\n")
225225

226+
current_pc = hex(self.frame.GetPC())
226227
for i, item in enumerate(instructions):
227-
if "\x1b[33m-> \x1b[0m" in item:
228+
if current_pc in item:
228229
print(instructions[0])
229230
if i > 3:
230231
print_instruction(instructions[i - 3], TERM_COLOURS.GREY)

0 commit comments

Comments
 (0)