Exemplo n.º 1
0
        public static bool TryGetAllProcessMemoryBytes(Process process, out byte[] memory)
        {
            List <byte> allBytes = new List <byte>();

            try
            {
                //for (int i = 0; i < 2147483647; i++)
                //{
                IntPtr pointer   = (process.MainModule.BaseAddress + 3736);
                uint   BytesRead = 0;
                byte[] toRead    = TcpHelper.Read(process.Handle, pointer, 20480, ref BytesRead);
                allBytes.AddRange(toRead);
                //}
                memory = allBytes.ToArray();
                return(true);
            }
            catch (Exception ex) { mainForm.WriteLine("ER" + ex.Message); }
            memory = null;
            return(false);
        }