Changed somethings... and got this error:
System.ComponentModel.Win32Exception: Only part of a ReadProcessMemory or WriteProcessMemory request was completed.
Wierd as it should work(it should, shouldnt it? )
Code:
const uint PROCESS_ALL_ACCESS = 0x000F0000 | 0x00100000 | 0xFFF;
ProcessHandle = OpenProcess(PROCESS_ALL_ACCESS , false, ProcessID);
the error shows up when the program tries to read a float.
what throws my exception:
Code:
public float ReadFloat(uint address)
{
float value = 0f;
int returnLength = 0;
if (!ReadProcessMemory(ProcessHandle, address, out value, Marshal.SizeOf(value), out returnLength))
throw new Win32Exception(Marshal.GetLastWin32Error());
return value;
}