DLL Memory Hacking Crash

Posts 1–11 of 11 · Page 1 of 1
DLL Memory Hacking Crash
So I tried everything except Virtual Protect , when I activate the hack , the game crashes.

Should I use Virtual Protect , or what should i do?

Code:
#include <windows.h>
#define pointer 0x0000000
#define offset 0x10
#define offset1 0x290
#define offset2 0xd4
#define offset3 0x164
#define offset4 0xf0

DWORD GetAntiKickPointer(DWORD dwClientOffset)
{
	DWORD dwAddress = dwClientOffset + pointer;
	if(!IsBadReadPtr((void*)dwAddress, 4)){
dwAddress = *(DWORD*)dwAddress + offset;
dwAddress = *(DWORD*)dwAddress + offset1;
dwAddress = *(DWORD*)dwAddress + offset2;
dwAddress = *(DWORD*)dwAddress + offset3;
dwAddress = *(DWORD*)dwAddress + offset4;
if (!IsBadWritePtr((void*)dwAddress, 4))
return dwAddress;
	}
return NULL;
}

void main()
{
DWORD dwClientOffset = (DWORD)GetModuleHandle(L"AVA.exe");
bool bActivated = false;

while (true)//Keep the thread alive
{
if (GetAsyncKeyState(VK_HOME) & 0x8000) //The Hotkey to enable the function
{
if (bActivated == false)
{
__try{
	Beep(1000 , 100);
int* pAntiKick = (int*)GetAntiKickPointer(dwClientOffset);
if (pAntiKick)
*pAntiKick = 5;
bActivated = true;
}
__except(GetExceptionCode())
{
}
Sleep(500);
}
}
else if (GetAsyncKeyState(VK_END) & 0x8000)
{
if (bActivated == true)
{
__try{
	Beep(500 , 100);
int* pAntiKick = (int*)GetAntiKickPointer(dwClientOffset);
if (pAntiKick)
*pAntiKick = 6;
bActivated = false;
}
__except(GetExceptionCode())
{
}
Sleep(500);
}
}
Sleep(30);//Stop the loop from chewing the cpu
}
}

BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
{
if (fdwReason == DLL_PROCESS_ATTACH)
{
DisableThreadLibraryCalls(hinstDLL);
CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)&main, NULL, 0, NULL);//Creates the thread
}
return TRUE;
}
Quote Originally Posted by [D]opeDog View Post
So I tried everything except Virtual Protect , when I activate the hack , the game crashes.

Should I use Virtual Protect , or what should i do?
Why would you come here to post if you should/shouldn't try something.. Just try it..?
You should try VirtualProtection, and probably IsBadWritePointer or IsBadReadPtr just is screwing the whole thing. And it's so hard to read.
Quote Originally Posted by Cernunnos View Post
You should try VirtualProtection, and probably IsBadWritePointer or IsBadReadPtr just is screwing the whole thing. And it's so hard to read.
Yeah , I will try VirtualProtect , IsBadWritePtr is working perfect and reading the pointer without a problem but I don't know why It crashes ...
Debug it then and step through your code to find out where it is crashing at.
Quote Originally Posted by atom0s View Post
Debug it then and step through your code to find out where it is crashing at.
It is a dll , lol.

After trying to use Virtual Protect and many things , the game still crashes when I activate the hack like in the code ...

I even made a function for it and It still crashes when I activate it.

The pointer in CE is as an example : "AVA.exe"+0x00000 -> 0x000000 + Offset1 -> 0x00000 + Offset2 -> Final Address.

I made a function for it to read and check it after it read the first time and the second time and check it when we write the value.
Quote Originally Posted by [D]opeDog View Post

It is a dll , lol.

After trying to use Virtual Protect and many things , the game still crashes when I activate the hack like in the code ...

I even made a function for it and It still crashes when I activate it.

The pointer in CE is as an example : "AVA.exe"+0x00000 -> 0x000000 + Offset1 -> 0x00000 + Offset2 -> Final Address.

I made a function for it to read and check it after it read the first time and the second time and check it when we write the value.
DLL or not, you can still debug it.
Thanks for helping , I solved the problem..

Any mods can close the thread as solved.
Why wouldnt you just try it ?
Quote Originally Posted by _Hubby- View Post
Why wouldnt you just try it ?
I tried it and It didn't work but I used to make it working.
Posts 1–11 of 11 · Page 1 of 1

Post a Reply

Similar Threads

Tags for this Thread

None

Need help?