Beispiel #1
0
        internal static void Main(string[] args)
        {
            const bool preferGPU = true;
            const bool saveSeed  = true;

            Console.Title = "[lichess] seed crack by TaDazh";

            long   seed      = -1;
            bool   crackSeed = true;
            string seedFile  = Path.Combine(Environment.CurrentDirectory, "seed.bin");

            if (File.Exists(seedFile))
            {
                string seedContents = File.ReadAllText(seedFile);
                if (long.TryParse(seedContents, out seed))
                {
                    crackSeed = false;
                }
            }

            if (crackSeed)
            {
                seed = CrackSeed(preferGPU);
                if (saveSeed)
                {
                    File.WriteAllText(seedFile, seed.ToString());
                }
            }

            Cracker cracker = new Cracker(0x5DEECE66DL, 0xBL);

            Console.Write("Id:");
            string gameId = Console.ReadLine();

            string whiteId = null, blackId = null;

            if (gameId.Length == 8)
            {
                cracker.GetPlayerIdsForward(seed, gameId, out whiteId, out blackId, 5);
                if (whiteId == null || blackId == null)
                {
                    cracker.GetPlayerIdsBackward(seed, gameId, out whiteId, out blackId, 5);
                }
            }
            else
            {
                Console.WriteLine("\"{0}\" is not a gameid.", gameId);
                Console.WriteLine("Press any key to exit.");
                Console.ReadKey();
                return;
            }

            if (whiteId == null || blackId == null)
            {
                Console.WriteLine("\"{0}\" was not producable.", gameId);
                Console.WriteLine("1) Lichess has a new seed.");
                Console.WriteLine("2) The id suplied was not from a lobby game.");
                Console.WriteLine("Press any key to exit.");
                Console.ReadKey();
                return;
            }

            Console.WriteLine("White = {0}{1}", gameId, whiteId);
            Console.WriteLine("Black = {0}{1}", gameId, blackId);
            Console.WriteLine("Press any key to exit.");
            Console.ReadKey();
        }