Esempio n. 1
0
        private static IEnumerable <uint> GetSeedsFromPID(RNG method, uint a, uint b)
        {
            uint cmp = a << 16;
            uint x   = b << 16;

            for (uint i = 0; i <= 0xFFFF; i++)
            {
                var seed = x | i;
                if ((method.Next(seed) & 0xFFFF0000) == cmp)
                {
                    yield return(method.Prev(seed));
                }
            }
        }
Esempio n. 2
0
        private static IEnumerable <uint> GetSeedsFromIVs(RNG method, uint a, uint b)
        {
            uint cmp = a << 16 & 0x7FFF0000;
            uint x   = b << 16 & 0x7FFF0000;

            for (uint i = 0; i <= 0xFFFF; i++)
            {
                var seed = x | i;
                if ((method.Next(seed) & 0x7FFF0000) != cmp)
                {
                    continue;
                }
                var prev = method.Prev(seed);
                yield return(prev);

                yield return(prev ^ 0x80000000);
            }
        }