Credits:
***-Cobra // for teaching me how to do this, and for teaching me how to hack.
This is how i was taught to do this. their is also a tutorial like this from cobra on D x T. I was taught this in D3D8 but here is it in D3D9.
At the top of d3d9dev.cpp we need to make a handle.
Code:
HANDLE CA; // this is what i use u can change it.
Then Search for Initialize()
Then add this to it. Call this in endscene too,to make sure we still have the current process.
Code:
CA = GetCurrentProcess();
now when you do ReadProcessMemory or WriteProcessMemory,we have our mem to read and write also.
Code:
#define GlassWalls 0x00000000 //define your address here with the HANDLE
CA = GetCurrentProcess();
ReadProcessMemory(Wrrk,(LPVOID*)(DWORD)GlassWalls,&v, sizeof(v), NULL);
Now we use memcpy for a second option.
Code:
#define GlassWalls 0x00000000 //<<<<<<define your address up top somewere with the HANDLE
void GlassWalls()
{
long t=0;
unsigned long Protection;
VirtualProtect((void*)GlassWalls, sizeof(t), PAGE_READWRITE, &Protection);
memcpy((void*)GlassWalls, &t , sizeof(t));
VirtualProtect((void*)GlassWalls, sizeof(t), Protection, 0);
VirtualProtect((void*)GlassWalls2, sizeof(t), PAGE_READWRITE, &Protection);
memcpy((void*)GlassWalls2, &t , sizeof(t));
VirtualProtect((void*)GlassWalls2, sizeof(t), Protection, 0);
}
now to use this with a hotkey.
Code:
////up top bool your hack bool means true or false///
bool G_Walls;
/////in End Scene/////Do the hotkey and hack
if( GetAsyncKeyState( VK_NUMPAD1)&1 )
G_Walls = !G_Walls; ////this tells it on or off
if (G_Walls) ////if H_Spawn is true
{
GlassWalls(); /// hack
}
this is how i made most of my hacks in my D3D hack im creating.
Credits to ***-Cobra - for teaching me this on facebook
Me - for showing u how i do it.