socram8888 / tonyhax

PS1 savegame exploit
Do What The F*ck You Want To Public License
437 stars 24 forks source link

Jikkyou Powerful Pro Yakyuu '95 (Japan) (Rev 0) has no 'PS-X EXE' text in header #162

Closed alex-free closed 4 weeks ago

alex-free commented 4 weeks ago

The game Jikkyou Powerful Pro Yakyuu '95 (Japan) (Rev 0) does not have the 'PS-X EXE; text in it's header. This was fixed in Rev 1: Screenshot from 2024-09-07 18-14-57

This causes Japan Rev 0 to not boot with the newest executable header code recently added.

Commenting it out works fine. Not sure if it's worth checking for now since at least one game doesn't have it.

exe_header_t * exe_header = (exe_header_t *) data_buffer;
if (strncmp(exe_header->signature, "PS-X EXE", 8)) {
    debug_write("Info: header has invalid signature");
    //return;
}
socram8888 commented 4 weeks ago

I'd like to still like to check for it, even if we just disable the return and inform the user. FileRead might return complete garbage as we've seen if the laser goes out of bounds, and this information could be pretty useful for debugging such conditions.

Maybe the check could be replaced to checking if the executable code and the initial PC is within the bounds of the console main RAM (or a mirror), and if the stack resides within main RAM or the "fast RAM". Will mean more LOC but should work with every single game out there.

alex-free commented 4 weeks ago

I'd like to still like to check for it, even if we just disable the return and inform the user. FileRead might return complete garbage as we've seen if the laser goes out of bounds, and this information could be pretty useful for debugging such conditions.

Maybe the check could be replaced to checking if the executable code and the initial PC is within the bounds of the console main RAM (or a mirror), and if the stack resides within main RAM or the "fast RAM". Will mean more LOC but should work with every single game out there.

On the over-seek PS2 issue, if that happens it will never get to the code checking for this because it will be unable to open the PSX.EXE file. You can add code to Tonyhax that will guarantee that the over-seek PS2 issue while in the loader never happens and it can open the PSX.EXE.

An alternative would be to check for what Rev 0 has instead of PSX-EXE. Check both signatures.

From my research it looks like a lot of the PS-X EXE format isn't required, just from what we know 1) Certain SP values (kings field issue) 2) Size (kileak the blood issue) 3) Signature (this)

So I like your idea as well because it's actually 100% mandatory. Let me know your thoughts.

socram8888 commented 4 weeks ago

Patched in https://github.com/socram8888/tonyhax/commit/c897f18dd5bc8430343686ff4f979678933fd279.

I've simplified the FileRead checks, since the functions will always either fill the entire buffer or return -1.

socram8888 commented 4 weeks ago

FYI @alex-free you might want to cherry pick https://github.com/socram8888/tonyhax/commit/ace42f56d5094782fc69e2cc7a56d12d59a75189 since I did an oopsie while rewriting the debug_write calls.

alex-free commented 3 weeks ago

FYI @alex-free you might want to cherry pick https://github.com/socram8888/tonyhax/commit/ace42f56d5094782fc69e2cc7a56d12d59a75189 since I did an oopsie while rewriting the debug_write calls.

Thanks for the heads up, went ahead and fixed it with your current commit.