ROM Hack We need a Pokemon GBA PokeSAV equivalent.

MarkusE

Well-Known Member
OP
Newcomer
Joined
Aug 28, 2007
Messages
54
Trophies
0
XP
82
Country
United States
PokemonMaker, etc. just don't cut it. They generate action replay codes and AR-created Pokemon are highly prone to data corruptions.

We need a program that works just like the DS Pokesav except for R/S/E/FR/LG. Which works by directly editing the .sav

I'd be willing to contribute up to $100 towards the donation fund for a programmer to get working on this.

This document explains how a Pokemon is structured and how the encryption works:
http://www.princeton.edu/~jdonald/pokemon/...onMakerHelp.txt

Steps:
1. Get Pokemon parameters (nature, gender, OT data, moves, etc. etc.) via user input
2. Generate .pkm file (80 bytes) - this is the unencrypted data as outlined in the document above
3. Load .pkm files into .sav - use the XOR encryption algorithm as outlined in the document above and store it into the .sav
(Where to store varies by game -- I believe FireRed stores the beginning of Box 01, Position 01 at around 0x5050)
4. Recompute the game's checksum -- check filb.de for details on the algorithm

So it's doable. Just a lot of work and I'm still working on the DP Pokesav PHP upgrade right now. So anyone who wants to tackle this will get a lot of praise from me and probably some donations, too.
smile.gif
 

PuppyBoy

New Member
Newbie
Joined
May 9, 2008
Messages
3
Trophies
0
XP
1
Country
I was looking at coding something similar for the DS, so you could view pokémon from your GBA game's hidden stats and such without dumping the data and reading it with PokéReader. I probably wouldn't go as far as editing them though due to the huge potential for fuck-upages and corruption of the data.

Is there any other documentation of pokemon GBA save data like this? My previous attempts to find anything usually turn up nothing.
 

Jack-Of-Trades

Well-Known Member
Member
Joined
Apr 21, 2008
Messages
311
Trophies
0
XP
33
Country
United States
You could probably

Take a save file with slot 6 empty
and another sav where slot 6 has a hacked pokemon

And then use something like hex compare
So you can see where it store's it's data
 

PuppyBoy

New Member
Newbie
Joined
May 9, 2008
Messages
3
Trophies
0
XP
1
Country
QUOTE said:
So you can see where it store's it's data

If only it was as simple as that. I've compared three save files and the location changes everytime. There's probably some way it structures everything based on your trainer ID or something. There's no way I can work it out on my own though...
 

PuppyBoy

New Member
Newbie
Joined
May 9, 2008
Messages
3
Trophies
0
XP
1
Country
Xeronage said:
1. Checksum
In what context?

QUOTE(Xeronage @ May 10 2008, 10:26 PM) 2. It contains 2 or 3 savefile backups in one (Against Data corruption)

There's only one backup I believe. From what I've read it uses 128kb of flash memory to store a 64kb save file aswell as a backup of it. I think that it puts the main save at 0x0A010000, 64kb into the save data and the backup at 0x0A000000 - this would explain why running in VBA gives you the 'File is corrupt, previous file will be loaded' message - VBA just doesn't save the full 128kb sav file - but I have to confirm this...

Okay, ignore that. There's one back up. The save file's split into 28 4096kbyte, slightly out of order ,chunks - 14 for the most recent save, 14 for the previous save. Only 16 chunks are saved in the 64kb file that VBA outputs unless you give it a 128kb file, it doesn't seem to like generating them itself. :S
 

Jack-Of-Trades

Well-Known Member
Member
Joined
Apr 21, 2008
Messages
311
Trophies
0
XP
33
Country
United States
QUOTE said:
We need a flash cart with proper 128kb save support, for that matter... Most either handle them oddly or choke on it.

Yeah reason i hate to use VBA to use cheats then put them back on my cart

turns my 32KB file to a 64KB file (still work's on card though)

My Cart handles
8,16,32,64,128 Files
 

TSPhoenix

Well-Known Member
Member
Joined
Aug 7, 2007
Messages
158
Trophies
0
XP
195
Country
I've been working (I use that term loosely, I'm pretty crap at this) on a tool that can read savefiles for the original Red/Blue games. (If you have relevant links/info a PM would be appreciated)

In a similar vein if we could make an editor for older games it'd be nice to have a converter that will import old generation Pokemon into newer generations. I know this means adding in data such as gender and doubling (with 50% +1) IVs and capping EVs and so forth but what I eventually want to do is find an old GB(C/A) linker I can use to dump/restore saves from real Pokemon RBY(GSC/RSE) carts and process the data. I don't see my Blue savefile lasting that much longer so I'd like to salvage it.
 

gumbyscout

Well-Known Member
Member
Joined
Sep 2, 2007
Messages
217
Trophies
0
Age
32
Location
Who cares?
XP
287
Country
United States
TSPhoenix said:
I've been working (I use that term loosely, I'm pretty crap at this) on a tool that can read savefiles for the original Red/Blue games. (If you have relevant links/info a PM would be appreciated)

In a similar vein if we could make an editor for older games it'd be nice to have a converter that will import old generation Pokemon into newer generations. I know this means adding in data such as gender and doubling (with 50% +1) IVs and capping EVs and so forth but what I eventually want to do is find an old GB(C/A) linker I can use to dump/restore saves from real Pokemon RBY(GSC/RSE) carts and process the data. I don't see my Blue savefile lasting that much longer so I'd like to salvage it.
It would be awesome to have a Red/Blue/Yellow/Silver/Gold/Crystal to LGreen/FRed/Ruby/Sapphire/Emerald/Diamond/Pearl converter. I've always wanted one, but It would require someone who knew ALOT about how pokemon are stored, and how to program.
 

MarkusE

Well-Known Member
OP
Newcomer
Joined
Aug 28, 2007
Messages
54
Trophies
0
XP
82
Country
United States
I'm still interested in this.

QUOTE said:
We're discussing a program that (like Pokesav for D/P) directly edits the raw game file (for example, the .sav file entered into VBA), not one that generates Gameshark codes. Because of the way these cheat devices work, they have high tendencies of corrupting data.

-----------------------------------------------------------------------------------

Anyway, the main problem right now isn't the individual Pokemon data structure, but the overall encryption.

And as brought up earlier, the address where the Pokemon PC data begins changes every time. For my latest save it's 0x3004 and 0x12004 (the latter serves as a backup in case the data gets corrupted.)

Each box Pokemon is 80 (0x50) bytes. You can't just copy and paste the contents of 0x3004-0x3053 to 0x3054-0x3103 to duplicate it; the game simply gets corrupted and falls back to the 0x12004 save. If you do it for both chunks (0x3004 and 0x12004), the game thinks both chunks are corrupted, and your file is automatically deleted. So there is definitely a checksum in each of the chunks.

For an easier start than directly editing Pokemon, how about, for example, enabling all items in the bag and setting them to max quantities? Or having a full Pokedex? Or even easier yet, changing your trainer ID without corrupting the game? These might provide insights as to how to decode the more complicated data...
 

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
  • BakerMan
    The snack that smiles back, Ballsack!
    BakerMan @ BakerMan: @salazarcosplay yeah cod's still up