Ejemplo n.º 1
0
        private void Button_Click_1(object sender, RoutedEventArgs e)
        {
            DecrypterRange range = new DecrypterRange(MD5Decrypter.CharRange.Length);

            int max = Convert.ToInt32(txtb_max.Text);
            int min = Convert.ToInt32(txtb_min.Text);

            int i;
            int[] array = new int[min];

            for(i = 0; i < min; i++)
                array[i] = 0;

            range.setStartRange(array);
            array = new int[max];

             for(i = 0; i < max; i++)
                 array[i] = MD5Decrypter.CharRange.Length;

             range.setEndRange(array);

             r = new runner(txtb_findhash.Text, range);
            t = new Thread(new ThreadStart(r.Run));

            //t.SetApartmentState(ApartmentState.STA);
            t.Start();
        }
Ejemplo n.º 2
0
        public DecrypterRange Clone()
        {
            DecrypterRange range = new DecrypterRange(startRange, endRange, charCount);
            range.currentRange = currentRange;

            return range;
        }
Ejemplo n.º 3
0
        public ulong Next()
        {
            uint[] current = currentRange;
            int    i;

            for (i = currentRange.Length - 1; i >= 0; i--)
            {
                currentRange[i]++;

                if (currentRange[i] < charCount)
                {
                    break;
                }
                else
                {
                    currentRange[i] = 0;

                    if (i == 0)
                    {
                        uint[] newRange = new uint[currentRange.Length + 1];
                        newRange[0] = 0;

                        int j = 1;
                        foreach (uint cr in currentRange)
                        {
                            newRange[j++] = cr;
                        }

                        currentRange = newRange;
                    }
                }
            }

            return(DecrypterRange.GetNumber(currentRange));
        }
Ejemplo n.º 4
0
        public DecrypterRange Clone()
        {
            DecrypterRange range = new DecrypterRange(startRange, endRange, charCount);

            range.currentRange = currentRange;

            return(range);
        }
Ejemplo n.º 5
0
        public void Setup(string hash, DecrypterRange decrypterRange)
        {
            this.Hash = hash;

            ProcessingManager.Instance.InitBlocks(decrypterRange);
            ConnectionManager.Instance.Broadcast(new InitBlocksPacket(hash, decrypterRange));
            ProcessingManager.Instance.Crack(Hash);
        }
Ejemplo n.º 6
0
        public void InitBlocks(DecrypterRange range)
        {
            this.range = range;
            ulong length = range.GetNumber();

            blocks.Clear();
            BlockSize = length / Convert.ToUInt64(1000 * range.endRange.Length);

            for (ulong plus = 0, id = 0; plus <= length; plus += BlockSize, id++)
                blocks.Add(new ProcessBlock(id, BlockState.Free));

            Random rnd = new Random();
            blocks = blocks.OrderBy(item => rnd.Next()).ToList<ProcessBlock>();

            Initialized = true;
        }
Ejemplo n.º 7
0
        public void InitBlocks(DecrypterRange range)
        {
            this.range = range;
            ulong length = range.GetNumber();

            blocks.Clear();
            BlockSize = length / Convert.ToUInt64(1000 * range.endRange.Length);

            for (ulong plus = 0, id = 0; plus <= length; plus += BlockSize, id++)
            {
                blocks.Add(new ProcessBlock(id, BlockState.Free));
            }

            Random rnd = new Random();

            blocks = blocks.OrderBy(item => rnd.Next()).ToList <ProcessBlock>();

            Initialized = true;
        }
Ejemplo n.º 8
0
        public BlockProcessPacket2(DecrypterRange decryRange)
            : base((ushort)(HeaderSize + (3 * sizeof(uint)) + (decryRange.startRange.Length * sizeof(uint) + decryRange.endRange.Length * sizeof(uint) + decryRange.currentRange.Length * sizeof(uint))), 6)
        {
            this.DecryRange = decryRange;
            endOffset = (uint)decryRange.startRange.Length;
            currentOffset = (uint)(endOffset + decryRange.endRange.Length);

            WriteUInt(decryRange.charCount, HeaderSize);
            WriteUInt(endOffset, HeaderSize + sizeof(uint));
            WriteUInt(currentOffset, HeaderSize + 2 * sizeof(uint));

            int counter = 0;
            foreach (uint value in decryRange.startRange)
                WriteUInt(value, HeaderSize + counter++ * sizeof(uint));

            foreach (uint value in decryRange.endRange)
                WriteUInt(value, HeaderSize + counter++ * sizeof(uint));

            foreach (uint value in decryRange.currentRange)
                WriteUInt(value, HeaderSize + counter++ * sizeof(uint));
        }
Ejemplo n.º 9
0
 public ulong GetCurrentNumber()
 {
     return(DecrypterRange.GetNumber(currentRange));
 }
Ejemplo n.º 10
0
 public ulong GetNumber()
 {
     return(DecrypterRange.GetNumber(endRange));
 }
Ejemplo n.º 11
0
        public void Setup(string hash, DecrypterRange decrypterRange)
        {
            this.Hash = hash;

            ProcessingManager.Instance.InitBlocks(decrypterRange);
            ConnectionManager.Instance.Broadcast(new InitBlocksPacket(hash, decrypterRange));
            ProcessingManager.Instance.Crack(Hash);
        }
Ejemplo n.º 12
0
 public runner(string hash, DecrypterRange range)
 {
     dec = new MD5Decrypter(hash, range);
 }
Ejemplo n.º 13
0
 public void ProcessHash(string hash, DecrypterRange range)
 {
     InitBlocks(range);
 }
Ejemplo n.º 14
0
 public void ProcessHash(string hash, DecrypterRange range)
 {
     InitBlocks(range);
 }
Ejemplo n.º 15
0
 public BlockProcessPacket(DecrypterRange range)
     : base((ushort)(HeaderSize + GenericSerializer.GetByteLength(range)), 6)
 {
     this.Range = range;
 }
Ejemplo n.º 16
0
        private void Test_Click(object sender, RoutedEventArgs e)
        {
            ulong value = ulong.Parse(txtb_value.Text);
            uint r = Convert.ToUInt32(MD5Decrypter.CharRange.Length);
            DecrypterRange range = new DecrypterRange(new uint[] { 0, 0, 0, 0 }, new uint[] { r, r, r, r, r, r, r, r }, r);

            range.Plus(value);

            foreach (int i in range.currentRange)
            {
                txtb_text.Text += i + ",";
            }
            txtb_text.Text += "\n";
        }
Ejemplo n.º 17
0
 private void Button_Click_1(object sender, RoutedEventArgs e)
 {
     DecrypterRange range = new DecrypterRange(Convert.ToUInt64(test_blockid.Text), Convert.ToUInt64(test_blocksize.Text), Convert.ToUInt32(test_charCount.Text));
 }
Ejemplo n.º 18
0
 public MD5Decrypter(string hash, DecrypterRange range)
 {
     this.Hash  = hash;
     this.Range = range;
     md5        = MD5.Create();
 }
Ejemplo n.º 19
0
        static void Main(string[] args)
        {
            var cm = ConnectionManager.Instance;

            cm.ProblemReportEvent += cm_ProblemReportEvent;
            cm.ClientConnected += cm_ClientConnected;
            Console.ForegroundColor = ConsoleColor.White;

            Console.WriteLine("-- @help para lista de commandos\n\n");

            while (true)
            {
                Color(ConsoleColor.Gray);
                Console.Write("@");
                Color(ConsoleColor.Green);

                string command = Console.ReadLine();

                if (command.Contains("connect"))
                {
                    string[] param = command.Split(' ');

                    try
                    {
                        cm.Connect(param[1], Convert.ToInt32(param[2]));
                        ColorMessage("Connectando em " + param[1] + ".", ConsoleColor.DarkYellow);
                    }
                    catch (SystemException e)
                    {
                        Color(ConsoleColor.Red);
                        Console.WriteLine("Use: connect <IP> <Porta>\n" + e.Message);
                        continue;
                    }
                }
                else if (command.Contains("send"))
                {
                    command += "\\";
                    string[] param = command.Split('\\');

                    try
                    {
                        cm.Broadcast(new MessagePacket(param[1]));
                    }
                    catch (SystemException e)
                    {
                        Console.WriteLine("Use: send <msg>\n" + e.Message);
                        continue;
                    }
                }
                else if (command.Contains("listen"))
                {
                    string[] param = command.Split(' ');

                    try
                    {
                        cm.Start(Convert.ToInt32(param[1]), 100);
                        ColorMessage("Escutando conexões na porta " + param[1], ConsoleColor.DarkYellow);
                    }
                    catch (SystemException e)
                    {
                        ColorMessage("Use: listen <Porta>\n" + e.Message, ConsoleColor.Red);
                        continue;
                    }
                }
                else if (command.Contains("debug"))
                {
                    DecrypterRange range = new DecrypterRange(0, 1000, 70);

                    var bytes = GenericSerializer.GetBinary(range);

                    var drange = GenericSerializer.GetObject<DecrypterRange>(bytes);
                }
                else
                {
                    ColorMessage("Comando Inválido", ConsoleColor.Red);
                }
            }
        }