reccmp: support inlined functions that may have been compiled into both files

This commit is contained in:
itsmattkc 2023-06-22 01:05:00 -07:00
parent 66a010a19f
commit 749a1f419b
2 changed files with 13 additions and 4 deletions

View file

@ -60,8 +60,8 @@ jobs:
C:\msys64\usr\bin\wget.exe https://legoisland.org/download/ISLE.EXE
C:\msys64\usr\bin\wget.exe https://legoisland.org/download/LEGO1.DLL
pip install capstone
python3 tools/reccmp/reccmp.py -H ISLEPROGRESS.HTML ISLE.EXE Release/ISLE.EXE Release/ISLE.PDB ISLE
python3 tools/reccmp/reccmp.py -H LEGO1PROGRESS.HTML LEGO1.DLL Release/LEGO1.DLL Release/LEGO1.PDB LEGO1
python3 tools/reccmp/reccmp.py -H ISLEPROGRESS.HTML ISLE.EXE Release/ISLE.EXE Release/ISLE.PDB .
python3 tools/reccmp/reccmp.py -H LEGO1PROGRESS.HTML LEGO1.DLL Release/LEGO1.DLL Release/LEGO1.PDB .
- name: Upload Artifact
uses: actions/upload-artifact@master

View file

@ -259,6 +259,10 @@ def parse_asm(file, addr, size):
total_accuracy = 0
htmlinsert = []
# Generate basename of original file, used in locating OFFSET lines
basename = os.path.basename(os.path.splitext(original)[0])
pattern = '// OFFSET:'
for subdir, dirs, files in os.walk(source):
for file in files:
srcfilename = os.path.join(os.path.abspath(subdir), file)
@ -273,9 +277,14 @@ def parse_asm(file, addr, size):
if not line:
break
if line.startswith('// OFFSET:'):
par = line[10:].strip().split()
line = line.strip()
if line.startswith(pattern):
par = line[len(pattern):].strip().split()
module = par[0]
if module != basename:
continue
addr = int(par[1], 16)
find_open_bracket = line