Jack Black Posted August 13, 2019 Posted August 13, 2019 Hello good Afternoon, im trying to learn how to Hex editing using my Pokemon Emerald save, and i cant find specific values sutch as money amount and others. im using HxD for this, and even i know the basics about Hexadecimal (hard times when i study it at school), its being dificult to me undestand this now on practice... thanks for the help
Poke J Posted August 14, 2019 Posted August 14, 2019 Since you're trying to learn how to find specific values in a save file and you're using HxD you 100% know that nothing is labelled in the file. So to find a particular thing in the save you will have to compare before and after saves to find the differences between them. In your case you are you're looking for where money is stored in the save so I'll run through an example how to find that value. 1) Go to the Poke Mart and save the game in front of the store clerk. 2) Make a backup of the save. 3) Purchase an item from the clerk and save the game. 4) Make a backup of the save. (Now you'll have two save files with one before buying an item and one after buying an item.) 5) I recommend copying either one of the save files to make a third save file to do the edits on. 6) Now compare the first two saves and the only differences that should be between them is play time, item quantities, and money. 7) Since you should know what money you started with and what money you ended with you should be able to identify which values correspond with your money total. 8 ) On the third save file try and edit those values to something else and then save the the save file in HxD. 9) Open the third save file in PKHeX and then save it with PKHeX. (This will update the checksum of the save so that when you load the save you won't get the "Save file is corrupt" error message.) 10) If the money amount did not change go back to step 5 and try a different value that is different between the two saves. Note 1: When ever you do any editing always make backups of your save in case you mess up. More save backups the better. Note 2: If I remember correctly any money value greater than 255 or FF in hex is stored in the save in the reverse order. For example the 256 would be saved as 00 01 and not 01 00. If you follow these steps you should be able to find any value or flag in any save as long as you make a before and after save. 1
theSLAYER Posted August 14, 2019 Posted August 14, 2019 A few things I gotta add on: 1. Save block data has already been identified and recorded here: https://bulbapedia.bulbagarden.net/wiki/Save_data_structure_in_Generation_III#Save_index 2. There are 2 saves in the save file (Game Save A and Game Save B). 3. GBA save blocks are shuffled. (as in the save block won't always be in the same position) They are easy to identify once you know how to identify which block you're looking at, though. [Section ID and Save Index in the page I linked] 4. Even after modifying the slot you found, you also need to know how to correct the checksums. 1
Jack Black Posted August 14, 2019 Author Posted August 14, 2019 9 hours ago, Poke J said: Since you're trying to learn how to find specific values in a save file and you're using HxD you 100% know that nothing is labelled in the file. So to find a particular thing in the save you will have to compare before and after saves to find the differences between them. In your case you are you're looking for where money is stored in the save so I'll run through an example how to find that value. 1) Go to the Poke Mart and save the game in front of the store clerk. 2) Make a backup of the save. 3) Purchase an item from the clerk and save the game. 4) Make a backup of the save. (Now you'll have two save files with one before buying an item and one after buying an item.) 5) I recommend copying either one of the save files to make a third save file to do the edits on. 6) Now compare the first two saves and the only differences that should be between them is play time, item quantities, and money. 7) Since you should know what money you started with and what money you ended with you should be able to identify which values correspond with your money total. 8 ) On the third save file try and edit those values to something else and then save the the save file in HxD. 9) Open the third save file in PKHeX and then save it with PKHeX. (This will update the checksum of the save so that when you load the save you won't get the "Save file is corrupt" error message.) 10) If the money amount did not change go back to step 5 and try a different value that is different between the two saves. Note 1: When ever you do any editing always make backups of your save in case you mess up. More save backups the better. Note 2: If I remember correctly any money value greater than 255 or FF in hex is stored in the save in the reverse order. For example the 256 would be saved as 00 01 and not 01 00. If you follow these steps you should be able to find any value or flag in any save as long as you make a before and after save. But how do i locate this values?? I read on https://bulbapedia.bulbagarden.net/wiki/Save_data_structure_in_Generation_III#Security_key that this values have a protection?? how do i pass throw it?? 9 hours ago, theSLAYER said: A few things I gotta add on: 1. Save block data has already been identified and recorded here: https://bulbapedia.bulbagarden.net/wiki/Save_data_structure_in_Generation_III#Save_index 2. There are 2 saves in the save file (Game Save A and Game Save B). 3. GBA save blocks are shuffled. (as in the save block won't always be in the same position) They are easy to identify once you know how to identify which block you're looking at, though. [Section ID and Save Index in the page I linked] 4. Even after modifying the slot you found, you also need to know how to correct the checksums. According to this info, i think that i flag the SGB A, that goes throw block 0-DFFF, and descovery the "highlighter" for the SGB B whitch starts on E000 with FF FF FF FF FF... but now... What block can i Mixup and how can i rewrite the checksum?? What is "data"?? im i able to update anything in here??
theSLAYER Posted August 14, 2019 Posted August 14, 2019 I merged your posts. Please do not make multiple posts in succession. If no one replied you, edit the new information/question into your latest unreplied post. 29 minutes ago, Jack Black said: But how do i locate this values?? For known values, they're in the save structure recorded by Bulbapedia.. For unknown values, compare the save files using HxD. (note: you gotta align the blocks in correct order first) If comparison impossible, do trial and error. See which half of the save actually has the change, then keep doing halves and halves until you can narrow down which block has the value. Finally, compare that block for before and after, to see which offset(s) has been changed 29 minutes ago, Jack Black said: I read on https://bulbapedia.bulbagarden.net/wiki/Save_data_structure_in_Generation_III#Security_key that this values have a protection?? how do i pass throw it?? I feel as though the bulbapedia page explained it sufficiently Quote Used to encrypt sensitive data, such as money or item quantities. Applied to data via a simple exclusive or operation. 29 minutes ago, Jack Black said: According to this info, i think that i flag the SGB A, that goes throw block 0-DFFF, and descovery the "highlighter" for the SGB B whitch starts on E000 with FF FF FF FF FF... I don't understand what you are trying to say. What "highlighter"? In regards to your save B consisting of nothing but 0xFF, I'm assuming you only saved in game once or something? 29 minutes ago, Jack Black said: What block can i Mixup and how can i rewrite the checksum?? To be completely honest, I nowadays use PKHeX to fix checksums. Once again, the checksum fixing is in the bulbapedia page: Quote Checksum Used to validate the integrity of saved data. A 16-bit checksum generated by adding up bytes from the section. The algorithm is as follows: Initialize a 32-bit checksum variable to zero. Read 4 bytes at a time as 32-bit word (little-endian) and add it to the variable. The number of bytes to process in this manner is determined by Section ID. Take the upper 16 bits of the result, and add them to the lower 16 bits of the result. This new 16-bit value is the checksum. 29 minutes ago, Jack Black said: What is "data"?? im i able to update anything in here?? erm.. It basically means it's an area that has the data you're looking for. Whatever the data is, that's the area that has data in it. In any case, I don't understand why you're doing this. PKHeX probably is able to edit whatever value you seek. If it is for practice, sure go ahead, won't stop you. Rather than ask so many questions, you probably should take this one step at a time. Figure out for sure how to do one thing, then move on to the next point. I suggest: 1. Learn how to identify which save is the more recent save (because the game loads that one. Whether Save A or Save B is the more recent save, isn't fixed) 2. Learn how to identify the blocks. 3. For starters, locate the block for money (based on bulbapedia's guide) 4. Locate the offset for money (based on bulbapedia's guide) 5. Fix the checksum for money's block 6. Fix the checksum for the overall save. If you cannot get past these, you probably won't be able to make any other edit. As it was said that Ruby/Sapphire's Money isn't XOR'd against the Security Key, I recommend you try to edit a RS save first. 1
Jack Black Posted August 15, 2019 Author Posted August 15, 2019 Hello again guys, im having a bad time undestanding the table on Section Format... I now, all the info in front of my face and i cant find it :/. Here says that eatch sector haves 3968 bytes of lentgh, but on the table it says that, for ex, ID sec have 2 lentgh?? Once more sorry for my Dummyness XD,
theSLAYER Posted August 15, 2019 Posted August 15, 2019 For example, let's look at the first section in my save: Section ID: 0x000C Checksum: 0x0000 (had no data in that block, so nothing to checksum I presume) Save Index: 0x00000002 Now look at the next section: Section ID: 0x000D (makes sense that it ascends) Checksum: 0xF131 Save Index: 0x00000002 Makes sense to you now? :3 1
Jack Black Posted August 18, 2019 Author Posted August 18, 2019 On 8/15/2019 at 2:18 PM, theSLAYER said: For example, let's look at the first section in my save: Section ID: 0x000C Checksum: 0x0000 (had no data in that block, so nothing to checksum I presume) Save Index: 0x00000002 Now look at the next section: Section ID: 0x000D (makes sense that it ascends) Checksum: 0xF131 Save Index: 0x00000002 Makes sense to you now? :3 Man you save my!!!
Jack Black Posted August 23, 2019 Author Posted August 23, 2019 (SORRY MANS, i cant post this few last days because my laptop`s charger brokedown, and i spend this days fixing it...) After more then a week searching about it, and after doing a LOT of experiments in allmost all of the possible Ways, I have only one thing to say... "Ladies and gentlemen, WE GOT IT" I found the Money Amount Location... As well as the Security Key... TRY TRY TRY and then remenber that the Hex values are "twisted", finaly find out how to REVEAL THE MONEY, (sutch as other things, i can now MOD almost anything related with Trainers data, Pokemon Party and so on...) After that i compare with values in the Save Editer... Im trying to figure out how to transform the value i want to Hex... but Thats it... finaly understood how game save file is ordened: Gamesave A: 13 SECTIONS(data), EATCH ON WITH == FOOTER, then SECID/CHECKSUM/SAVEINDEX Gamesave B: EXACTLY the same Hall of Fame Mystery Gift Recorder battle BUT I HAVE A QUESTION.... 1st - WHY IN THE WORLD is SEC00 in LAST PLACE on gamesave B, and Simply doesnt exists at all on gamesave A; 2st - I dont understend allready the Pokedex Indexes so... HELP And thats it... Now i can reveal my secret Plan to DOMINATE THE WOR, i mean help and evo POKE.COM... My plan is to Build an Website that brings back to life ALL the EMOTION of play old pokemon Gens... A site wen you can upload you save, compare yours stats whit your friends, change items with eatch other AND BELEVE OR NOT.... TRADE YOUR POKEMON WITH PEOPLE ALL ARROUND THE WORLD, AND BATTLE JUST LIKE WE DO WEN WE ARE KINDS!!!!!!(unfortunly i didnt have GBA wen i was young, i only got it wen nintendo GameBoy was descontinued, so... WERE IS MY CHILDHOOD ;-;) Also this Project of mine will by used as Final Project in school so, LETS END IT WITH GOLDEN KEY!!! And thats all, Thank you for all your effort and patince, and lets move out
theSLAYER Posted August 23, 2019 Posted August 23, 2019 36 minutes ago, Jack Black said: Im trying to figure out how to transform the value i want to Hex... 36 minutes ago, Jack Black said: My plan is to Build an Website Erm, do you know how to build a website? Have you got a functioning website up yet? Also, regarding how to "transform the value into hex", most programming languages (including whatever language your site uses) should have simple to hex and to dec operations, though if you're modifying a value, it isn't necessary to transform a value to hex, because hex and decimal is basically just different ways to represent the same value. All you gotta do is to write the value as byte (or however it is expressed in the programming language you're using) 39 minutes ago, Jack Black said: finaly understood how game save file is ordened: Gamesave A: 13 SECTIONS(data), EATCH ON WITH == FOOTER, then SECID/CHECKSUM/SAVEINDEX Gamesave B: EXACTLY the same Hall of Fame Mystery Gift Recorder battle Congratulations, I see you understood what the documented data on bulbapedia mean. 40 minutes ago, Jack Black said: WHY IN THE WORLD is SEC00 in LAST PLACE on gamesave B, and Simply doesnt exists at all on gamesave A; What is this "SEC00" you speak of? 41 minutes ago, Jack Black said: I dont understend allready the Pokedex Indexes so... HELP As in you don't understand how they're stored, or don't understand how to find it in the save? If it's how they're stored (if I'm not mistaken): Think of the hex 0xFF, in binary it's: 11111111 Now look at 0xFE: 11111110 and 0xFD: 11111101 Each 1 or 0 represents whether a Pokémon is seen/caught (depending you're at seen or caught offset). For each byte->binary, the furthest right is the smallest value, starting from 0, and ascends up for everything Pokémon seen/caught. 1
Jack Black Posted August 23, 2019 Author Posted August 23, 2019 15 minutes ago, theSLAYER said: do you know how to build a website? As i sad in my final words, this project i have in mind is ALSO to my final school Project, and yes, in my couse i lern C#, database conn(will lern this year), PHP/HTML/AJAX/JAVASCRIPT, and yes, in my last intership i build a actual funcional site to them, sutch as in school,(im working in a little webapp too!!! For Helping on PK Rom translate ). In actual fase you can allready put data in it, and will be translated, but is FAR FAR way of being completed XD 28 minutes ago, theSLAYER said: What is this "SEC00" you speak of? Section 0, related to Trainers info, this sector dosnt exist in GameSave A, and is in last place on B
theSLAYER Posted August 23, 2019 Posted August 23, 2019 Great, at least you know how to get a very basic site up. Before we jump too far into the rabbit hole, I think you should make your site is able to "recognize" which sections each part of any given save is, before we continue any further. After all, the save blocks shuffle. So that probably is the most basic functionality you'll need to program in. I recommend you get that done, before worrying about other steps. As for why Trainers values doesn't exist, did you save twice in-game? Is your save one that is recently started (has 0 progress in it)? It should be there, since the save B is meant to be backup in case save A corrupts. No reason why it wouldn't be there.
Jack Black Posted August 23, 2019 Author Posted August 23, 2019 So, do you think i must start with the translator first??
theSLAYER Posted August 23, 2019 Posted August 23, 2019 Before we go into editing saves, probably should get your site to display various features of whatever save is uploaded onto it. If your site can't recognize stuff, then editing saves is impossible. And the only way to test and know for sure if your site is recognizing the correct data.. is to get your site to display the data ><
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now