Jump to content

Neurophage

Member
  • Posts

    3
  • Joined

  • Last visited

Reputation

10 Good

About Neurophage

  • Birthday 08/26/1990
  1. I wanted to describe my problem as clearly as possible, and figured what better way than with a picture of a thousand words (and some hexadecimal numbers).
  2. So, I've finally wrapped my head around the Generation IV decryption algorithm. I knew that the best way to find the start of the party block was to just figure out my first party Pokémon's PID and then search for it in a hex editor; after a bit of frustration, I read that it was in little-endian. Having found it, I then needed to implement the PRNG to decrpyt the data, but I got snared pretty much near the start of my adventure by numbers that just seemed wrong. Here's my arithmetic and some pseudocode (with ints in place of hexadecimal numbers to better clarify my point): seed = 15665 // my checksum, of course prng: next = 1103515245 * seed + 24691; seed = next; return next; So, this is where I'm stuck. The first time I run prng(), it's going to return 17286566337616; it's big, but definitely feasible. Now, I'm supposed to return the first 16 bits of that, unless I completely misinterpreted. 17286566337616 = 0b111110111000110101111010010100000000000000000101110001010000 So, the first 16 bits are 1111101110001101; does this mean that the first time I run prng(), it should return 64397 and that I should use that value as seed when filling the next variable when I run it again? I completely understand recursively using the PRNG to decrypt each hex word; I just wanted to make sure I had my prng() function returning the proper values before confusing myself any further. Any helpful pointers, suggestions, or advice would be greatly appreciated.
  3. Pokesav doesn't seem to be open source, and a cursory Googling hasn't turned up much. Any assistance would be greatly appreciated.
×
×
  • Create New...