Exemplo n.º 1
0
 private void RefreshMemory(int RowIndex)
 {
     ThreadEventDispatcher.CurrentSelectedProcess = Processes.Text.Split('|')[0];
     MemoryDispatch MemoryDispatch = new MemoryDispatch();
     MemoryDispatch.Row = RowIndex;
     MemoryDispatch.TextAddress = (string)ValuesGrid[1, RowIndex].Value;
     MemoryDispatch.Type = DataTypeExactTool.GetValue((string)ValuesGrid[3, RowIndex].Value);
     ThreadEventDispatcher.RefreshValueAddresses.Enqueue(MemoryDispatch);
 }
        internal void ThreadEventDispatcher()
        {
            while (true)
            {
                if (DispatchConnect)
                {
                    DispatchConnect = false;
                    DoConnect();
                }
                if (DispatchOpenProcess)
                {
                    DispatchOpenProcess = false;
                    DoOpenProcess();
                }
                if (DispatchSearch)
                {
                    DispatchSearch = false;
                    DoSearch();
                }
                if (DispatchConfig)
                {
                    DispatchConfig = false;
                    DoConfig();
                }
                if (DispatchImport)
                {
                    DispatchImport = false;
                    DoImport();
                }
                if (DispatchPointerSearch != null)
                {
                    string TempAddress = DispatchPointerSearch;
                    DispatchPointerSearch = null;
                    DoPointerSearch(TempAddress);
                }
                while (RefreshValueAddresses.Count > 0)
                {
                    MemoryDispatch Row = new MemoryDispatch();
                    RefreshValueAddresses.TryDequeue(out Row);
                    uint Address;

                    if (HexRegex.IsMatch(Row.TextAddress))
                    {
                        Address = BitConverter.ToUInt32(Utilities.GetByteArrayFromByteString(Row.TextAddress).Reverse().ToArray(), 0); ;
                    }
                    else
                    {
                        Match TopMatch = ParserRegex.Match(Row.TextAddress);

                        if (!TopMatch.Success)
                        {
                            return;
                        }

                        Address = ResolvePointer(TopMatch);
                    }

                    if (Form.IsValidMemoryAddress(Address))
                    {
                        Row.ResolvedAddress = Utilities.GetStringFromByteArray(BitConverter.GetBytes(Address).Reverse().ToArray());
                        Row.Value = GetMemoryAtAddress(CurrentSelectedProcess, Address, Row.Type);
                        RefreshValueReturn.Enqueue(Row);
                    }
                }
                while (WriteAddress.Count > 0)
                {
                    MemoryDispatch Row = new MemoryDispatch();
                    WriteAddress.TryDequeue(out Row);
                    uint Address;

                    if (HexRegex.IsMatch(Row.TextAddress))
                    {
                        Address = BitConverter.ToUInt32(Utilities.GetByteArrayFromByteString(Row.TextAddress).Reverse().ToArray(), 0); ;
                    }
                    else
                    {
                        Match TopMatch = ParserRegex.Match(Row.TextAddress);

                        if (!TopMatch.Success)
                        {
                            return;
                        }

                        Address = ResolvePointer(TopMatch);
                    }

                    if (Form.IsValidMemoryAddress(Address))
                    {
                        Row.ResolvedAddress = Utilities.GetStringFromByteArray(BitConverter.GetBytes(Address).Reverse().ToArray());
                        uint ProcessID = BitConverter.ToUInt32(Utilities.GetByteArrayFromByteString(CurrentSelectedProcess.Split('|')[0]), 0);
                        Form.NTRConnection.SendWriteMemoryPacket(ProcessID, Address, Row.Value);
                    }
                }

                Thread.Sleep(100);
            }
        }
Exemplo n.º 3
0
        private void SetMemory(int RowIndex)
        {
            string TextAddress = (string)ValuesGrid[1, RowIndex].Value;

            MemoryDispatch MemoryDispatch = new MemoryDispatch();
            MemoryDispatch.Row = RowIndex;
            MemoryDispatch.TextAddress = TextAddress;
            MemoryDispatch.Type = DataTypeExactTool.GetValue((string)ValuesGrid[3, RowIndex].Value);
            MemoryDispatch.Value = GetByteArrayForDataType(MemoryDispatch.Type, (string)ValuesGrid[2, RowIndex].Value);

            ThreadEventDispatcher.WriteAddress.Enqueue(MemoryDispatch);
        }