Closed sepalani closed 7 years ago
It's interesting to note that for all X, X % 0x80000000 == X & 0x7fffffff, and 0x80000000 is Diamond/Pearl's Z constant, so the results are identical! Every other game I tested seemed to work fine too, but I did mostly reverse the formula from data I observed. It's entirely possible that it's not the authentic formula.
Can you provide some examples of games for which it doesn't work?
Thanks for the tip! I've filed the issue under the right project and will make the fix as soon as I'm able to test that it doesn't break anything.
Could you also try to see if the presumably not encrypted games are actually encrypted using the above algorithm leading the encrypted data to be equal to the plain data?
Yeah, it checks out. Disabling encryption may not actually be a thing on version 2/3 requests, just epic fail RNG constants! (If the Z constant is a PoT of 65536 or less, encryption is fully gimped)
The wiki should be fixed now.
According to https://github.com/sepalani/GamestatsHTTP/wiki/Gamestats2-encryption and https://github.com/sepalani/GamestatsHTTP/commit/0a03ae8a7ca4fbc4ef7c0370b1ba69de67de3759 it seems that the seed is processed like this using a modulo:
And not like this:
@mm201 Could you confirm that this is the correct behaviour for these Pokémon DS games as well or maybe they are another special case?