コード例 #1
0
        public static uint Read(int address, byte[] buffer, uint count)
        {
            if (address == 0)
            {
                throw new Exception("Read address is 0!");
            }

            uint bytesRead = 0;

            if (!ProcessImports.ReadProcessMemory(Handle, new IntPtr(address), buffer, count, ref bytesRead))
            {
                Error.GetLastError();
            }

            return(bytesRead);
        }
コード例 #2
0
        public static int ReadInt(int address)
        {
            if (address == 0)
            {
                throw new Exception("Read address is 0!");
            }

            IntPtr rw;
            IntPtr puffer;

            if (!ProcessImports.ReadProcessMemory(Handle, new IntPtr(address), out puffer, new UIntPtr(4), out rw))
            {
                Error.GetLastError();
            }
            return(puffer.ToInt32());
        }