From 3460886356e8b666dd86f98a9cb2f228b5ad6a0c Mon Sep 17 00:00:00 2001 From: jonschz Date: Mon, 26 Aug 2024 22:21:41 +0200 Subject: [PATCH] Review: remove redundant code --- tools/isledecomp/isledecomp/compare/core.py | 48 --------------------- tools/isledecomp/isledecomp/compare/db.py | 12 ------ 2 files changed, 60 deletions(-) diff --git a/tools/isledecomp/isledecomp/compare/core.py b/tools/isledecomp/isledecomp/compare/core.py index 6484744b..7de58716 100644 --- a/tools/isledecomp/isledecomp/compare/core.py +++ b/tools/isledecomp/isledecomp/compare/core.py @@ -508,8 +508,6 @@ def _find_vtordisp(self): if self._db.is_vtordisp(recomp_addr): self._match_vtordisp_in_vtable(orig_addr, recomp_addr) - elif self._db.is_thunk_of(recomp_addr): - self._match_thunk_in_vtable(orig_addr, recomp_addr) def _match_vtordisp_in_vtable(self, orig_addr, recomp_addr): thunk_fn = self.get_by_recomp(recomp_addr) @@ -559,52 +557,6 @@ def _match_vtordisp_in_vtable(self, orig_addr, recomp_addr): ) self._db.set_function_pair(orig_addr, recomp_addr) - def _match_thunk_in_vtable(self, orig_addr, recomp_addr): - thunk_fn = self.get_by_recomp(recomp_addr) - assert thunk_fn is not None - - # These thunks always consist of one jump instruction, which is 5 bytes long. - thunk_size = 5 - assert thunk_fn.size == thunk_size - - orig_thunk_bin = self.orig_bin.read(orig_addr, thunk_size) - recomp_thunk_bin = self.recomp_bin.read(recomp_addr, thunk_size) - assert orig_thunk_bin is not None and recomp_thunk_bin is not None - - # Read jump opcode and displacement (1+4 bytes) - (orig_jmp, orig_disp) = struct.unpack(" bool: return True - def is_thunk_of(self, recomp_addr: int) -> bool: - """Check whether this function is a thunk of a debug build based on its name.""" - - name = self._db.execute( - """SELECT name - FROM `symbols` - WHERE recomp_addr = ?""", - (recomp_addr,), - ).fetchone()[0] - - return name.startswith("Thunk of") - def _find_potential_match( self, name: str, compare_type: SymbolType ) -> Optional[int]: