mirror of
https://github.com/isledecomp/isle-portable.git
synced 2025-04-29 15:53:35 -04:00
reccmp: further improve accuracy
This commit is contained in:
parent
598ca01df5
commit
12395ac41a
1 changed files with 8 additions and 1 deletions
|
@ -198,7 +198,14 @@ md = Cs(CS_ARCH_X86, CS_MODE_32)
|
||||||
def sanitize(file, mnemonic, op_str):
|
def sanitize(file, mnemonic, op_str):
|
||||||
offsetplaceholder = '<OFFSET>'
|
offsetplaceholder = '<OFFSET>'
|
||||||
|
|
||||||
if mnemonic == 'call' or mnemonic == 'jmp':
|
op_str_is_number = False
|
||||||
|
try:
|
||||||
|
int(op_str, 16)
|
||||||
|
op_str_is_number = True
|
||||||
|
except ValueError:
|
||||||
|
pass
|
||||||
|
|
||||||
|
if (mnemonic == 'call' or mnemonic == 'jmp') and op_str_is_number:
|
||||||
# Filter out "calls" because the offsets we're not currently trying to
|
# Filter out "calls" because the offsets we're not currently trying to
|
||||||
# match offsets. As long as there's a call in the right place, it's
|
# match offsets. As long as there's a call in the right place, it's
|
||||||
# probably accurate.
|
# probably accurate.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue