mirror of
https://github.com/sp00nznet/xboxrecomp.git
synced 2026-12-04 09:38:16 +00:00
57cbb776da
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
22 lines
769 B
Python
22 lines
769 B
Python
import argparse
|
|
import struct
|
|
|
|
RECORD = struct.Struct("<7I")
|
|
|
|
def decode(path):
|
|
with open(path, "rb") as stream:
|
|
while blob := stream.read(RECORD.size):
|
|
if len(blob) != RECORD.size:
|
|
raise ValueError("truncated trace record")
|
|
yield dict(zip(("sequence", "thread", "eip", "type", "arg0", "arg1", "arg2"), RECORD.unpack(blob)))
|
|
|
|
def main():
|
|
parser = argparse.ArgumentParser(description="Decode XboxRecomp binary trace records")
|
|
parser.add_argument("trace")
|
|
args = parser.parse_args()
|
|
for record in decode(args.trace):
|
|
print("{sequence:08d} thread={thread} eip=0x{eip:08X} type={type} arg0=0x{arg0:08X} arg1=0x{arg1:08X} arg2=0x{arg2:08X}".format(**record))
|
|
|
|
if __name__ == "__main__":
|
|
main()
|