Exemple #1
0
        private bool DoubleThreadBruteForce(byte[] Script)
        {
            Thread T1 = new Thread(() =>
            {
                uint[] Key  = new uint[0];
                bool Sucess = RLD.FindKey(Script, out Key);
                if (Sucess)
                {
                    this.Key = Key;
                }
            });

            T1.Start();

            uint Dots = 2;

            while (T1.IsAlive)
            {
                Application.DoEvents();
                Thread.Sleep(400);
                Dots++;
                if (Dots == 3)
                {
                    Dots = 0;
                }
                switch (Dots)
                {
                case 0:
                    Text = "Finding Key.   |" + RLD.FindProgress;
                    break;

                case 1:
                    Text = "Finding Key..  |" + RLD.FindProgress;
                    break;

                default:
                    Text = "Finding Key... |" + RLD.FindProgress;
                    break;
                }
            }

            if (Key.Length == 0)
            {
                return(false);
            }
            return(true);
        }
Exemple #2
0
        private bool DoubleThreadBruteForce(byte[] Script)
        {
            Thread T1 = new Thread(() => {
                uint Key    = 0;
                bool Sucess = RLD.FindKey(Script, out Key, false);
                if (Sucess)
                {
                    this.Key = Key;
                }
                else
                {
                    Key = uint.MaxValue;
                }
            });
            Thread T2 = new Thread(() => {
                uint Key    = 0;
                bool Sucess = RLD.FindKey(Script, out Key, true);
                if (Sucess)
                {
                    this.Key = Key;
                }
                else
                {
                    Key = uint.MaxValue;
                }
            });

            T1.Start();
            T2.Start();
            uint t    = 400;
            uint Dots = 2;

            while (Key == 0)
            {
                Application.DoEvents();
                Thread.Sleep(100);
                t -= 100;
                if (t <= 0)
                {
                    t = 400;
                    Dots++;
                    if (Dots == 3)
                    {
                        Dots = 0;
                    }
                    switch (Dots)
                    {
                    case 0:
                        Text = "Finding Key.";
                        break;

                    case 1:
                        Text = "Finding Key..";
                        break;

                    default:
                        Text = "Finding Key...";
                        break;
                    }
                }
            }
            if (T1.IsAlive)
            {
                T1.Abort();
            }
            if (T2.IsAlive)
            {
                T2.Abort();
            }
            if (Key == uint.MaxValue)
            {
                return(false);
            }
            return(true);
        }