コード例 #1
0
        public static byte ReadByte(Int64 _lpBaseAddress)
        {
            byte[] Buffer = new byte[sizeof(byte)];
            IntPtr ByteRead;

            Managed.ReadProcessMemory(pHandle, _lpBaseAddress, Buffer, sizeof(byte), out ByteRead);
            return(Buffer[0]);
        }
コード例 #2
0
        public static Int32 ReadInt32(Int64 _lpBaseAddress)
        {
            byte[] Buffer = new byte[4];
            IntPtr ByteRead;

            Managed.ReadProcessMemory(pHandle, _lpBaseAddress, Buffer, 4, out ByteRead);
            return(BitConverter.ToInt32(Buffer, 0));
        }
コード例 #3
0
        private static Int64 FindPattern(Int64 offsetFromBase, bool deref, byte[] byteMask, string szMask)
        {
            IntPtr ByteRead;

            Managed.ReadProcessMemory(RPM.GetHandle(), baseAddress, buffer, (UInt64)searchLength, out ByteRead);

            for (Int64 i = 0; i < searchLength; i++)
            {
                if (DataCompare(i, byteMask, szMask))
                {
                    return(baseAddress + i + 1 + offsetFromBase);
                }
            }

            return(0);
        }
コード例 #4
0
 public static void CloseProcess()
 {
     Managed.CloseHandle(pHandle);
 }
コード例 #5
0
 public static IntPtr OpenProcess(int pId)
 {
     PID     = pId;
     pHandle = Managed.OpenProcess(Managed.PROCESS_VM_READ | Managed.PROCESS_VM_WRITE | Managed.PROCESS_VM_OPERATION, false, pId);
     return(pHandle);
 }