Hardware GCN MemCard Recover

GerbilSoft

Well-Known Member
OP
Member
Joined
Mar 8, 2012
Messages
2,379
Trophies
1
Age
33
XP
3,974
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:

GMPE01.format-memory-card.png


"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.

wii-system-menu.format-memory-card.png


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.

okteta.gcn.card_dump.2012-01-13.png


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!

mcrecover.mcrecover-v0.1.png


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.
 

_acid_

Well-Known Member
Member
Joined
Jul 18, 2010
Messages
197
Trophies
0
XP
258
Country
United States
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
 

GerbilSoft

Well-Known Member
OP
Member
Joined
Mar 8, 2012
Messages
2,379
Trophies
1
Age
33
XP
3,974
Country
United States
so i can restore save files i lost due to formating? if so can you make a toturial?
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.
 
  • Like
Reactions: jonthedit

Cyan

GBATemp's lurking knight
Former Staff
Joined
Oct 27, 2002
Messages
23,657
Trophies
2
Age
44
Location
Engine room, learning
XP
15,217
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)
 

GerbilSoft

Well-Known Member
OP
Member
Joined
Mar 8, 2012
Messages
2,379
Trophies
1
Age
33
XP
3,974
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.
 

Cyan

GBATemp's lurking knight
Former Staff
Joined
Oct 27, 2002
Messages
23,657
Trophies
2
Age
44
Location
Engine room, learning
XP
15,217
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.
 

GerbilSoft

Well-Known Member
OP
Member
Joined
Mar 8, 2012
Messages
2,379
Trophies
1
Age
33
XP
3,974
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).
 

Cyan

GBATemp's lurking knight
Former Staff
Joined
Oct 27, 2002
Messages
23,657
Trophies
2
Age
44
Location
Engine room, learning
XP
15,217
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.
 

GerbilSoft

Well-Known Member
OP
Member
Joined
Mar 8, 2012
Messages
2,379
Trophies
1
Age
33
XP
3,974
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.
 

kavid

Well-Known Member
Member
Joined
Sep 28, 2008
Messages
564
Trophies
0
XP
441
Country
Switzerland
i use Qt Linguist to translate .qm file to chinese。

1402111711f9b1b288810c5e6e.jpg
 

Attachments

  • mcrecover_cn.rar
    4.9 KB · Views: 422

GerbilSoft

Well-Known Member
OP
Member
Joined
Mar 8, 2012
Messages
2,379
Trophies
1
Age
33
XP
3,974
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.)
 

jonthedit

Well-Known Member
Member
Joined
May 30, 2011
Messages
1,682
Trophies
0
XP
979
Country
Bangladesh
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.)

Can't wait!
Let us know if it works out; I'll add that is a better alternative in my ARGC guide! :yaywii:
 

Leo Alves

Well-Known Member
Member
Joined
Dec 16, 2012
Messages
133
Trophies
0
Age
28
XP
295
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?
 
General chit-chat
Help Users
  • Dark_Phoras @ Dark_Phoras:
    And I'm still on Batman: Arkham City. Such a good game. Mr Freeze's boss fight is hard and extensive, we're currently at a point where whoever gets the next strike wins. If I miss I'll lose another 30 mins at least.
    Gift
  • Psionic Roshambo @ Psionic Roshambo:
    Lol Mr Freeze "Remember kids it's not the size of your gun, it's how you use it"
    +1
    Gift
  • AncientBoi @ AncientBoi:
    And to shoot it well. :)
    Gift
  • Psionic Roshambo @ Psionic Roshambo:
    Indeed! Lol
    +1
    Gift
  • Dark_Phoras @ Dark_Phoras:
    Do you guys know what's Mr. Freeze's favorite date program? Netflix and chill
    Gift
  • Gift
  • Gift
  • FAST6191 @ FAST6191:
    Isn't Mr Freeze's backstory about him losing his wife?
    Gift
  • Flame @ Flame:
    @FAST6191 his called @Dark_Phoras for a reason
    Gift
  • Dark_Phoras @ Dark_Phoras:
    Mr. Freeze's wife is frozen while he looks for a cure to her illness
    Gift
  • Dark_Phoras @ Dark_Phoras:
    But, in the meantime, he knows how to throw a cool party
    Gift
  • Psionic Roshambo @ Psionic Roshambo:
    He's a chill dude lol
    Gift
  • Flame @ Flame:
    is that true @Dark_Phoras ? thats so cool
    Gift
  • Flame @ Flame:
    a little ice cold too at the same time
    Gift
  • Psionic Roshambo @ Psionic Roshambo:
    Dude is frosty
    Gift
  • gudenau @ gudenau:
    Does anyone happen to know if the gecko code handler will always be in the same location? It would be useful if you could call into it's own subroutines in ASM codes.
    Gift
  • FAST6191 @ FAST6191:
    Are there any codes that modify the handler to do fun extras like there are for DS codes?
    Gift
  • gudenau @ gudenau:
    I don't see why you would need that, Gecko just allows you to do ASM directly instead of needing to make codes to add new code types.
    Gift
  • gudenau @ gudenau:
    There is nothing stopping you from doing that though.
    Gift
  • FAST6191 @ FAST6191:
    I was thinking more if there were (some of the DS stuff allowing I think it was different boolean masks than stock) then it would confirm that.
    Gift
  • gudenau @ gudenau:
    Some of the later DS stuff was pretty impressive. I do want to figure out how some of the lower level stuff worked one of these days.
    Gift
  • gudenau @ gudenau:
    Is this chat still on IRC?
    Gift
  • FAST6191 @ FAST6191:
    I don't know if there is a second room connected to it
    but I doubt it
    Gift
  • FAST6191 @ FAST6191:
    There is still an IRC server/channel though
    Gift
  • KenniesNewName @ KenniesNewName:
    Neat steam deck dock shipped finally
    Gift
    KenniesNewName @ KenniesNewName: Neat steam deck dock shipped finally