示例#1
0
 public void CloseHandle()
 {
     if (ProcessMemoryReaderApi.CloseHandle(this.mhProcess) == 0)
     {
         throw new Exception("CloseHandle failed");
     }
 }
示例#2
0
        public void loadPointer(long address)
        {
            IntPtr ptr;

            byte[] buffer = new byte[8];
            bool   retVal = ProcessMemoryReaderApi.ReadProcessMemory(this.mhProcess, (IntPtr)address, buffer, 8, out ptr);

            this.mPointerAddress = BitConverter.ToInt64(buffer, 0);
        }
示例#3
0
        public byte[] readMemoryBuffer(long Address, long offset)
        {
            IntPtr ptr;

            byte[] buffer = new byte[10];
            if (ProcessMemoryReaderApi.ReadProcessMemory(this.mhProcess, (IntPtr)(Address + offset), buffer, 8, out ptr) == false)
            {
                return(new byte[0]);
            }

            return(buffer);
        }
示例#4
0
 public bool OpenProcess()
 {
     // Vista? ><
     if (System.Environment.OSVersion.Version.Major >= 6)
     {
         try {
             System.Diagnostics.Process.EnterDebugMode();
         } catch (Exception e) {
             System.Windows.Forms.MessageBox.Show("Fehler beim EnterDebugMode()!\nBitte GodLesZ melden.\n\n" + e.ToString(), "Fehler", System.Windows.Forms.MessageBoxButtons.OK, System.Windows.Forms.MessageBoxIcon.Error);
             return(false);
         }
     }
     this.mhProcess = ProcessMemoryReaderApi.OpenProcess(ProcessMemoryReaderApi.PROCESS_VM_READ, 1, (uint)this.mReadProcess.Id);
     return(this.mhProcess != IntPtr.Zero);
 }
示例#5
0
        public string readMemoryString(long address, int len)
        {
            IntPtr ptr;

            byte[] buffer       = new byte[len];
            string returnString = "";

            ProcessMemoryReaderApi.ReadProcessMemory(this.mhProcess, (IntPtr)address, buffer, (uint)len, out ptr);
            for (int i = 0; i < buffer.Length; i++)
            {
                if (buffer[i] == '\0')
                {
                    break;
                }

                returnString += (char)buffer[i];
            }

            return(returnString);
        }
示例#6
0
 public void SwitchToProcWindow()
 {
     ProcessMemoryReaderApi.ShowWindow(this.mhProcess, 1);
 }
示例#7
0
        public void writeMemoryLong(IntPtr address, byte[] towrite)
        {
            int num;

            ProcessMemoryReaderApi.WriteProcessMemory(this.mhProcess, address, towrite, 8, out num);
        }