Glitch City Laboratories Archives

Glitch City Laboratories closed on 1 September 2020 (announcement). This is an archived copy of a thread from Glitch City Laboratories Forums.

You can join Glitch City Research Institute to ask questions or discuss current developments.

You may also download the archive of this forum in .tar.gz, .sql.gz, or .sqlite.gz formats.

Generation II Glitch Discussion

Some competitive battling box name codes for Coin Case arbitrary code execution - Page 2

Re: Some competitive battling box name codes for Coin Case arbitrary code execution

Posted by: Dragon Arbock
Date: 2017-10-20 17:11:57
I asked about this elsewhere, but would you be kind enough to provide a shiny code that results in females? Also maybe a version for both males and females that gives Hidden Power Grass? The existing shiny code is male, HP dragon.

Edit;
Welp, nobody helped me so I had to figure it out myself just based on patterns .
Shiny female code;
Ap0'd'vR55
é'm2p0?'vm    [atk 3, defense 10] 
éA4p0'd'vQ
é?2p0k55        [special 10, spd 10]
55éA4ppp
'v7'v'dé42p
éD9'l'lA'lx
'd5555555
That one is HP dragon. I'll edit with HP Grass for both genders later.

Edit 2;
Shiny Female HP grass spread;
Ap0'd'vR55
é'm2p0k'vA    [atk 2, defense 10] 
éA4p0'd'vQ
é?2p0k55        [special 10, spd 10]
55éA4ppp
'v7'v'dé42p
éD9'l'lA'lx
'd5555555

Shiny male HP grass spread;
Ap0'd'vR55
é'm2pp0é5    [atk 14, defense 10] 
éA4p0'd'vQ
é?2p0k55        [special 10, spd 10]
55éA4ppp
'v7'v'dé42p
éD9'l'lA'lx
'd5555555

(haven't tested the Grass ones, but should work in theory and if psypoke's HP calculator can be trusted).

Re: Some competitive battling box name codes for Coin Case arbitrary code execution

Posted by: Couldntthinkofaname
Date: 2017-10-22 08:10:05

I asked about this elsewhere, but would you be kind enough to provide a shiny code that results in females? Also maybe a version for both males and females that gives Hidden Power Grass? The existing shiny code is male, HP dragon.

Edit;
Welp, nobody helped me so I had to figure it out myself just based on patterns .
Shiny female code;
Ap0'd'vR55
é'm2p0?'vm    [atk 3, defense 10] 
éA4p0'd'vQ
é?2p0k55        [special 10, spd 10]
55éA4ppp
'v7'v'dé42p
éD9'l'lA'lx
'd5555555
That one is HP dragon. I'll edit with HP Grass for both genders later.

Edit 2;
Shiny Female HP grass spread;
Ap0'd'vR55
é'm2p0k'vA    [atk 2, defense 10] 
éA4p0'd'vQ
é?2p0k55        [special 10, spd 10]
55éA4ppp
'v7'v'dé42p
éD9'l'lA'lx
'd5555555

Shiny male HP grass spread;
Ap0'd'vR55
é'm2pp05    [atk 14, defense 10] 
éA4p0'd'vQ
é?2p0k55        [special 10, spd 10]
55éA4ppp
'v7'v'dé42p
éD9'l'lA'lx
'd5555555

(haven't tested the Grass ones, but should work in theory and if psypoke's HP calculator can be trusted).


Sorry about that, I was going to help you but got sidetracked.

Nice codes!

Re: Some competitive battling box name codes for Coin Case arbitrary code execution

Posted by: Dragon Arbock
Date: 2017-10-22 15:48:43
Edited the male hp grass code- accidentally put the code for 14 atk 15 def. Don't write posts at 4 am.
I could make a sheet with codes for any combination of DVs, but I don't know that anyone needs anything besides max HPs and shiny spreads.
Also curious to know whether the game stores the special DV or the Spd DV first. I would have assumed special, but I've seen the order or stats listed atk, def, spd, special in that order.

Re: Some competitive battling box name codes for Coin Case arbitrary code execution

Posted by: spamviech
Date: 2017-10-22 17:45:00
According to the RAM map from Data Crystal it's Attack/Defense then speed/special.
Since speed EV is stored before special EV I would assume it's the same for IVs (so speed is the first byte, special the second).

Re: Some competitive battling box name codes for Coin Case arbitrary code execution

Posted by: Nostalgia
Date: 2017-10-23 07:03:41
So I used the Hidden Power Water code for Jolteon and I noticed his HP wasn't maxed, so I Rare Candy it to level 50 just to check its DVs and the Hp DV was 7, but it's other DVs was 14/13/15/15/15, so that would be right for the Hidden Power, but does anyone know why the HP wasn't maxed out? Torchickens max DV and Hidden Power Bug codes have worked perfect for me so far, so I don't know if it's a error with this particular code or if it's me being a dumbass again.

Re: Some competitive battling box name codes for Coin Case arbitrary code execution

Posted by: Dragon Arbock
Date: 2017-10-23 11:42:34

So I used the Hidden Power Water code for Jolteon and I noticed his HP wasn't maxed, so I Rare Candy it to level 50 just to check its DVs and the Hp DV was 7, but it's other DVs was 14/13/15/15/15, so that would be right for the Hidden Power, but does anyone know why the HP wasn't maxed out? Torchickens max DV and Hidden Power Bug codes have worked perfect for me so far, so I don't know if it's a error with this particular code or if it's me being a dumbass again.


HP is calculated separately based off the other DVs. The code modifies attack and defense, and special and speed. I don't think we can directly modify that because of it, but maybe there's a better attack/defense spread that would give better HP at the cost of a point or two in attack/defense?
(knowing that modern hidden power is based on a pattern of evens an odds and not the exact numbers themselves though, there might not be).

Re: Some competitive battling box name codes for Coin Case arbitrary code execution

Posted by: Nostalgia
Date: 2017-10-23 12:36:27
I thought because Hidden Power is only based on the Attack, Defense, Special and Speed stats - that it doesn't matter what the HP value is. I used the Hidden Power Bug code for my Scizor and although I didn't check its DVs in detail, it had maximum HP at level 5 which suggests its DVs were probably 15/13/13/15/15, while my Jolteon didn't and that's why I checked it in detail. I don't care much about a bad HP DV for Jolteon, its a frail Pokemon regardless, but I'm just wondering about the details in the code and if I made the error, because Torchickens designed the codes to give the maximum possible DVs for each Hidden Power, so I'm curious.

Re: Some competitive battling box name codes for Coin Case arbitrary code execution

Posted by: Dragon Arbock
Date: 2017-10-23 12:40:58

I thought because Hidden Power is only based on the Attack, Defense, Special and Speed stats - that it doesn't matter what the HP value is. I used the Hidden Power Bug code for my Scizor and although I didn't check its DVs in detail, it had maximum HP at level 5 which suggests its DV's were probably 15/13/13/15/15, while my Jolteon didn't and that's why I checked it in detail. I don't care much about a bad HP for Jolteon, its a frail Pokemon regardless, but I'm just wondering about the details in the code and if I made the error, because Torchickens designed the codes to give the maximum possible DVs for each Hidden Power, so I'm curious.


Hidden power is only based on atk, def, spd, and special, because those are the only 4 that exist. HP isn't a DV, it's a stat calculated based on the other 4. And as far as I understand, the max value it can have is 7 because hidden power water requires an Even attack IV, and having an Even attack means you miss out on 8 points of the max HP stat.

Re: Some competitive battling box name codes for Coin Case arbitrary code execution

Posted by: Nostalgia
Date: 2017-10-23 13:06:44
Ah, that makes sense. So would Hidden Power Grass or Hidden Power Ice give a better HP stat? Supposedly HP Water is the best option for Jolteon in gen II, but Grass and Ice are still viable and are run on it in every after generation after II.

Re: Some competitive battling box name codes for Coin Case arbitrary code execution

Posted by: Couldntthinkofaname
Date: 2017-10-23 13:08:34
Here are the hidden power equations:

TypeId: 4 (atkIv modulo 4) + (defIv modulo 4)

Damage: (5 * (specIv=>8 + 2speedIv=>8 + 4defIv=>8 + atkIv=>8 ) + (specIv modulo 4))/2 + 31

XIv=>8 is either 0 or 1 depending on if the specified IV is greater than or equal to 8


Ah, that makes sense. So would Hidden Power Grass or Hidden Power Ice give a better HP stat? Supposedly HP Water is the best option for Jolteon in gen II, but Grass and Ice are still viable and are run on it in every after generation after II.


From what i'm gathering from Bulbapedia, Hidden power is completely seperate from the HP stat.

Re: Some competitive battling box name codes for Coin Case arbitrary code execution

Posted by: Nostalgia
Date: 2017-10-23 13:33:54

And as far as I understand, the max value it can have is 7 because hidden power water requires an Even attack IV, and having an Even attack means you miss out on 8 points of the max HP stat.


Then Grass would be 7 too I guess as it requires a 14 Attack stat which is even, and Ice should be normal because it requires a 15 attack stat.

Re: Some competitive battling box name codes for Coin Case arbitrary code execution

Posted by: Dragon Arbock
Date: 2017-10-23 13:48:20


From what i'm gathering from Bulbapedia, Hidden power is completely seperate from the HP stat.


In gen 2, Hidden Power, and the HP stat are both calculated from the other 4 DVs, so they do loosely have something to do with eachother.

And yes, Ice would give you 15 in HP. Grass would only give you 3.

Re: Some competitive battling box name codes for Coin Case arbitrary code execution

Posted by: Couldntthinkofaname
Date: 2017-10-23 13:50:51



From what i'm gathering from Bulbapedia, Hidden power is completely seperate from the HP stat.


In gen 2, Hidden Power, and the HP stat are both calculated from the other 4 DVs, so they do loosely have something to do with eachother.

And yes, Ice would give you 15 in HP. Grass would only give you 3.


Thanks for the info.

I looked on bulbapedia and couldn't find where HP was calculated, can you point me in the direction of this information?

Re: Some competitive battling box name codes for Coin Case arbitrary code execution

Posted by: Dragon Arbock
Date: 2017-10-23 13:55:42
The HP IV is calculated by taking the least significant bit (the final binary digit) of the Attack, Defense, Speed, and Special IVs, then creating a binary string by placing them in that order. As such, a Pokémon with an odd-number Attack IV has 8 added to its HP IV, an odd-number Defense IV has 4 added, an odd-number Speed IV has 2 added, and an odd-number Special IV has 1 added.

https://bulbapedia.bulbagarden.net/wiki/Individual_values#Generation_I_and_II

Not so much of a calculation, more of a 'if odd, add x, if even, add zero'.

Re: Some competitive battling box name codes for Coin Case arbitrary code execution

Posted by: spamviech
Date: 2017-11-02 19:41:40

Max out stat experience, give experience for Level 100 after battle:

Box 1: Ap09é45
Box 2: é04é1455
Box 3: é24é3455
Box 4: é44é5455
Box 5: é64é7455
Box 6: é84é.455
Box 7+: 55555555
Box 13: Unchanged from before
Box 14: Unchanged from before


Just tried this code (well, a variant for usage with wrong pocket TM execution) and the experience is not granted.
Reason is probably that the . character is not 0xf2, but instead 0xe8 (different dot character, only looks the same). Therefore, instead of maximizing Exp gained we are corrupting the SpDef stat of Pokémon 4 (harmless; can be fixed by depositing and re-withdrawing).

Adjusted version that should work; TM variant:

Box 1: Ap0(mult)'v955
Box 2: é3209é14
Box 3: é24é3455
Box 4: é44é5455
Box 5: é64é7455
Box 6: é84é0455
Box 7: é4éé4x'd

Coin Case Variant (untested):

Box 1: Ap0(mult)'v955
Box 2: é3209é14
Box 3: é24é3455
Box 4: é44é5455
Box 5: é64é74'l'l
Box 6: é84é04'l'l
Box 7: é4éé455
Box 8: péZ(mult)x'd