ROM Hack Antisavegame Restore / Secure Value Updater (PS, ACNL, PRW, SSB, XY, ORAS...)

suloku

Well-Known Member
OP
Member
Joined
Apr 28, 2008
Messages
883
Trophies
0
XP
866
Country
NOTE: svdt now suports antisavegame restore patching, so you should probably be using that instead of a windows tool: https://gbatemp.net/threads/svdt-save-data-explorer-manager.396562/

UPDATE 13 september 2015: added information for Monster Hunter 4 Ultimate thanks to TamDanny.

UPDATE 17 september 2015: project on github https://github.com/suloku/secure-value-patcher

UPDATES and changelog: added version v2b
[+]v2b changelog:
- Added filesize check as a way to ensure both old and new files are from the same game

[+]v2 changelog:
- Added more known secure values
- Known secure values are now built in thanks to DaBlackDeath
- Program can backup the old savefile before updating the secure value


IMPORTANT NOTE: PHYSICAL (CARTRIDGE) GAMES CAN BE BACKED UP AND RESTORED REGARDLESS OF THE SECURE VALUE. ANTISAVEGAME RESTORE IS ONLY USED IN DIGITAL VERSION OF THE GAMES (AKA ESHOP GAMES).


What is the Antisavegame restore?
Antisavegame restore is a value (secure value) that is generate each time a digital game saves. This value is stored both at the 3ds and at the savegame of the given title. When the game loads the savefile, it checks the stored value against the one in the 3ds, if they don't match (i.e. if we restore an old savegame using savedata_manager or svdt) the game will tell you that the savedata us corrupted, then it will erase the savegame and start a new blank one.
Only a handful of games use the Antisavegame restore.
The Secure value is stored in a cartridge game savefiles, but it isn't used for obvious reasons.
More information: http://3dbrew.org/wiki/Anti_Savegame_Restore

I decided to make a new thread to centralize this particular matter that is updating the secure value to be able to restore old savegames.

From the sources of DaBlackDeath's Pokemon Shuffle Secure value updater I've made a "universal" application that can work with any game, given we know where the secure value is stored.

The secure value file is a plain txt file containing the offset where the secure value of the given game is stored. I've included the ones we already know for sure: Pokemon Shuffle and Animal Crossing New Leaf, and will include the rest when we find them.
value2.png

List of games known to use anti savegame restore and its location (Red = unconfirmed/unknown):
  • Pokemon Shuffle (savedata.bin): 0x2C
  • Animal Crossing New Leaf (garden.dat): 0x00
  • Super Smash Bros. 3DS (/save_data/account_data.bin, /save_data/system_data.bin): 0x10
    • Important: both files (/save_data/account_data.bin, /save_data/system_data.bin) have to be updated, as both hold the secure value at 0x10.
    • Note: the Demo uses the exact same files and offsets.
  • Pokemon X/Y (main): 0x65400
  • Pokemon ORAS (main): 0x75E00
  • Pokemon ORAS Demo (main): 0x5800
Especial games that use anti savegame restore:
  • Pokemon Rumble World (00slot00 folder with 149 files): secure value is stored in 00main.dat, but since the file is compressed and needs to be decompressed for editing, the offset varies from file to file, also CRC32 in the header has to be updated after recompressing the edited file. It is always (or so it seems) at the end minus 10 bytes of the decompressed file: View attachment 24543
    • Compression: zlib level 9 compression.
  • Monster Hunter 4 Ultimate (user1, user2, user3): secure value is at each user file (unconfirmed) at position 0x112.
    • Each userX file probably needs patching for correct loading (untested).
    • Each userX file is encrypted using blowfish encription. A decripter/encripter is available here.
    • Currently looking for testers to confirm the information and create a patcher like rumble world's, also to add it to svdt.

Since Pokemon Rumble world uses compression, I had to made a separate tool just for Rumble World that will take care of decompressing, updating secure value, recompressing, and updating CRC32 checksum:

Rumble World Secure Value Updater by suloku 2015
************************************************

Included files:
_______________
- src.zip: source code of RWSecureValue.exe
- Rumblecheker.zip: simple application that can check the integrity of the Pokemon Rumble World save files, see included readme.

How to use:
___________

1.- Copy your old 00slot00 folder to the "old" folder.
2.- Copy the latest working backup 00slot00 folder to the "new" folder.
3.- Run the program, the secure value from the new save will be inserted in the old save.
4.- Restore your savegame

VERY IMPORTANT: if you play rumble world after making the latest working backup and before restoring the updated old savefile, the secure value will change and this won't work, because it needs the LATEST rumble world savegame in your 3ds, and the first thing Rumble World does is save the file, so if you boot the game it will no longuer be the latest savefile.


Credits:
________
Thanks to SciresM for the information about how rumble world files are stored and compressed and his save editor.
Thanks to the people of gbatemp who tested the method to locate the secure value.
IMPORTANT NOTE ABOUT RUMBLE WORLD AND FTP TRANSFER: if you transfer your save trough ftbrony or similar, make sure your savegames are complete. Use the Rumblechecker included in RWSecureValue.zip, ftbrony tends to fail when transferring the rumble world savefiles, so you might end with incomplete files. Make sure everythings OK before atempting to update the secure value/edit your savegame with SciresM editor. Or just transfer trough SD card or the built in transfer tool in N3DS.

Here are the manual instructions to edit Rumble World's secure value by using SciresM save editor:
Here's how to change the secure value in rumble world step by step:
1.- Backup the latest rumble world savegame you have and do not play rumble world anymore.
2.- Open it with rumble world save editor (Open Xompressed 00slot00)
3.- Save it with "Save decompressed 00slot00_dec
4.- Navigate to the newly created 00slot00_dec folder
5.- Open 00main_dec.dat with an hex editor (i.e. HxD)
6.- Go to the very end of the file
8.- The secure value is the last but two bytes (8 bytes long):
View attachment 24543
note: since the file is compressed, the offset will change from file to file
9.- Copy the hex bytes somewhere
10.- Repeat the process with your old "corrupted" savefile:
- 10.1.- Open your old ("corrupted") savegame with rumble world save editor (Open Compressed 00slot00)
- 10.2.- Save it with "Save Decompressed 00slot00_dec
- 10.3.- Navigate to the newly created 00slot00_dec folder
- 10.4.- Open 00main_dec.dat with an hex editor (i.e. HxD)
- 10.5.- Go to the very end of the file and locate the secure value
- 10.6.- Change the secure value and save the file
11.- Now in rumble world save editor select "Open Decompressed 00slot00_dec" and open the 00slot00_dec folder of your old "corrupted" savefile.
12.- Save it with "Save Compressed 00solt00"
13.- Restore your fixed 00slot00 folder to rumble world.
 

Attachments

  • RWSecureValue.zip
    116.4 KB · Views: 5,260
  • Secure Value Fixer v2b.zip
    10.9 KB · Views: 6,796
Last edited by suloku,

suloku

Well-Known Member
OP
Member
Joined
Apr 28, 2008
Messages
883
Trophies
0
XP
866
Country
Updated first post with confirmed Pokemon XY and ORAS secure value locations, also updated securevaluefixer.zip to fix a typo and include the files for XY and ORAS.

With this tool we can simply delete the secure value e and save, right ?
No, this tool updates the savegame's secure value to the latest one using the latest savegame. There's no known way to delete the secure value (as with savefatafiler) in 9.5-9.9 firmware yet.
 
Last edited by suloku,

Gocario

GBAFail'd
Member
Joined
Sep 5, 2015
Messages
640
Trophies
0
Location
Bourg Palette
XP
804
Country
France
What is the Antisavegame restore?
Antisavegame restore is a value (secure value) that is generate each time a digital game saves. This value is stored both at the 3ds and at the savegame of the given title. When the game loads the savefile, it checks the stored value against the one in the 3ds, if they don't match (i.e. if we restore an old savegame using savedata_manager or svdt) the game will tell you that the savedata us corrupted, then it will erase the savegame and start a new blank one.
Only a handful of games use the Antisavegame restore.
The Secure value is stored in a cartridge game savefiles, but it isn't used for obvious reasons.
More information: http://3dbrew.org/wiki/Anti_Savegame_Restore

I was wondering:
If I have a Pokemon X game cartridge, I am playing it on my N3DS and I save.
Then a secure value will be "synchronize" between my N3DS and Pkmn X, right?
So, If I want to play Pokemon X on my other O3DS.
The secure value won't correspond between my O3DS and Pkmn X.
Will I be able to play?
 

suloku

Well-Known Member
OP
Member
Joined
Apr 28, 2008
Messages
883
Trophies
0
XP
866
Country
I was wondering:
If I have a Pokemon X game cartridge, I am playing it on my N3DS and I save.
Then a secure value will be "synchronize" between my N3DS and Pkmn X, right?
So, If I want to play Pokemon X on my other O3DS.
The secure value won't correspond between my O3DS and Pkmn X.
Will I be able to play?
You just described the reason why the secure value isn't used for cartridge games. Yes, you will be able to, and that's what the "but it isn't used" phrase makes reference to.

Also, another way to update the secure value is to transfer the digital copy savegame to a physical game cartridge, save in the physical game, then dump and transfer the save to the digital copy. All in the same 3ds, only problem: it needs both the physical and digital copies of the same game.
 

Gocario

GBAFail'd
Member
Joined
Sep 5, 2015
Messages
640
Trophies
0
Location
Bourg Palette
XP
804
Country
France
You just described the reason why the secure value isn't used for cartridge games. Yes, you will be able to, and that's what the "but it isn't used" phrase makes reference to.
I just noticed the "digital game".. Erm.. I'm blind...
So, I don't have to worry about secure value with cartridge games, do I?
 

MattPad

New Member
Newbie
Joined
Sep 5, 2015
Messages
2
Trophies
0
Age
26
XP
41
Country
Hello, I have a problem, when I try to use it, a message pops up saying: "The program can't start because Zlib1.dll is missing from your computer. Try reinstalling the program to fix this problem." Thanks in advance.
 

suloku

Well-Known Member
OP
Member
Joined
Apr 28, 2008
Messages
883
Trophies
0
XP
866
Country
Hello, I have a problem, when I try to use it, a message pops up saying: "The program can't start because Zlib1.dll is missing from your computer. Try reinstalling the program to fix this problem." Thanks in advance.
What program, RWSecurevalue.exe?
Here's the dll, put it in the same folder as the .exe file , I'll update the file in the first post to include it later: http://zlib.net/zlib128-dll.zip

edit: I've updated the file
 

Ryuzaki_MrL

Green Thunder
Member
Joined
Jun 23, 2015
Messages
781
Trophies
0
Age
26
XP
2,040
Country
Brazil
I have a question: My brother wants to play Pokémon X and I only have one gamecard. I was planning on backuping my savefile and let him start a new one. Then, once he has finished the main game, I was going to backup his save and restore mine.
The question is: Will this work or do I need to edit the secure value? (It's a physical european version of Pokémon X)
 

suloku

Well-Known Member
OP
Member
Joined
Apr 28, 2008
Messages
883
Trophies
0
XP
866
Country
I have a question: My brother wants to play Pokémon X and I only have one gamecard. I was planning on backuping my savefile and let him start a new one. Then, once he has finished the main game, I was going to backup his save and restore mine.
The question is: Will this work or do I need to edit the secure value? (It's a physical european version of Pokémon X)
Physical cards don't use secure value, you can backup and restore as much as you want.

--------------------- MERGED ---------------------------

Super Smash Bros. 3DS secure value found thanks to ihaveamac:

offset: 0x10
files to update: account_data.bin, system_data.bin

As you can see, this game has 2 savegame files, and both hold the secure value, so both files have to be updated.
 

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
  • Julie_Pilgrim @ Julie_Pilgrim:
    the internet
  • Julie_Pilgrim @ Julie_Pilgrim:
    @Psionic Roshambo i have 16 gb in my pc and i run into issues with ram more than i'd like to admit
  • HiradeGirl @ HiradeGirl:
    I got only 8GB of RAM. But I want 32GB.
  • Sonic Angel Knight @ Sonic Angel Knight:
    Time to just download more ram
  • K3Nv2 @ K3Nv2:
    Yeah search Google
  • Sonic Angel Knight @ Sonic Angel Knight:
    Or, I also heard that if you use flash memory, it can act as more "RAM" at least windows tell me when I stick a flash drive into it.
  • Veho @ Veho:
    It can act as a swap drive but that isn't more RAM, it's slooow.
  • K3Nv2 @ K3Nv2:
    I wish we could have 1Gbps external storage by now
  • K3Nv2 @ K3Nv2:
    Like for micro
  • Veho @ Veho:
    New Myoo.
  • SylverReZ @ SylverReZ:
    @Veho, Yooo noice
  • SylverReZ @ SylverReZ:
    Looks like a Famicom handheld
  • Veho @ Veho:
    Yeah, they were going for that.
  • Veho @ Veho:
    It's not very good though.
  • Veho @ Veho:
    I'm watching the review, the emulators it uses suck bawls.
  • Veho @ Veho:
    Software update might improve it.
  • Psionic Roshambo @ Psionic Roshambo:
    Or maybe someone will make like Emulation Station for it or something?
  • Veho @ Veho:
    That counts as a software update :tpi:
    +1
  • OctoAori20 @ OctoAori20:
    Ello
  • K3Nv2 @ K3Nv2:
    I can think of the design teams process another joystick and no audio or a joystick and mono audio
  • Veho @ Veho:
    "You think we can just put the speakers at the top
    ?" "NO!"
    +1
  • K3Nv2 @ K3Nv2:
    Pft stereo speakers you're fired
    +1
    K3Nv2 @ K3Nv2: Pft stereo speakers you're fired +1