
Unscrambling the flash id from the header is simply the opposite of what happens when the card is formatted (since that's when the header is written), you just need to subtract the "random" value instead of adding it. This is the code that Devolution uses to find the flash id of emulated cards (which it then puts in the sram):That's depressing to read, I tested with an unoficial card. Well, at least we can copy the savegame to any unoficial card.
Then changing the hader of an official card will only break the card and there's no software solution for that? If that's so, we are again at the point of needing to change the ID in the savegame itself...
Do you know how to get the real flash ID from the header scrambled one?
int i;
volatile int read_done = 0;
union
{
struct
{
uint32_t serial[3];
uint64_t time;
} __attribute__((packed));
uint8_t data[MCARD_READ_SIZE]; // size of one memory card sector
} header __attribute__((aligned(32)));
uint64_t rand;
// read sector 0
read_memcard_sector(0, header.data, (ipccallback)sync_read, (void*)&read_done);
// wait for the read to finish
while (!read_done)
msleep(1);
// rand() taken from K&R, lol
rand = header.time; // seed
for (i=0; i < 12; i++)
{
rand = (rand * 1103515245 + 12345) >> 16;
header.data[i] -= rand;
rand = ((uint32_t)rand * 1103515245 + 12345) >> 16;
rand &= 0x7FFF;
}
// 12 bytes of Flash ID
memcard_serial[0] = header.serial[0];
memcard_serial[1] = header.serial[1];
memcard_serial[2] = header.serial[2];
That's exactly what I said would happen, you can't copy modified headers from/to official cards. You can only copy them between unofficial cards or from/to the same official card without modifying it.That sounds interesting, however...
I tried to follow this tutorial in order to copy my F-Zero GX from an unofficial memory card (1019 blocks) to an official one (251 blocks).
Thanks to suloku tools I managed to create a raw image with all my savegames from the 251 official, I changed its ID and then added my F-Zero GX savegame. Dolphin reads it correctly, but it's impossible to restore it to my 251 official using ctr-gcs (no matter what version I use, tueidj's or suloku's). It's always corrupted after restoring it.
At first I thought it was related to tueidj's post here, but then I tried to restore my ORIGINAL (not modified) RAW to the 251 official and it gives me the same problem: the memory card is corrupted after restoring the RAW.
I don't care about the savegames lost there because I have a copy of all of them.
Because the program is looking at the wrong bytes in the sram for the flash id checksum...Maybe it is related to tueidj's modifications, I'm trying to use dacotaco's 0.2b but I still haven't been able to mount the official card (even using the system menu trick :S)

And, sorry to sound noob, but fixing sramex struct is just a matter of changing u16 to u8? (This is interpreted from a previous post of yours)
sum = (sum^-1)&0xff;
sramex->flashID_chksum[chn] = (sum


Actually now that I think about it, this won't work if official memory cards are used. The reason is the flash id in the header is a scrambled version of the real flash id (the one that gets written to nand). The real flash id is obtained during the unlock function and there's no way to copy that from one card to another. If the real flash id doesn't match the descrambled flash id from the card header, the card will be rejected by games as needing formatting. Unofficial cards all use zeroes for their flash id so there's no problem copying headers between them.
Restoring Fzero protected save didn't work (the transfer didn't even start). I used the same, non formated memory card of course.
I remember that restoring a Fzero save worked fine with MCbackup (but it works in Gamecube mode)
ctr-gcs 0.3a
_________________________________________
suloku 21 august 2012
_________________________________________
-Added gamecube mode with SD gecko support (also with pso/sdload reloading support)
note: there's no SD gecko support in wii mode
-Added usb (fat32) support. Please plug only one device at a time.
-Added checks for internal SD, USB, SD gecko and memory card being inserted.
-Official memory cards are fully working in both wii and gamecube mode (previous version corrupted official memory cards when writing raw images.
-Included source of GCHeader.exe
About inseting headers and raw images:
First of all, official memory cards only accept its own header, any raw written to the official memory card wich doesn't have that card's header will render the memory card to be reported as corrupted.
So, you can change headers from official cards to unofficial cards and between unofficial cards.
Note that if an official card is formated, the header will change, but previous raw images of that card should still work.
You can still insert f-zero/Phantasy star online savegame and header to a official memory card image and it will work perfectly with dolphin.
Check out dolphin's memory card manager! It supports raw image files and gci/sav/gcs savegames!
http://code.google.c...emcard-manager/

What you guys are doing is fantastic. Transferring F-Zero GX savegame files is one of those lose ends in Wii hacking.
I don't know if this helps you in any way but this fellow found a way to transfer F-Zero GX saves using Action Replay and a Gamecube.
I'm just posting this in the hope that it may be somehow useful.

It does work, I tested it on a real gamecube with a friends almost 100% savegame of F-zero.Ultimately, if official cards are the problem, that is not a big deal, compared to the ability to transfer F-Zero saves. You can buy a 128MB Gamecube card from dealextreme for ~$7 shipped (to the US).
If you can now successfully transfer the saves to an unofficial card, which apparently you can, I think that is the bulk of the effort.
I can't wait to test this at home tonight.
If it works for me I"ll buy that big card and put all my saves there.

What you guys are doing is fantastic. Transferring F-Zero GX savegame files is one of those lose ends in Wii hacking.
I don't know if this helps you in any way but this fellow found a way to transfer F-Zero GX saves using Action Replay and a Gamecube.
I'm just posting this in the hope that it may be somehow useful.

This gets better by the hour Thanks for testing that out.This solution works with AR for Wii too! I managed to transfer my game save from an unofficial mc to an official mc and its working perfect!
Thanks for pointing out the link with instructions. If someone wants to try just download the AR GC Package for Wii, The AR code isn't big at all so in minutes it's easy to transfer and use in any card that problematic gamesave.




