C#. Problem with MemoryReader class.
Hail! I've got a problem with cheat, idk what exactly is wrong, but i think all the fault is Memory class. When i use this to get glow esp or bhop this works fine, but when i try to use this with my triggerbot class, everything works, but only a couple of minutes, and then stops working the whole cheat. I've already try my project on other MemoryEditor lib, and everything working as well!
Please, people, told me what's wrong here and how can this be improved?
Code:
// memory lib (only integer reading)
[DllImport("kernel32.dll")]
static extern bool ReadProcessMemory(int hProcess, int lpBaseAddress, byte[] lpBuffer, int dwSize, ref int lpNumberOfBytesRead);
public int ReadInt(int address)
{
var bytes = ReadMemory(address, sizeof(int));
return BitConverter.ToInt32(bytes, 0);
}