From 12395ac41aaf278fb980c0f81c8ba4301de2a00c Mon Sep 17 00:00:00 2001 From: itsmattkc Date: Thu, 22 Jun 2023 00:44:28 -0700 Subject: [PATCH] reccmp: further improve accuracy --- tools/reccmp/reccmp.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/tools/reccmp/reccmp.py b/tools/reccmp/reccmp.py index 36f917fa..993c51f2 100755 --- a/tools/reccmp/reccmp.py +++ b/tools/reccmp/reccmp.py @@ -198,7 +198,14 @@ def get_recompiled_address(self, filename, line): def sanitize(file, mnemonic, op_str): offsetplaceholder = '' - 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 # match offsets. As long as there's a call in the right place, it's # probably accurate.