ShendoXT/memcardrex

Improve support for non-standard DexDrive formats

Closed this issue · 2 comments

A significant number of DexDrive formatted memory card images (.GME) hosted on GameFaqs seem to have a completely zeroed header, this makes them fail to load, since openMemoryCard function assumes the header to start with "123-456-STD".

I don't know how these files come to be, but considering these seem to be uploaded by many different users, it's probably an emulator or clone dumping device not adhering completely to the DexDrive format.

A secondary fallback logic to handle such files could be to check if the file extension is GME and the card size is exactly 134976 bytes, then just start from the typical 3904 offset like the regular logic used now.

Shouldn't affect the other formats, since there's none of them with non-standard headers of this size.

Example files:
https://gamefaqs.gamespot.com/ps/582940-pro-evolution-soccer-2/saves/22507
https://gamefaqs.gamespot.com/ps/197765-the-legend-of-dragoon/saves/19636
https://gamefaqs.gamespot.com/ps/197765-the-legend-of-dragoon/saves/15054
https://gamefaqs.gamespot.com/ps/913684-digimon-world/saves/21133
https://gamefaqs.gamespot.com/ps/196885-castlevania-symphony-of-the-night/saves/26785
https://gamefaqs.gamespot.com/ps/258931-mega-man-x5/saves/26811
https://gamefaqs.gamespot.com/ps/198763-star-ocean-the-second-story/saves/8738
https://gamefaqs.gamespot.com/ps/480705-saiyuki-journey-west/saves/21061
https://gamefaqs.gamespot.com/ps/480705-saiyuki-journey-west/saves/19395

This last one seems to be a little different, the header has been filled with strange data from the user system, however, if skipping the DexDrive header like the rest, the save data seems to be fine and load:
https://gamefaqs.gamespot.com/ps/198266-parasite-eve-ii/saves/7743

Thanks for the info. I think ePSXe (or maybe even other emulators) are to be blamed for the issue.
I remember back in the day someone on ngemu said that ePSXe supports .gme when someone asked how to import
saves from GameFAQs. I checked it out and ePSXe just offsets the raw mc data and wipes out the .gme header.

I don't think it supports .gme per se. I believe it just scans if the raw mc data is at some offset in the file.

As for garbled header I would blame DexPlorer. Often if you look at the files created with it you would see
host user data (like file paths) which have no business being there among the saves.
I believe it's some kind of stray pointer shenanigans.

It should not be that difficult to detect those kind of files. As you said file size should be 134976 and I could check if
offset 3904 contains MC magic.

I'll see what I can do.

Yup, this did the trick.

mcrex lod

I'm currently working on 2.0 release and this fix is now implemented.
I need to port some changes over from mac version back to windows and this 2.0 will be ready.