Ejemplo n.º 1
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.º 2
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.º 3
0
        //public InitBlocksPacket(string hash, DecrypterRange range)
        //    : base((ushort)(HeaderSize + 32 + GenericSerializer.GetByteLength(range)), 5)
        //{
        //    this.Range = range;
        //    this.MD5Hash = hash;
        //}

        //public InitBlocksPacket(byte[] buf)
        //    : base((ushort)buf.Length, 5)
        //{
        //    this.MD5Hash = Encoding.UTF8.GetString(buf, HeaderSize, 32);
        //    this.Range = ReadObject<DecrypterRange>(buf, (HeaderSize + 32), buf.Length - (HeaderSize + 32));
        //}

        public InitBlocksPacket(string hash, DecrypterRange range)
        //: base((ushort)(1), 5)
        {
            var tmpdata = new InitBlocksData();

            tmpdata.Type  = 5;
            tmpdata.Hash  = hash;
            tmpdata.Range = range;

            buffer = new byte[GenericSerializer.GetByteLength(tmpdata)];
            PData  = tmpdata;
            WriteObject(PData, 0);
        }
Ejemplo n.º 4
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.º 5
0
 public BlockProcessPacket(byte[] buf)
     : base(buf)
 {
     Range = ReadObject <DecrypterRange>(buf, HeaderSize, buf.Length - HeaderSize);
 }
Ejemplo n.º 6
0
 public BlockProcessPacket(DecrypterRange range)
     : base((ushort)(HeaderSize + GenericSerializer.GetByteLength(range)), 6)
 {
     this.Range = range;
 }
Ejemplo n.º 7
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.º 8
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);
                }
            }
        }
Ejemplo n.º 9
0
 public runner(string hash, DecrypterRange range)
 {
     dec = new MD5Decrypter(hash, range);
 }