Jump to content

Pt/HGSS Trainer Records offsets & Misc. (research)


futuu

Recommended Posts

Trainer Records is encrypted by LCRNG algorithm
Y0 = seed

Yn+1 = Yn * 0x41C64E6D + 0x6073
Xn = origin data XOR Yn 3&4th bytes

offsets:
Pt: 61B4~6367 seed: 6368~636B
HGSS: 4B44~4CF7 seed: 4CF8~4CFB

DP are not encrypted

17587.png.2492a01b1f40b09634e9eb67e3a5cee0.png

Pt can receive globe and crystals from Mr. Goods
accessed GTS: flag 2444 set
used another underground count by constant 71, 72, 73, 84: ->100
DP is 70~73

HGSS event flag(unset) 0681, 0682, 0683 = battle tower trophy
flag 0239, 0240, 0241 constant 226: ->4(conversation) = all Pokéathlon basement room enterable
flag(unset) 0725, 0726, 0727, 0728, 0729 = room items

26009.png.09d88ca43f465ccce5ac34895644ca31.png

Edited by futuu
  • Like 1
Link to comment
Share on other sites

  • 4 months later...

It seems Pt/HGSS are using the same offsets
+61B0 for Pt or +4B40 for HGSS
   4 score
 10 berry planted
 1C wild pokemon battles
 20 NPC trainer battles
 24 pokemon caught
 28 times fished
 2C eggs hatched
 30 pokemon evolved
 38 played in game corner
 3C battle tower continues won
 4C link trades
 50 link battles
 54 link battle wins
 58 link battle losses
 60 wifi trades
 64 wifi battles
 68 wifi battle wins
 6C wifi battle losses
 74 battle tower won
 8C money spent
 A0 daycare sent
 A4 pokemon defeated
 B4 mail wrote
 C0 TV watched
 C4 nicknames given
 CC berries pokemon picked
 C8 premium ball got
 D0 poffin made
 DC ***unknown Pt recorded
 E0 ***unknown Pt recorded
 E4 battleground won
 E8 battle frontier total won
 EC battle brains total won
 F0 battle factory won
 F4 battle castle won
 F8 battle hall won
 FC battle arcade won
100 battle factory pokemon changed
104 battle castle CP total remained
108 battle hall over level 10 selected?
10C battle arcade bonus BP?
110 BP got
114 BP spent
118 ***unknown Pt recorded
120 championship won
-126 splash used
-142 contest participated
144 link contest participated?
-146 contest won
148 link contest won?
14C move no effect
-14E own pokemon fainted
150 friendlyfire?
-152 failed run
154 pokemon run
-156 failed fishing
174 fossil restored
-176 ***unknown Pt recorded

Edited by futuu
  • Like 1
Link to comment
Share on other sites

  • futuu changed the title to Pt/HGSS Trainer Records offsets (research)
On 10/19/2021 at 8:19 AM, theSLAYER said:

I've merged your messages. Also, no need to send unsolicated pings to specific people to ask for help.

I found the encryption algorithm and succeed to decrypt them, researching the offsets now
Is it easy to add the editor to PKHeX?

  • Like 1
Link to comment
Share on other sites

  • futuu changed the title to Pt/HGSS Trainer Records offsets & Misc. (research)
  • 1 year later...

Not knowing a thing about hex editing, I'm trying to make sense of this but got stuck. I'm trying to edit a Platinum save.

Flags 71; 72; 73 and 84 are easy. They can be changed in the Research tab of the Event Flag Editor. Don't know what they meant with "accessed GTS: flag 2444 set". It's not a constant (they go from 0 to 287), nor a hex number telling you what flag is it (equals 9284 in decimal). I thought it was an offset and changed it from 00 to 01 in my save file, but seems like I'm mistaken and/or doing something wrong (save file gets corrupted). Changing GeonetGlobalFlag from false to true in the Simple Editor doesn't trigger Mr. Goods giving you the Globe either.

Now the dumber tries:

I go to the 61B4-6367 block, but I don't know what to do with the list futuu posted. Knowing I caught the entire dex (493) I tried the sum of 61B4+24 (Pokemon Caught) and it's 61D8. Which in my save file is 27 hexadecimal (39 in decimal). Then I tried 61D8-61DB, assuming that Pokemon Caught goes from 24 to 27 because 28 is Times Fished. In my save file that's 27 D0 1B F7 and no matter if I flip the order or not (I remember hex editing a Gen3 file and I had to flip them), it's a very high decimal number, far from 493 (01ED in hex). Then I tried searching for 01 ED and ED 01 but no matches found in the 61B4-6367 block.

If teaching how to understand this is too much, I just really want two things:
1.- The Globe from Mr. Goods.
2.- See where is my Battle Hall won count stored
(F8 in the futuu's list). I have a legit 180 streak but I want to set the score to 10000 and trigger this: If the record is over 1,000, the player will get Johanna, and over 10,000 will get Professor Oak or Jasmine. BUT... Changing the record in the Battle Frontier tab of the Misc Editor is not enough. Bulbapedia may be wrong or it may be a random or bugged event, not sure.

Edited by jacksonf
Link to comment
Share on other sites

On 10/30/2023 at 10:15 AM, jacksonf said:

Not knowing a thing about hex editing, I'm trying to make sense of this but got stuck. I'm trying to edit a Platinum save.

Flags 71; 72; 73 and 84 are easy. They can be changed in the Research tab of the Event Flag Editor. Don't know what they meant with "accessed GTS: flag 2444 set". It's not a constant (they go from 0 to 287), nor a hex number telling you what flag is it (equals 9284 in decimal). I thought it was an offset and changed it from 00 to 01 in my save file, but seems like I'm mistaken and/or doing something wrong (save file gets corrupted). Changing GeonetGlobalFlag from false to true in the Simple Editor doesn't trigger Mr. Goods giving you the Globe either.

Now the dumber tries:

I go to the 61B4-6367 block, but I don't know what to do with the list futuu posted. Knowing I caught the entire dex (493) I tried the sum of 61B4+24 (Pokemon Caught) and it's 61D8. Which in my save file is 27 hexadecimal (39 in decimal). Then I tried 61D8-61DB, assuming that Pokemon Caught goes from 24 to 27 because 28 is Times Fished. In my save file that's 27 D0 1B F7 and no matter if I flip the order or not (I remember hex editing a Gen3 file and I had to flip them), it's a very high decimal number, far from 493 (01ED in hex). Then I tried searching for 01 ED and ED 01 but no matches found in the 61B4-6367 block.

If teaching how to understand this is too much, I just really want two things:
1.- The Globe from Mr. Goods.
2.- See where is my Battle Hall won count stored
(F8 in the futuu's list). I have a legit 180 streak but I want to set the score to 10000 and trigger this: If the record is over 1,000, the player will get Johanna, and over 10,000 will get Professor Oak or Jasmine. BUT... Changing the record in the Battle Frontier tab of the Misc Editor is not enough. Bulbapedia may be wrong or it may be a random or bugged event, not sure.

globe: just set flag 2444 on

a.png.c9e2fa1744f584b7321e6f59fcf7e0de.png

Battle Hall won count (trainer records) needs to be decrypted, a boring work

you can upload your save file and let me check it out

but it looks like the characters don't always appear every time

https://www7a.biglobe.ne.jp/~namake/diary/2008/stage.htm

Edited by futuu
Link to comment
Share on other sites

10 hours ago, futuu said:

globe: just set flag 2444 on

a.png.c9e2fa1744f584b7321e6f59fcf7e0de.png

Battle Hall won count (trainer records) needs to be decrypted, a boring work

you can upload your save file and let me check it out

but it looks like the characters don't always appear every time

https://www7a.biglobe.ne.jp/~namake/diary/2008/stage.htm

Ah, so Flag and Constant are two different things? Or does the Constant list only includes what has been already researched? Goes to show how much I don't know. Thank you, the Globe part was easy to follow. Grateful for the offer, here's my save file:

Plat Save.sav

Link to comment
Share on other sites

8 hours ago, jacksonf said:

Ah, so Flag and Constant are two different things? Or does the Constant list only includes what has been already researched? Goes to show how much I don't know. Thank you, the Globe part was easy to follow. Grateful for the offer, here's my save file:

Plat Save.sav 512 kB · 1 download

(flag has 2 states on and off in 1 bit & constant is a number 0~65535 in 2 bytes)

your pokemon caught count is 219 and battle hall won count is certainly 180

a.png.c960d00bcbe4e3950bdbda6c41d5701f.png

here i edited the battle hall won count to 10180, see if the characters appear

Plat Save.sav

Edited by futuu
  • V-Wheeeeeel!!! 1
Link to comment
Share on other sites

7 hours ago, futuu said:

(flag has 2 states on and off in 1 bit & constant is a number 0~65535 in 2 bytes)

your pokemon caught count is 219 and battle hall won count is certainly 180

a.png.c960d00bcbe4e3950bdbda6c41d5701f.png

here i edited the battle hall won count to 10180, see if the characters appear

Plat Save.sav 512 kB · 2 downloads

Thanks again for taking the time to help! Oops, I thought that caught=owned (that's what I said 483) but I guess caught=caught. Will edit this post If I manage to trigger the NPCs. Hope this gets added to PKHeX someday.

Edited by jacksonf
Link to comment
Share on other sites

  • 4 months later...

Is what futuu posted all that’s needed to implement trainer records editing for dppthgss save files? Please implement something like that if is true because it’s been two and a half years!

 

Edit: I had to add "if" between "that" and "is" for grammar.

Edited by Jollygator
Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...