예제 #1
0
        public static double ReadDouble(IntPtr processHandle, long lpBaseAddress)
        {
            int num = 0;

            byte[] array = new byte[8];
            Process32.ReadProcessMemory(processHandle, new IntPtr(lpBaseAddress), array, 8, out num);
            return((double)BitConverter.ToSingle(array, 0));
        }
예제 #2
0
        public static ulong smethod_5(IntPtr processHandle, long lpBaseAddress)
        {
            int num = 0;

            byte[] array = new byte[8];
            Process32.ReadProcessMemory(processHandle, new IntPtr(lpBaseAddress), array, 8, out num);
            return(BitConverter.ToUInt64(array, 0));
        }
예제 #3
0
        public static float ReadFloat(IntPtr processHandle, long lpBaseAddress)
        {
            int num = 0;

            byte[] array = new byte[4];
            Process32.ReadProcessMemory(processHandle, new IntPtr(lpBaseAddress), array, 4, out num);
            return(BitConverter.ToSingle(array, 0));
        }
예제 #4
0
        public static bool ReadBoolean(IntPtr processHandle, long lpBaseAddress)
        {
            int num = 0;

            byte[] array = new byte[1];
            Process32.ReadProcessMemory(processHandle, new IntPtr(lpBaseAddress), array, 1, out num);
            return(Convert.ToBoolean(array[0]));
        }
예제 #5
0
        public static int smethod_2(IntPtr processHandle, long lpBaseAddress)
        {
            int num = 0;

            byte[] array = new byte[4];
            Process32.ReadProcessMemory(processHandle, new IntPtr(lpBaseAddress), array, 4, out num);
            return(BitConverter.ToInt32(array, 0));
        }
예제 #6
0
        public static byte ReadByte(IntPtr processHandle, long lpBaseAddress)
        {
            int num = 0;

            byte[] array = new byte[1];
            Process32.ReadProcessMemory(processHandle, new IntPtr(lpBaseAddress), array, 1, out num);
            return(array[0]);
        }
예제 #7
0
        public static byte[] ReadBytes(IntPtr processHandle, long lpBaseAddress, int _Size)
        {
            int num = 0;

            byte[] array = new byte[_Size];
            Process32.ReadProcessMemory(processHandle, new IntPtr(lpBaseAddress), array, _Size, out num);
            if (num == 0)
            {
                return(new byte[0]);
            }
            return(array);
        }
예제 #8
0
 public static byte[] ReadMemory(Process process, int address, int length, out int bytesRead)
 {
     byte[] array = new byte[length];
     bytesRead = 0;
     System.IntPtr intPtr = Process32.OpenProcess(Process32.PROCESS_ALL_ACCESS, 0, (uint)process.Id);
     if (intPtr != System.IntPtr.Zero)
     {
         Process32.ReadProcessMemory(intPtr, new System.IntPtr(address), array, length, out bytesRead);
         Process32.CloseHandle(intPtr);
     }
     return(array);
 }
예제 #9
0
        public static string ReadString(IntPtr processHandle, long lpBaseAddress, int size)
        {
            int num = 0;

            byte[] array = new byte[size];
            Process32.ReadProcessMemory(processHandle, new IntPtr(lpBaseAddress), array, size, out num);
            int num2 = array.IndexOf(0, 0);

            if (num2 < 0)
            {
                num2 = array.Length;
            }
            return(Encoding.UTF8.GetString(array, 0, num2));
        }
예제 #10
0
        public static byte[] ReadMemory(uint pid, int address, int length, out int bytesRead)
        {
            IntPtr intPtr = Process32.OpenProcess(Process32.PROCESS_ALL_ACCESS, 0, pid);

            if (intPtr != IntPtr.Zero)
            {
                byte[] array = new byte[length];
                Process32.ReadProcessMemory(intPtr, new IntPtr(address), array, length, out bytesRead);
                Process32.CloseHandle(intPtr);
                return(array);
            }
            bytesRead = 0;
            return(new byte[0]);
        }
예제 #11
0
 public static byte[] ReadMemory(ProcessEntry32 process, int address, int length, out int bytesRead)
 {
     System.IntPtr intPtr = Process32.OpenProcess(Process32.PROCESS_ALL_ACCESS, 0, process.th32ProcessID);
     byte[]        result;
     if (intPtr != System.IntPtr.Zero)
     {
         byte[] array = new byte[length];
         Process32.ReadProcessMemory(intPtr, new System.IntPtr(address), array, length, out bytesRead);
         Process32.CloseHandle(intPtr);
         result = array;
     }
     else
     {
         bytesRead = 0;
         result    = new byte[0];
     }
     return(result);
 }