need help building a base hack
hi. i looked at some posts and decided to code a base hack myself... i got experience with c so c++ wasn't a problem, at least the sintax of it because i did all some threads here explain but when injected my hack is detected because of an abnormal memory access.
i guess the __asm pushad and popad don't work???
any help is appreciated...
anyway here is the code:
Code:
#include <windows.h>
#include <iostream>
using namespace std;
void __cdecl PushToConsole(char* szVal){
DWORD dwCShell=(DWORD)GetModuleHandleA("CShell.dll");
if(dwCShell!=NULL)
{
DWORD *LTClient=(DWORD*)((dwCShell+0x299D40));
void* CONoff=(void*)*(DWORD*)(*LTClient+0x1F8);
_asm
{
push szVal;
call CONoff;
add esp, 4;
}
}
}
DWORD WINAPI sneaky(LPVOID){
while(GetModuleHandleA("CShell.dll") == NULL ){
Sleep(100); //100ms
}
for(;;){
__asm pushad;
bool boxes=true;
bool nosky=true;
bool worldframe=false;
bool playerframe=false;
bool skeleton=false;
if(GetAsyncKeyState(VK_NUMPAD1)&1){
boxes=!boxes;
}
if(GetAsyncKeyState(VK_NUMPAD2)&1){
nosky=!nosky;
}
if(GetAsyncKeyState(VK_NUMPAD3)&1){
worldframe=!worldframe;
}
if(GetAsyncKeyState(VK_NUMPAD4)&1){
playerframe=!playerframe;
}
if(GetAsyncKeyState(VK_NUMPAD5)&1){
skeleton=!skeleton;
}
if(skeleton){
PushToConsole("ModelDebug_DrawSkeleton 1");
}
else{
PushToConsole("ModelDebug_DrawSkeleton 0");
}
if(boxes){
PushToConsole("ModelDebug_DrawBoxes 1");
}
else{
PushToConsole("ModelDebug_DrawBoxes 0");
}
if(nosky){
PushToConsole("DrawSky 0");
}
else{
PushToConsole("DrawSky 1");
}
if(worldframe){
PushToConsole("WireFrame 1");
}
else{
PushToConsole("WireFrame 0");
}
if(playerframe){
PushToConsole("WireFrameModels 1");
}
else{
PushToConsole("WireFrameModels 0");
}
Sleep(100);
__asm popad;
}
}
BOOL WINAPI DllMain(HMODULE hDll,DWORD dwReason,LPVOID lpReserved){
DisableThreadLibraryCalls(hDll);
if(dwReason==DLL_PROCESS_ATTACH){
MessageBoxA(0, "Coded By Sneaky Fox","Injected",0);
CreateThread(NULL,NULL,sneaky,NULL,NULL,NULL);
}
return TRUE;
}
what you mean by packing it?
done it with upx and works at beggining but keys don't
oh nice thx for helping. anyone knows how to make keys work in 32-bit systems??
im 64 bit and the base is not yet working...