Skip to content

Commit 5635af7

Browse files
authored
Merge pull request #6 from L4ys/master
Minor fix
2 parents 74c5f97 + c82829d commit 5635af7

File tree

2 files changed

+9
-7
lines changed

2 files changed

+9
-7
lines changed

lib/utils.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,7 @@ def pager(text, pagesize=None):
269269
pagesize = config.Option.get("pagesize")
270270

271271
if pagesize <= 0:
272-
msg(text)
272+
msg(text.strip())
273273
return
274274

275275
i = 1

peda.py

+8-6
Original file line numberDiff line numberDiff line change
@@ -4991,9 +4991,9 @@ def recover_plt(text,arch):
49914991
if idx <= pc_idx:
49924992
text += line + "\n"
49934993
else:
4994-
text += " | %s\n" % line.strip()
4994+
text += " %s\n" % line.strip()
49954995
text = format_disasm_code(text, pc) + "\n"
4996-
text += " |->"
4996+
text += " └─>"
49974997
code = peda.get_disasm(jumpto, count//2)
49984998
if not code:
49994999
code = " Cannot evaluate jump destination\n"
@@ -5002,7 +5002,8 @@ def recover_plt(text,arch):
50025002
text += red(code[0]) + "\n"
50035003
for line in code[1:]:
50045004
text += " %s\n" % line.strip()
5005-
text += red("JUMP is taken".rjust(79))
5005+
if "ret" not in opcode:
5006+
text += red("JUMP is taken".rjust(79))
50065007
else :
50075008
text += format_disasm_code(peda.disassemble_around(pc, count), pc)
50085009
text += "\n" + green("jump is not taken".rjust(79))
@@ -5028,9 +5029,9 @@ def recover_plt(text,arch):
50285029
if idx <= pc_idx:
50295030
text += line + "\n"
50305031
else:
5031-
text += " | %s\n" % line.strip()
5032+
text += " %s\n" % line.strip()
50325033
text = format_disasm_code(text, pc) + "\n"
5033-
text += " |->"
5034+
text += " └─>"
50345035
code = peda.get_disasm(jumpto, count//2)
50355036
if not code:
50365037
code = " Cannot evaluate jump destination\n"
@@ -5039,7 +5040,8 @@ def recover_plt(text,arch):
50395040
text += red(code[0]) + "\n"
50405041
for line in code[1:]:
50415042
text += " %s\n" % line.strip()
5042-
text += red("JUMP is taken".rjust(79))
5043+
if "ret" not in opcode:
5044+
text += red("JUMP is taken".rjust(79))
50435045
else: # JUMP is NOT taken
50445046
text += format_disasm_code(peda.disassemble_around(pc, count), pc)
50455047
text += "\n" + green("JUMP is NOT taken".rjust(79))

0 commit comments

Comments
 (0)