Skip to content

Commit

Permalink
Fix test suite against recent capstone releases (#192)
Browse files Browse the repository at this point in the history
* Recognize `ret` and `jmp` with `repz` and `notrack` prefix as valid branching instructions

* Fix test cases against recent capstone release

closes #190
  • Loading branch information
hamarituc committed Sep 1, 2023
1 parent beb4f8d commit 4d58136
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion ropgadget/gadgets.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ def __init__(self, binary, options, offset):
self.__filterRE = re.compile("({})$".format(re_str)) if re_str else None

def __passCleanX86(self, decodes):
br = ["ret", "retf", "int", "sysenter", "jmp", "call", "syscall"]
br = ["ret", "repz ret", "retf", "int", "sysenter", "jmp", "notrack jmp", "call", "notrack call", "syscall"]

if decodes[-1][2] not in br:
return True
Expand Down
Binary file modified test-suite-binaries/ref_output.bz2
Binary file not shown.

0 comments on commit 4d58136

Please sign in to comment.