-
Notifications
You must be signed in to change notification settings - Fork 0
Home
Mark Street edited this page Sep 23, 2021
·
4 revisions
This is a very rudimentary proof-of-concept. Many things are missing or broken.
Missing Instructions:
Firstly, there are a number of instructions that aren't correctly disassembled by capstone, e.g. lines like:
/* 22D88 80032788 00E8C848 */ .byte 0x00, 0xe8, 0xc8, 0x48
/* 22D94 80032794 00F0C848 */ .byte 0x00, 0xf0, 0xc8, 0x48
/* 22DA0 800327A0 00D0C848 */ .byte 0x00, 0xd0, 0xc8, 0x48
/* 22DAC 800327AC 00D8C848 */ .byte 0x00, 0xd8, 0xc8, 0x48
/* 22DB8 800327B8 00E0C848 */ .byte 0x00, 0xe0, 0xc8, 0x48
/* 22DC0 800327C0 00C0C048 */ .byte 0x00, 0xc0, 0xc0, 0x48
/* 22DC4 800327C4 00C8C048 */ .byte 0x00, 0xc8, 0xc0, 0x48
These should be translated to the GTE macros and/or assembled via ASPSX.EXE rather than the MIPS as binary.
Naive disassembly on mkst/psx branch.
Data/Rodata disassembly is missing (needs little-endian as a minimum)
asm-differ can be used to diff the asm in realtime
python3 tools/asm-differ/diff.py -mwo3 func_DEADBEEFPermuter works out of the box.
Import:
root@0866e9158e8e:/esa# python3 tools/decomp-permuter/import.py esa/src/51374.c esa/asm/nonmatchings/51374/func_80061688.s
Function name: func_80061688
Compiler: cpp -P -undef -Wall -lang-c -Dmips -D__GNUC__=2 -D__OPTIMIZE__ -D__mips__ -D__mips -Dpsx -D__psx__ -D__psx -D_PSYQ -D__EXTENSIONS__ -D_MIPSEL -D__CHAR_UNSIGNED__ -D_LANGUAGE_C -DLANGUAGE_C -Iinclude -DPERMUTER '|' unix2dos '|' wine tools/psyq/4.6/CC1PSX.EXE -quiet -G0 -Wall -O2 '|' mips-elf-as -EL -march=r3000 -mtune=r3000 -Iinclude {input} -o {output}
Assembler: mips-linux-gnu-as -march=vr4300 -mabi=32 {input} -o {output}
Preserving no macros. Use --preserve-macros='<regex>' to override.
stdin: In function `func_80061688':
stdin:45: warning: implicit declaration of function `func_8007C444'
Done. Imported into nonmatchings/func_80061688Permute:
root@0866e9158e8e:/esa# python3 tools/decomp-permuter/permuter.py nonmatchings/func_80061688/ --best-only -j3
Loading...
nonmatchings/func_80061688/base.c (func_80061688)
No perm macros found. Defaulting to randomization.
Will try 1 different base sources.
stdin: In function `func_80061688':
stdin:44: warning: implicit declaration of function `func_8007C444'
[func_80061688] base score = 80
iteration 153, 0 errors, score = 510
There are a number of files on the CDROM, explanation are work-in-progress:
Executables:
-
esa.dat; main game (& more?) -
pt.dat; main menu (& more?) -
sles_018.71; loader (runspt.dat/esa.dat)
Data:
-
sv.wad; game data, can be extracted withextract_sv_wad.pyinscripts/directory -
esa.txt; (more) strings
FMV:
-
sv.str; images/video? -
stream/*.str;MDEC video streamfiles -
stream/*.xa; XA format files