BolterV2.ReflectMeBro.ReadMemory C# (CSharp) Method

ReadMemory() public method

public ReadMemory ( IntPtr hProc, IntPtr address, uint size ) : byte[]
hProc System.IntPtr
address System.IntPtr
size uint
return byte[]
        public byte[] ReadMemory(IntPtr hProc, IntPtr address, uint size)
        {
            var args = new object[3];
            args[0] = hProc;
            args[1] = address;
            args[2] = size;
            return (byte[]) ReadRemoteMemory.Invoke(null, args);
        }

Usage Example

Example #1
0
        private void Refresh(object sender, RoutedEventArgs e)
        {
            var ThePs = Process.GetProcessesByName("ffxiv");

            foreach (var process in ThePs)
            {
                var    hProc           = process.Handle;
                var    sigScam         = new SigScan(process, process.MainModule.BaseAddress + 0xFB9000, 0x14B000);
                byte[] playerStructSig = { 0x46, 0x69, 0x72, 0x65, 0x20, 0x53, 0x68, 0x61, 0x72, 0x64, 0x02, 0x13, 0x02, 0xEC, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00 };
                var    NamePtr         = sigScam.FindPattern(playerStructSig, "xxxxxxxxxxxxxxxxxxxx", -(int)process.MainModule.BaseAddress) - 0xC26;
                playerName =
                    Encoding.ASCII.GetString(_mapper.ReadMemory(
                                                 hProc, process.MainModule.BaseAddress + (int)NamePtr, 21).TakeWhile(p => p != 0).ToArray());

                var newimg = (ImageSource)CreateBitmapSourceFromBitmap(Properties.Resources.ffxiv);
                ProcessListBox.Items.Add(new ListImg(string.Format("{0}\nPID - {1}", playerName, process.Id), newimg));
            }

            foreach (var file in Directory.EnumerateFiles(Directory.GetCurrentDirectory()).Where(file => file.EndsWith(".dll")))
            {
                PluginsBox.Items.Add(new string(file.Skip(Directory.GetCurrentDirectory().Length + 1).ToArray()).Replace(".dll", ""));
            }
            PluginsBox.SelectedIndex     = 0;
            ProcessListBox.SelectedIndex = 0;
        }