GCN MemCard Recover

Discussion in 'Wii - Hardware, Devices and Utilities' started by GerbilSoft, Jun 13, 2013.

Jun 13, 2013

GCN MemCard Recover by GerbilSoft at 5:42 AM (10,693 Views / 11 Likes) 35 replies

  1. GerbilSoft
    OP

    Member GerbilSoft GBAtemp Maniac

    Joined:
    Mar 8, 2012
    Messages:
    1,275
    Country:
    United States
    UPDATE: GCN MemCard Recover 0.2.1 is out! (after a 6-month delay... :V)
    Download:

    v0.2.1 is a bugfix release that fixes a few crashes and improves performance. There's also a new Russian translation (contributed by Egor305) and some more file definitions. There's also a fix for the database files being incorrect in the Windows build due to cmake stripping out variable names.

    Save file database entries:
    • USA: 105 files
    • PAL: 59 files
    • JPN: 7 files
    • KOR: 0 files :(
    • Unlicensed: 1 file
    • Homebrew: 1 file

    --- original post follows ---

    In January 2012, I was expanding my GCN collection by getting some games I had on my backlog. One of the games I decided to get was Mario Party 4. So I get Mario Party 4 in the mail, put it in my Wii, and was greeted with the following screen:

    [​IMG]

    "Oh no!," I thought to myself. "All of my save files are gone!"

    I went back to the Wii system menu and checked the Wii save file manager, and got the same error.

    [​IMG]

    I ended up reformatting the card in order to play Mario Party 4. :(

    Now, I've done work with repairing and refurbishing PCs, and one thing that you learn while doing this is formatting a hard drive doesn't actually erase the data. It only erases the filesystem. I spent the next day looking for a utility to dump the raw data from a GCN memory card, and eventually found Ctr-Gcs-DacoTaco-Edition. I did a full raw dump and then opened it in a hex editor. On a hunch, I searched for the string "Sonic", since I had several save files from the various GCN Sonic games on the card.

    [​IMG]

    There it is! The description matches what's displayed on the GCN and Wii memory card manager. It turns out that this description is actually part of the file data, and not the filesystem tables that are erased during formatting. All I had to do was reconstruct the directory entry by copying the 64-byte GCI header from another SADX save file and then copy the GCI file back to the memory card using ctr-gcs. I managed to recover all of my save files by doing this. (The blocks overwritten by the Mario Party 4 save were actually used by a file that was previously deleted, so I didn't lose anything there.)

    While manual file recovery using a hex editor might be relatively easy to do for someone who's technically inclined, it still takes a long time, especially with larger memory cards. I started writing a utility to recover files from GCN memory cards automatically shortly after I recovered my files, but the project was put on hold for a while. I continued working on it around 2 weeks ago, and it mostly works now!

    [​IMG]

    Download links are at the top of the post.

    NOTE: GCN MemCard Recover only supports recovering files from a corrupted filesystem. It is *not* capable of fixing individual save files - that is, if the files on the card are viewable normally but one game complains that its save file is corrupted, GCN MemCard Recover cannot fix it.

    NOTE 2: Only files known to GCN MemCard Recover can be recovered. Currently, the database contains entries for 61 files (all NTSC-U). If you have files that aren't present in the database, I would appreciate it if you sent them to me so I could add them to the database.

    I'd appreciate any comments or suggestions regarding the GCN MemCard Recover program in order to further improve the software.
     
    bm123456, Thomas83Lin, cearp and 8 others like this.


  2. _acid_

    Member _acid_ GBAtemp Regular

    Joined:
    Jul 18, 2010
    Messages:
    197
    Location:
    Canada
    Country:
    Canada
    can i suggest you tell people that it's only for the filesystem and not an individual file?
    since, if u recall i made the mistake of skimming through and assuming it recovers individual saves
     
  3. GerbilSoft
    OP

    Member GerbilSoft GBAtemp Maniac

    Joined:
    Mar 8, 2012
    Messages:
    1,275
    Country:
    United States
    v0.1 is out, finally! Check the top of the original post for download links.
     
  4. jonthedit

    Member jonthedit GBAtemp Advanced Maniac

    Joined:
    May 30, 2011
    Messages:
    1,691
    Country:
    Bermuda
    Sweet. This is what I've been looking for for a LONG TIME.
     
  5. matthi321

    Member matthi321 GBAtemp Regular

    Joined:
    Jan 14, 2013
    Messages:
    154
    Country:
    Denmark
    so i can restore save files i lost due to formating? if so can you make a toturial?
     
  6. jonthedit

    Member jonthedit GBAtemp Advanced Maniac

    Joined:
    May 30, 2011
    Messages:
    1,691
    Country:
    Bermuda
    The OP explains it...
     
  7. GerbilSoft
    OP

    Member GerbilSoft GBAtemp Maniac

    Joined:
    Mar 8, 2012
    Messages:
    1,275
    Country:
    United States
    That's exactly what this program does. (Note that if you've created new save files on the card since the reformat, some files may have been overwritten.) There's a quick tutorial in the included README file.

    Also note that GCN MemCard Recover can only recover files that it knows about in its database (located in data/GcnMcFileDb.xml). If you have save files that aren't detected by GCN MemCard Recover, you can send me a dump of your memory card (or the individual files if the card wasn't reformatted), and I'll take a look at it.
     
    jonthedit likes this.
  8. GerbilSoft
    OP

    Member GerbilSoft GBAtemp Maniac

    Joined:
    Mar 8, 2012
    Messages:
    1,275
    Country:
    United States
    v0.2 is out, now with more file definitions and lots of improvements. Check the top post for more information.
     
    cearp likes this.
  9. jonthedit

    Member jonthedit GBAtemp Advanced Maniac

    Joined:
    May 30, 2011
    Messages:
    1,691
    Country:
    Bermuda
    Sweet! I've been following your work glad to see you didn't leave us :lol:
     
  10. Cyan

    Global Moderator Cyan GBATemp's lurking knight

    Joined:
    Oct 27, 2002
    Messages:
    17,088
    Location:
    Engine room, learning
    Country:
    France
    I see your readme says it should work but might have unexpected result in Windows XP if not using SP3, so I tested it.
    It works fine on XP SP2.

    I don't have a corrupted MC, but I could detect deleted saves on my backup.
    Too bad it can't fix individual game's saves, I have Luigi's mansion saying my save data is corrupted and don't know how to fix it (maybe edit the header? but there's probably a checksum to fix somewhere)
     
  11. GerbilSoft
    OP

    Member GerbilSoft GBAtemp Maniac

    Joined:
    Mar 8, 2012
    Messages:
    1,275
    Country:
    United States
    Thanks for testing it on XP SP2 - I marked SP3 as the minimum because Qt 4.8 doesn't officially support anything earlier. I'll update the README in the next version.

    Regarding Luigi's Mansion - the save file has a checksum using the "AddInvDual16" algorithm at 0x3FFC and 0x5FFC. This is the same checksum used by the memory card headers. If you replace the checksums in the file with the "Expected Checksums" listed in MemCard Recover, the files should be detected properly by the game, but they might do 'weird' things depending on what parts of the file were corrupted.
     
  12. Cyan

    Global Moderator Cyan GBATemp's lurking knight

    Joined:
    Oct 27, 2002
    Messages:
    17,088
    Location:
    Engine room, learning
    Country:
    France
    It didn't detect any checksum for luigi's mansion.
    in fact all my savegames are marked as "unknown checksum algorithm" except for one recovered game.
    Maybe it's because I'm on SP2, or because it's a rebuilt MC importing .gci?

    I already completed the game, so it's not very bad if I can't recover it.
     
  13. GerbilSoft
    OP

    Member GerbilSoft GBAtemp Maniac

    Joined:
    Mar 8, 2012
    Messages:
    1,275
    Country:
    United States
    Oh right, that's a known issue. Checksums are not detected for "regular" files on the memory card (that is, they're visible to the memory card manager normally).

    You can try enabling the "Search Used Blocks" option and then rescan. This should pick up the file as long as it isn't fragmented (and since you just imported it into a new memory card image, it shouldn't be fragmented).
     
  14. Cyan

    Global Moderator Cyan GBATemp's lurking knight

    Joined:
    Oct 27, 2002
    Messages:
    17,088
    Location:
    Engine room, learning
    Country:
    France
    It found the checksum this time. It reports it as good.
    Maybe it's an issue with the memcard ID, but I have only one Real & official card. I've backup'd/restored the save to the same card and the game says it's corrupted. I tried injecting it to a raw empty image and use nintendont but it was the same.

    I was just curious to understand why, but don't worry I already completed the game so it's not a problem if I can't use my save anymore.
    Thanks for your help.
     
  15. kavid

    Member kavid GBAtemp Advanced Fan

    Joined:
    Sep 28, 2008
    Messages:
    521
    Country:
    China
    I want to make chinese translate file . what can i do ?
    Global Moderator
     
  16. GerbilSoft
    OP

    Member GerbilSoft GBAtemp Maniac

    Joined:
    Mar 8, 2012
    Messages:
    1,275
    Country:
    United States
    The easiest way to write a translation is to get a copy of the source code (either the .tar.gz or git: http://www.dusers.drexel.edu/gitweb/gitweb.cgi/~korth/mcrecover.git ), and use Qt Linguist (as part of the Qt 4.8.5 SDK or standalone, http://qt-apps.org/content/show.php/Qt+Linguist+Download?content=89360 ) to create a new TS file.

    I created a blank TS file for zh_CN here: http://gerbilsoft.soniccenter.org/gc-tools/mcrecover/v0.2/ts/mcrecover_zh_CN.ts

    Note that zh_CN is typically used for Simplified Chinese; if you're writing a Traditional Chinese translation, it should be changed to zh_TW.
     
  17. kavid

    Member kavid GBAtemp Advanced Fan

    Joined:
    Sep 28, 2008
    Messages:
    521
    Country:
    China
    i use Qt Linguist to translate .qm file to chinese。

    [​IMG]
     

    Attached Files:

  18. GerbilSoft
    OP

    Member GerbilSoft GBAtemp Maniac

    Joined:
    Mar 8, 2012
    Messages:
    1,275
    Country:
    United States
    v0.2.1 is out (after being delayed for 6 months because of reasons). It's a bugfix release that fixes some crashes and improves performance, and there's a new Russian translation (contributed by Egor305). There's also a fix for the database files being incorrect in the Windows build due to cmake stripping out variable names.

    For v0.3, I'm planning on turning GCN MemCard Recover into a full-fledged card manager. You will be able to format new card images and import GCIs, as well as drag and drop files from one card to another. By default, cards will still be read-only, due to its recovery functionality, but you will be able to change the mode to read/write. (Card images with corrupted headers or tables will not be switchable to read/write; you should extract the GCIs and create a new card image.)
     
    LinkFan16, jonthedit and Cyan like this.
  19. jonthedit

    Member jonthedit GBAtemp Advanced Maniac

    Joined:
    May 30, 2011
    Messages:
    1,691
    Country:
    Bermuda
    Can't wait!
    Let us know if it works out; I'll add that is a better alternative in my ARGC guide! :yaywii:
     
  20. Leo Alves

    Member Leo Alves GBAtemp Regular

    Joined:
    Dec 16, 2012
    Messages:
    117
    Country:
    Brazil
    I Played a japanese GC game and accidentally saved on my real memory card, and the Card was corrupted, i formatted it, lucky, the only save i lost is from Tomb Raider: Legend, others saves i already had a backup, but the program can't find Tomb Raider Legend save when i search for lost files, is this game on database?
     

Share This Page