Пример #1
0
        public int WriteMemory(IntPtr addressBase, byte[] writeBytes, int writeLength)
        {
            int reallyWriteLength = 0;

            if (!ProcessAPIHelper.WriteProcessMemory(processInfo.hProcess, addressBase, writeBytes, writeLength, out reallyWriteLength))
            {
                throw new Exception();
            }
            return(reallyWriteLength);
        }
Пример #2
0
        public IntPtr Open(int processId)
        {
            IntPtr hProcess = IntPtr.Zero;

            hProcess = ProcessAPIHelper.OpenProcess(ProcessAccessFlags.All, false, processId);
            if (hProcess == IntPtr.Zero)
            {
                throw new Exception("OpenProcess失º¡ì败㨹");
            }
            processInfo.hProcess    = hProcess;
            processInfo.dwProcessId = processId;
            return(hProcess);
        }