Add various scripts and JSON plans for Ghidra project
- Introduced `seg043_boundary_repair.json` to manage function boundaries in segment 043. - Created `read_file.py` for reading and printing file content size. - Added `resolve_bb4f.py` to resolve specific function call targets. - Implemented `resolve_top_targets.py` to find resolved NE targets for top-called wrapper functions. - Added `script_contents.txt` to summarize NE relocation far calls. - Updated `tier4_ghidra.txt`, `tier4_ghidra_check.txt`, `tier4_output.txt`, and `tier4_result.txt` with function call statistics. - Created `tier5_errors.txt` for error logging and `tier5_output.txt` for additional function call statistics. - Established `tools` directory with helper scripts for the Ghidra project, including CLI and common functionalities. - Implemented command-line interface in `cli.py` for various project operations. - Added `common.py` for shared functions and configurations across tools. - Introduced `validate_fixups.py` to validate NE relocation fixups against known addresses.
This commit is contained in:
parent
6b9eb205d4
commit
24d4416003
36 changed files with 145712 additions and 14 deletions
20
resolve_bb4f.py
Normal file
20
resolve_bb4f.py
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
"""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','?')})")
|
||||
Loading…
Add table
Add a link
Reference in a new issue