mirror of
https://github.com/TheBozos/VP2S_Recomp.git
synced 2026-12-01 07:38:48 -10:00
- tools/extract.py: pure-Python extractor for SLES-54645 (ISO9660, SLZ chains, SLE decryption, module/overlay export with ELF segment validation, IRX, index) - tools/slz.py: tri-Ace SLZ types 0-3 and SLE decryption, reimplemented from the game's own routines - scripts/, ghidra_scripts/: exploration scripts used during the audit - toolchain/Dockerfile: analysis container (binutils MIPS, Python) - docs/AUDIT.md: phase 1 and 2 feasibility audit (GO for static recompilation) Co-Authored-By: Claude Opus 5.5 <[email protected]>
20 lines
795 B
Python
20 lines
795 B
Python
"""Inspect a decrypted module image: header words, then disassemble the start of its payload."""
|
|
import struct
|
|
import subprocess
|
|
import sys
|
|
|
|
path = sys.argv[1]
|
|
data = open(path, "rb").read()
|
|
words = struct.unpack_from("<16I", data)
|
|
print(path, len(data), "bytes")
|
|
print("header words:", " ".join(f"{w:08x}" for w in words))
|
|
load = words[2]
|
|
for hdr in (0x10, 0x20, 0x40, 0x80):
|
|
tmp = "/tmp/m.bin"
|
|
open(tmp, "wb").write(data[hdr:hdr + 0x80])
|
|
out = subprocess.run(["mips-linux-gnu-objdump", "-D", "-b", "binary", "-m", "mips:5900", "-EL",
|
|
f"--adjust-vma=0x{load:x}", tmp], capture_output=True, text=True).stdout
|
|
lines = [l for l in out.splitlines() if "\t" in l][:10]
|
|
print(f"--- payload at +0x{hdr:x} as code @0x{load:x}")
|
|
print("\n".join(lines))
|