>>30953325I'm not too well informed on it, but here's my understanding:
When you breed two Magikarps, the game rolls for gender, nature, and nature inheritance, in this order. This last one only happens if both parents are holding an everstone. By observing the inherited nature, we can infer the least significant bit of the resulting number of the tempering function called by TinyMT. You might say we could observe gender instead, since it's also 50/50, but problems arise.
When rolling for gender, the game rolls a number between 0 and 252, then checks if the result is lesser than 126. Meaning, we don't have information on the least significant bit, but rather on the least significant byte. The everstone roll is 0 or 1 roll, meaning it is all about the least significant bit, making it the best choice for this method.
By rejecting an egg and doing the entire process again, we can infer the least significant bit from the next state of the current seed. Repeat this 126 times until you have the 127 consecutive least significant bits from the tempering function.
Since the internal state of the TinyMT PRNG consists of 127 bits, by solving a linear system of equations we can determine the original seed, given the TinyMT parameters. I'm not familiar at all with this process, or why it works. There's probably some documentation on it by some japs. Solving the system gives you your seed, which you should use for manipulating.
Notes:
TinyMT = Tiny Mersenne Twister
PRNG = Pseudo Random Number Generator
Tempering function = Function that takes the TinyMT's internal state, does crazy math and returns a number