Problem restoring save file on DS with Hyperkin Game Genie

Discussion in 'Other Flashing Hardware & Software' started by SW4J, Nov 11, 2012.

  1. FAST6191

    FAST6191 Techromancer

    pip Reporter
    Nov 21, 2005
    United Kingdom
    Yeah I did not make that the easiest to grasp if you have not otherwise been playing around with DS flash carts or the GBA before it.

    Saves are various sizes on the DS and they come in two broad flavours (EEPROM and Flash) with a selection of sizes available within that. Unlike the GBA it is very hard to tell what save it is from the ROM image alone so every flash cart out there with a handful of exceptions just made saves the largest size available at the time (originally 256 kilobytes and after either a pokemon title or Zelda I think it was it became 512) and called it a day, wasted space be damned (and it can be a lot of space in the end). If you have the actual cart there it is considerably easier to tell what it is so your save grabbing device does not have to do such a workaround.

    Additionally DS saves do not have a specified header (the Wii does have one for instance) so it is very hard to tell what save belongs with what game short of trying them out on every game. Most save dumping programs and flash carts will just hope nobody renames the save, but the hardware dumping devices you can buy in shops (datel, action replay, seemingly your game genie.....) will tend to create a little header (or footer) file with the name of the game, the game serial and more that changes the "what does this belong with?" problem to a trivial matching exercise/check. Most flash carts (and emulators?) are not designed to handle saves like this in the writing or the reading the save phase so you get to remove this header or footer to have them work.
    However the saves themselves need to remain untouched as the games usually check to make sure they have not been corrupted (or possibly hacked) so it is fairly trivial to remove this game genie added header from the save and have it work. Flash carts then tend to appreciate it if you pad the whole save out to be 512 kilobytes in size which is another fairly trivial step.

    Going from flash cart/emulator to game genie is a bit harder as you will probably have to remake the header. If you have a flash cart I suggest you do not bother and use a homebrew program ( ) which are all quite happy without an extra header.
    Still if you have to remake the header you can figure out the format (the ones I dealt with were fairly simple affairs using the game serial, some padding and a some stuff you could make up on the spot like dates all of which can be determined without the original cart) or more likely make a token save on your cart, dump that and transfer the header section over making sure you trim the save to the appropriate size (which you should also have thanks to your token/sacrifice save).
  2. Arquillius

    Arquillius That guy with the shiny pokemon

    Aug 8, 2009
    United States
    Oh, I know this device well, and I've been sitting here waiting for someone to come up with a reasonable way to remove then replace said header/footer so that I can edit the save of my pokemon games. The device does well to restore the original saves just fine, but bringing them to an editable status is a different story.
  3. Arquillius

    Arquillius That guy with the shiny pokemon

    Aug 8, 2009
    United States
    Hello my friend, and a very good morning to you, well alright, afternoon, but still. Here's what you have to know to use/edit your pkmn saves with pokegen and your game genie.

    1. your game genie
    2. a pokemon game of the DS variety
    3. a hex editor (I use HxD myself)
    4. Pokegen
    5. The ability to listen to instructions
    6. patience.

    Alright, I'll skip the crap of how to back up your game save since we've already go that covered.

    Step 1: Back up your save file. you can do this by copy and pasting it somewhere else. Keeping the unedited header is important and you will need this file later.
    Step 2: Open your save file in your hex editor. You will see something like the image below.
    [​IMG] (if you can't see it, it is at:
    Step 3: Get ready cause now comes the tricky part.
    Step 4: Select all of this stuff outlined in red and delete it. (See picture) [​IMG]
    Step 5: Change this number from what ever it is (mine said 16) to 07. (See picture)[​IMG]
    Step 6: Save.
    Step 7: Do your editing and save the file again.
    Step 8: Open your backup and your new file in the hex editor.
    Step 9: Copy removed data and paste it as an insert to the edited file.
    Step 10: Replace 07 with the number it was.
    Step 11: Save.
    Step 12: Reupload and Enjoy!