|
|||||||
![]() |
|
|
Thread Tools |
|
|
#326 | |
|
Join Date: Dec 2006
Posts: 224
|
Quote:
here is what i got so far. Code:
OFFSETS BLACK (add 0x20 to offset for white) 02216084 = SEED1 02216088 = SEED2 0221608C = 0x6C078965 02216090 = 0x5D588B65 02216094 = 0x00269EC3 SEED1 = (0x6C078965 * SEED1) + 0x00269EC3; SEED2 = ??? Variables and constants for SEED2 seem to include SEED2, SEED1, 0x6C078965, and 0x5D588B65. RNG advancements when forcing SEEDs to certain values. 00000000 00000000 00269EC3 00000000 55AE9CB2 7188D00C A0C3B2FD 0AF528D3 C910A194 0A8B4E34 00000001 00000000 6C2E2828 5D588B65 5AF1DE8B E3B543E4 0B78CE9A 3D7FCA1A CB968B85 3FE714A2 00000000 00000001 00269EC3 6C078965 55AE9CB2 76CC11E5 A0C3B2FD 75AA4470 C910A194 0D113825 AR codes to modify RNG variables and constants to try to crack formula. 02216084 00000001 02216088 00000000 0221608C 00000001 02216090 00000001 02216094 00000000 |
|
|
|
|
|
|
#327 |
|
free agent
![]() ![]()
Administrator
Join Date: Jun 2008
Posts: 3,045
|
Some things that might help:
Regarding seed 2 and the constant 0x5D588B65: It looks like it's a hash function. http://blogs.msdn.com/b/ricom/archiv...good-hash.aspx Regarding seed 1: 0x6C078965 used to be part of the old ARNG. It really looks like this is just another LCRNG with new constants. I used the researcher function in RNG Reporter and plugged in your new constants and got the same results that you did when you forced the seed. Regarding something I found a few days ago: Check out the routine at 02019B7A. It's the old LCRNG, but I didn't see where it actually stored the value. Everything came in and out through registers and without a debugger I could not get a handle on where / when it was called.
__________________
|
|
|
|
|
|
#328 | |
|
Join Date: Dec 2006
Posts: 224
|
Quote:
The encryption routine: http://www.projectpokemon.org/wiki/P...ure#Encryption |
|
|
|
|
|
|
#329 |
|
free agent
![]() ![]()
Administrator
Join Date: Jun 2008
Posts: 3,045
|
Cool, that makes me feel like that code has a reason that doesn't necessarily have anything to do with pokemon generation. Oddly enough, that makes me feel better.
Do you think it might be worthwhile for me to quickly release an rng reporter with a method for "SEED1 = (0x6C078965 * SEED1) + 0x00269EC3" so that we can do a quick check to see if we can find a captured pokemon?
__________________
|
|
|
|
|
|
#330 |
|
sometimes experimentation begins with "let's multi battle strip pokémon"
![]() ![]() ![]()
Moderator
Join Date: Aug 2006
Posts: 3,691
|
Both seeds are used to generated egg PIDs. I kept Seed1 constant and got changing PIDs, Seed2 constant and got changing PIDs, and when I kept both constant I got a static PID.
Code:
Seed1 Seed2 PID 0x0 0x0 C0AAEBC6 0x0 0x1 5878F4C3 0x1 0x0 5878F4C3 0x1 0x1 539702A7 Unfortunately, the egg IVs seem to be coming from some other RNG, one that's constantly changing in the background. I'll need some more testing to see if it advances "Emerald fast" or not. A few notes: - The game does not load if the time recorded at the last save matches the time when you reload the game. You'd have to re-save at a different time. - The egg PIDs are loaded into memory location 02234BA4 (White) when generated. I've confirmed this several times, and it spares the trouble of checking the save files under PokeGen. |
|
|
|
|
|
#331 |
|
Join Date: Dec 2006
Posts: 224
|
Seems like i was wrong early, it is a 64bit seed, and the formula for advancing is.
Code:
OFFSETS BLACK (add 0x20 to offset for white) 02216084 = SEED 0221608C = 0x5D588B656C078965 02216094 = 0x0000000000269EC3 SEED = (0x5D588B656C078965 * SEED) + 0x0000000000269EC3; Also the PID was 0A8A4E34. I think I rember seeing somthing on that one site mingot linked earlyer about XORing something by 0x10000 I think it was the PID, cause the PID seems to be the 32bit high of the 4th RNG call (0A8B4E34C910A194) XOR'd to 0x10000. 0000000000000000 0000000000269EC3 7188D00C55AE9CB2 0AF528D3A0C3B2FD 0A8B4E34C910A194 |
|
|
|
|
|
#332 | |
|
sometimes experimentation begins with "let's multi battle strip pokémon"
![]() ![]() ![]()
Moderator
Join Date: Aug 2006
Posts: 3,691
|
Quote:
EDIT: Actually, I kinda did. 06F2A159, one of the upper 32 bits, when XOR'd with 0x10000 is 06F3A159. Add 80000000 and you get the PID result. Code:
RNG calls with Sweet Scent: 00000000 00000000 00000000 00269ec3 7188D00C 55AE9CB2 0AF528D3 A0C3B2FD 0A8B4E34 C910A194 C83FB970 153A9227 0C45453A 2B8A2726 CC28FE89 36A566C1 22967565 4EAC71E8 38C7575F 507CB74B 67795501 267F125A C0AAEBC7 A9910645 06F2A159 CA9C04FC <-- probably where the PID came from, with some modification C9E3DDA4 E143722F 08D1DD28 EB26D24E <-- PID was definitely generated just before here 94CB488B 35255589 9D847485 1566AED0 36360093 ECE6E6D3 8B8FEA14 5C8B9B02 6493EA8F 4E3CD88D 46DD090E D5E68364 <-- RNG value at the battle start Code:
U32 L32 PID 0x0 0x0 10000 0x1 0x0 EC068965 0x0 0x1 DD598B65 0x1 0x1 496114CA 0x10000 0x10000 94CB6C07 0x0 0x10000 8BCB6C07 0x10000 0x0 09640000 0x10000 0x1 E6BC8B65 0x1 0x10000 776DF56C Some additional notes: - The PID is stored at 02259DA0, 0225A410, - Nature is no longer linked to PID in 5th gen. I'll have to test to see if the nature comes off the same RNG as the PIDs. |
|
|
|
|
|
|
#333 |
|
Join Date: Dec 2006
Posts: 224
|
I know the nature is in the RNG at 02216084 cause it is always the same for a certain SEED. Still haven't figured out wall call its from though.
Also the Sweet Scent PID might just be XOR'd to 0x80010000 also I noticed Code:
0x0 0x0 1000 |
|
|
|
|
|
#334 | |
|
sometimes experimentation begins with "let's multi battle strip pokémon"
![]() ![]() ![]()
Moderator
Join Date: Aug 2006
Posts: 3,691
|
Tested with an initial seed of 0x100000000 and got a PID of 28F7922A.
Code:
RNG value 0 100000000 1 6C07896500269EC3 2 76CC11E555AE9CB2 3 75AA4470A0C3B2FD 4 D113825C910A194 5 82DDFE85153A9227 6 1F41C3832B8A2726 7 A95AE25636A566C1 8 D0C90A464EAC71E8 9 28F7D24507CB74B 10 4409A8BA267F125A 11 5878F4C4A9910645 12 28F6922ACA9C04FC 13 1308B919E143722F 14 FA010F51EB26D24E Quote:
Code:
U32 L32 PID Next RNG # XOR'd with 0x0 0x0 10000 0 10000 0x1 0x0 EC068965 6C078965 80010000 0x0 0x1 DD598B65 5D588B65 80010000 0x1 0x1 496114CA C96014CA 80010000 0x10000 0x10000 94CB6C07 14CA6C07 80010000 0x0 0x10000 8BCB6C07 8B656C07 AE0000 0x10000 0x0 O9640000 89650000 80010000 0x10000 0x1 E6BC8B65 E6BD8B65 10000 0x1 0x10000 776DF56C F76CF56C 80010000 The fluctuating IVs just might've been a side effect of not disabling the codes I used, like Kazo said. Also: the C-Gear advances the RNG at a slow and steady rate, probably once every 1 to 1.5 seconds, but needs further confirmation on an actual cart. |
|
|
|
|
|
|
#335 |
|
Join Date: Oct 2009
Posts: 190
|
I'm in front of Victini right now, can I help you guys on something? I didn't know that it respawns everytime I defeat it and I enter the room again.
|
|
|
|
|
|
#336 |
|
blatant Nintendo fanboy
Join Date: Mar 2009
Posts: 4,323
your mom sucked at e3
|
Yeah, echoing the guy above. I got my cart in. What could I do to help you guys? What do you mean by confirmation on an actual cart?
__________________
|
|
|
|
|
|
#337 |
|
Join Date: Nov 2009
Posts: 1,254
in the beehive
|
Echoing the previous two posters. I also have my retail game in (Black) so if you need any testing done, let me know.
__________________
Visit my thread to read my RNG Noob Guides. |
|
|
|
|
|
#338 |
|
sometimes experimentation begins with "let's multi battle strip pokémon"
![]() ![]() ![]()
Moderator
Join Date: Aug 2006
Posts: 3,691
|
Right now, nobody can help with an actual cart until we figure out a way for people to find out their initial seed. We don't even know how it's being calculated; all we about it is from a Japanese blog, and all the author knows is that it somehow involves date\time and the MAC address unique to that DS.
|
|
|
|
|
|
#339 |
|
Remodeling Kitchens
![]()
Join Date: Apr 2009
Posts: 758
Berkeley, CA
|
If you are looking for the MAC address of the DS, you can check it while in game via the C-Gear.
...
some other RNG observations (on White) to look over, I can't analyze this to the depth you guys can ;). Don't take it as 100% true, I could have messed up writing something down (did this 2 weeks ago)
...
|
|
|
|
|
|
#340 |
|
Join Date: Nov 2009
Posts: 1,254
in the beehive
|
Something I've noticed about breeding in B/W: Saving in front of the Day Care Man when he has an egg does not guarantee the same nature or gender. I have tested multiple times with the same save position while standing in front of the Day Care Man while he's holding an egg. I've gotten different natures and different genders on the supposedly same egg. Perhaps this is already known or has been discussed elsewhere on the forum, but I'm making a note of it here for anyone looking at the research thread with breeding min mind.
__________________
Visit my thread to read my RNG Noob Guides. |
|
|
|
|
|
#341 |
|
Remodeling Kitchens
![]()
Join Date: Apr 2009
Posts: 758
Berkeley, CA
|
Pieced it all together now. Go ahead and read!
----- Did some testing for memory locations of egg PIDs. White, C-Gear off. Frame @022160A4(8) advances fairly fast at the daycare man.
lolresearch
Summary: [WHITE] Code:
Egg PIDs are based off of a 022160A8 Value, exactly the same -1. Thus they are based off of the frame, and are not set upon "generation". 0223EBFC stores the PID generated for eggs after you confirm yes. It changes after certain in game interactions.
edit: the other place
|
|
|
|
|
|
#342 |
|
Remodeling Kitchens
![]()
Join Date: Apr 2009
Posts: 758
Berkeley, CA
|
Did a little bit of observational research using a memory analysis with cheat engine to get some opcodes and memory locations.
observations + opcodes Using the new Cheat Engine 5.6.1
other things I have noticed about PID locations:
dumped PID locations to check PID on encounter
When the game freezes you and starts the battle scene (after any encounter text), the PID for the Pokemon is already set (as in gen 4) |
|
|
|
|
|
#343 |
|
sometimes experimentation begins with "let's multi battle strip pokémon"
![]() ![]() ![]()
Moderator
Join Date: Aug 2006
Posts: 3,691
|
Zoroark's PID is stored in 0225DE74 and 0225D804 when you encounter it.
At this point we can manipulate the RNG for shininess on most Pokemon, though IVs are off the table. The PID is derived directly from the upper 32 bits of one of the main RNG results, but in most cases it is modified as follows:
...
IVs are generated by a separate RNG, the same Mersenne Twister used for generating egg PIDs last gen. (Or so says one Japanese blog on RNG research.) We don't know how it's seeded, so we don't have much control at this time. We've found through trial and error that advancing the main RNG by walking in an area with wild Pokemon does not advance the RNG for IVs. However the C-Gear does, at a steady rate. So with LOTS of trial and error I could get the IVs I wanted, turn off the C-Gear to lock them in, and then advance the main RNG to the point I got a shiny Pokemon. The Pokemon would then have the IVs I wanted. But for all of this, I would need an emulator to watch the RNG, and to use save states to see which IVs were locked in. tl;dr: We can control shininess on an emulator, but getting good IVs is still just a lot of trial and error. However, at least we can get decent and\or shiny Pokemon that should pass the Wi-Fi and VGC hack checks. NOTE: I'd like to remind readers that any Pokemon generated through an emulator must be VERY clearly labeled if you plan on trading them here on the Wi-Fi boards. This label must stick even if you receive the Pokemon in a trade and are allowed to redistribute them, no Pokélaundering. |
|
|
|
|
|
#344 |
|
Remodeling Kitchens
![]()
Join Date: Apr 2009
Posts: 758
Berkeley, CA
|
Egg PIDs are based off of a 022160A8 Value, exactly the same, but -1. I tested with a female parent having a dream world ability flagged. This might influence it just like international Dittos did in gen 4.
They aren't based off of the 022160A8 value at the point the egg is received, it's based off of another value from that place further down the line. ctrl F in my egg Hide: Start [39FA5BBB] / Rapid [F888399E] The pattern I noticed:
...
other stationary legends to test for PID locations that you can get to after the elite four: Birijion Kobaruon Terakion (the trio) [I'll be finding these and updating this post later today] Randorosu |
|
|
|
|
|
#345 | |
|
sometimes experimentation begins with "let's multi battle strip pokémon"
![]() ![]() ![]()
Moderator
Join Date: Aug 2006
Posts: 3,691
|
Quote:
Zekrom\Reshiram - 2 advances Sweet Scent in cave - 4 advances Sweet Scent in (normal) grass - 12 advances |
|
|
|
|
|
|
#346 | |
|
Remodeling Kitchens
![]()
Join Date: Apr 2009
Posts: 758
Berkeley, CA
|
Quote:
---------- Looked for more PID locations upon encountering the Pokemon, did some seed freezing as well
long code wrapped
The memory locations for Party PIDs are insanely useful with RAM Watch or with Cheat Engine to get a PID to find other locations. Going to test freezing of the upper seed (022160A8) and its effects on the egg PID. --- Tested Seed relationships to the PID Stated at the man with Yes/No, no C-Gear, stable seeds. Code:
Pressed yes, Received egg. Froze the 2 seeds, and rewound to the previous state. Pressed yes, Received egg. Froze the 2 seeds, and rewound the previous state. Basically I just set my own values for the RNG. Got different PIDs every time. Did it again but only froze the 2nd seed. Different PIDs every time. Setting the rapid location [02234BA4 (White)] to 01010101 for lols resulted in blue screen errors rarely when I reloaded the state fast enough so the game could not update other locations related to it. |
|
|
|
|
|
|
#347 |
|
Remodeling Kitchens
![]()
Join Date: Apr 2009
Posts: 758
Berkeley, CA
|
Did some memory location lookings with the new Mystery Gift Wondercards from the 10/10/2010 Event.
PIDs generated for Mystery Gift/Wondercards are stored at: (White)
-------------- Also, recapping Party/PC Box PID locations (other data is encrypted) for those who want to check without saving.
Party PID Locations (White)
Box PID Locations (White)
Other data is still encrypted, so you can't view the IVs in a specific location. -------------- Mystery Gift IVPID/Nature Generation Patterns
lolresearch
Summary of Mystery Gift IVNPID Patterns:
oh lawd legality issues
|
|
|
|
|
|
#348 |
|
Remodeling Kitchens
![]()
Join Date: Apr 2009
Posts: 758
Berkeley, CA
|
Looked back at my Egg PID generation notes, and remembered that SEED1's advancement was already known. I added in the missing frames that the game didn't show me, and I arrived at this pattern for every egg I generated:
Mind you this was with a female parent with a Dream World ability, if that possibly had any influence. I can check to see without. Code:
Frame 0 -- Starting SEED1/SEED2 (Frame) Frame 1 -- Not Displayed (SEED2's would be value appears in 0223EBFC) Frame 2 -- Shown in SEED1 and SEED2 Frame 3 -- Never Displayed Frame 4 -- Shown in SEED1 and SEED2 Frame 5 -- Never Displayed Frame 6 -- Never Displayed Frame 7 -- Never Displayed Frame 8 -- Never Displayed Frame 9 -- Never Displayed Frame 10 -- Never Displayed Frame 11 -- Shown in SEED1 SEED1 and (SEED2)------------\ Frame 12 -- Shown in SEED1 and SEED2 | -- ^^^Ending Frame -> Egg has been generated! | .-----------------------------------/ PID = Frame 11's [SEED2-00000001] International Breeding follows a different generation pattern. Still testing. Taken from a different frame, same XOR (0x1). PID is stored at 0233EFBC, like DW Breeding. So far the pattern is not constant. International Breeding relies on some other value that is separate from the RNG but is not the IRNG(IV). Freezing to different values from one seed to another produces one pattern, while starting at the same one without codes produces a different pattern. The patterns contradicted eachother, so it's not exclusively calculated from the RNG/IRNG only. --- Wondercards still have a shiny check. I found the SID location of the new Wondercard file standard and changed the SID to make it shiny based off of a seed spread I already knew (the one I tested with). Since the PID is Initial Frame 0's Frame 32 upper half XOR'd with 0x10000, if it comes out shiny it is then XOR'd with 0x10000000 to become nonshiny. The only available gift wondercards are of random non-Dream World Abilities. In the data for the card there are flags for what the ability should be. Since there are restrictions on ability based on PID, there must be some limit on the results for the PID if it is a set ability. ----- Passive Seed Advancement while Breeding: Other than the set path Moving Pokemon, there are 5 moving NPCs with a non-set path in the area that advance the frame. (one in top left corner, one girl in the play area, 1 man in grass, 1 girl in the lower half of the route, girl on the bridge) |
|
|
|
|
|
#349 |
|
sometimes experimentation begins with "let's multi battle strip pokémon"
![]() ![]() ![]()
Moderator
Join Date: Aug 2006
Posts: 3,691
|
I've just located the lookup table generated by the Mersenne Twister RNG. It starts at 022151D4 and ends at 02215B90 (in White).
The very first 32-bit value in that table is the seed used to generate IVs. Plug that seed into RNG Reporter's Researcher feature, set it to right-shift the result 27 bits, and the next six values are the IVs of the next Pokemon you catch. ![]() Once I figure out a way to advance this RNG, we can catch flawless and\or shiny Pokemon that pass Wi-Fi and VGC hack checks - on an emulator. (Not sure about breeding yet, but it should be a lot easier.) The big challenge is still figuring out how the initial seeds are generated. Without that info, it won't be possible to manipulate the RNG on a cartridge. |
|
|
|
|
|
#350 |
|
blatant Nintendo fanboy
Join Date: Mar 2009
Posts: 4,323
your mom sucked at e3
|
Actually, as long as we can determine what seed we happen to have hit, with enough patience (especially if advancement is anything like 4th Gen) we'd be able to look down the list and abuse for acceptable IVs/nature on non-breedables. In my experience with FR/LG abuse, that's basically what we had to do. It's not as nice as being able to hit any seed you choose, but it's usable. Is there any way to figure out what seed you happen to have hit yet? Kind of like the Seed finder in Gen 4?
__________________
|
|
|
|
![]() |
| Tags |
| NULL |
| Thread Tools | |
|
|