Hi, So i've been trying to make a "Fake lag" cheat for CS:GO, using
engine.dll address +
bSendPackets. But im running into a problem; it crashes the game with the error
"
The Thread tried to read from or write to a virtual address for which it does not have the appropriate access."
So i Googled around for awhile, and found out that you're supposed to be using
VirtualProtectEx to change the access "level" before you wpm to it, so I did that, and now im getting it to work, sort of... I can write to it so it disconnects me from the game eventually... BUT I get this error that the program is trying to write to protected memory, so the application just stalls. (Hence wont pursue to turn on sendPackets again, meaning I wont be lagging around any further than to the main menu.)
However, so i tried using "Try & catch" but it still just exits / stalls the application with the error.
This is what my code looks like:
Code:
public void writeProtected(int addr, byte value, IntPtr pHandle)
{
uint oldProtect;
try
{
VirtualProtectEx(pHandle, ((IntPtr)addr), (UIntPtr)4, 0x40, out oldProtect);
WriteProcessMemory((int)pHandle, addr, BitConverter.GetBytes(value), 1, 1);
VirtualProtectEx(pHandle, ((IntPtr)addr), (UIntPtr)4, oldProtect, out skrap);
}
catch (System.Exception)
{
Console.WriteLine("Error.");
}
}
Anybody knows what im doing wrong? why am I even getting the error after using the VirtualProtectEx function?
Thankful for any help
