Crusader_Decomp/resolve_bb4f.py

20 lines
673 B
Python
Raw Normal View History

"""Resolve 0008:bb58 (FUN_0008_bb4f's inner CALLF operand at +1)"""
import json
with open(r'k:\ghidra\Crusader_Decomp\ne_reloc_fixups.json') as f:
fixups = json.load(f)
by_off = {f['source_file_offset']: f for f in fixups}
# 0008:bb58 CALLF, operand at 0008:bb59 = flat 0x8BB59
flat = 0x8BB59
if flat in by_off:
m = by_off[flat]
print(f"0008:bb58 CALLF -> {m.get('target','?')} (ghidra: {m.get('target_ghidra','?')})")
else:
print(f"NOT FOUND at 0x{flat:X}")
# Try nearby
for d in range(-2, 5):
if flat+d in by_off:
m = by_off[flat+d]
print(f" +{d}: {m.get('target','?')} (ghidra: {m.get('target_ghidra','?')})")