mirror of
https://github.com/PodeCaradox/GalaxyQuest-SteamFrame.git
synced 2026-10-18 06:01:15 +02:00
A native port built on the Petari decompilation (previous commit): an HLE platform layer (OS, DVD, GX, audio, input, NAND) under the game's own code, an OpenXR presentation (a diorama around the player, a giant screen, the HUD and settings as compositor layers, SpaceWarp, dynamic resolution), Touch Plus controls, the tools that convert your own game files (tools/cook, which also takes the few pieces of data the game's executable holds from your sys/main.dol), and the port's changes to the decompilation (`git diff petari-base -- decomp`). README.md explains installing and building, docs/TECHNICAL.md how it works. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
46 lines
1.1 KiB
Python
46 lines
1.1 KiB
Python
#!/usr/bin/env python3
|
|
"""Replaces libgame.so addresses (0x98000000 + offset) in a log with the
|
|
symbols that contain them (data or code), using llvm-nm output.
|
|
|
|
symbolize_data.py <libgame.so> <nm.exe> < log > log.sym
|
|
"""
|
|
import bisect
|
|
import re
|
|
import subprocess
|
|
import sys
|
|
|
|
BASE = 0x98000000
|
|
|
|
lib, nm = sys.argv[1], sys.argv[2]
|
|
out = subprocess.run([nm, '-C', '-n', '--defined-only', lib], capture_output=True, text=True).stdout
|
|
addrs, names = [], []
|
|
for line in out.splitlines():
|
|
parts = line.split(' ', 2)
|
|
if len(parts) == 3:
|
|
try:
|
|
addrs.append(int(parts[0], 16))
|
|
names.append(parts[2])
|
|
except ValueError:
|
|
pass
|
|
|
|
cache = {}
|
|
|
|
|
|
def sym(m):
|
|
v = int(m.group(0), 16)
|
|
if not (BASE <= v < BASE + 0x08000000):
|
|
return m.group(0)
|
|
if v in cache:
|
|
return cache[v]
|
|
off = v - BASE
|
|
i = bisect.bisect_right(addrs, off) - 1
|
|
s = names[i] if i >= 0 else '?'
|
|
if i >= 0 and off != addrs[i]:
|
|
s += '+%#x' % (off - addrs[i])
|
|
cache[v] = s
|
|
return s
|
|
|
|
|
|
for line in sys.stdin:
|
|
sys.stdout.write(re.sub(r'0x9[89a-f][0-9a-f]{6}', sym, line))
|