Originally Posted by
kmanev073
hi dudes,
i have started to make my first hack but i can't build it wtf
the code is this:
#include <windows.h>
bool change = false;
if(GetAsyncKeyState(VK_F2) || GetAsyncKeyState(VK_F2) &1) {Change = true; Beep(550, 120); }
if(Change) {
if (0x2428) {
for(int i=0; i<445; i++) {
if((*(DWORD*)((*(DWORD*)(CShell+0x2428))+(4*i))) != NULL)
*(float*)((*(DWORD*)((*(DWORD*)(CShell+0xA287A8))+ (4*i) )) + 0x2428y) = 9999;
}
}
}
DWORD WINAPI loadddd(LPVOID) {
while(GetModuleHandleA("CShell.dll") == NULL) {
Sleep(150);
}
Sleep(100);
CreateThread(NULL, NULL, (LPTHREAD_START_ROUTINE)Hacks, NULL, NULL, NULL);
return 0;
}
BOOL WINAPI DllMain ( HMODULE hDll, DWORD dwReason, LPVOID lpReserved ) {
DisableThreadLibraryCalls(hDll);
if ( dwReason == DLL_PROCESS_ATTACH ) {
MessageBoxA(0,"Made by kmanev073 for www.mpgh.net","Injected", 0);
CreateThread(0,0,(LPTHREAD_START_ROUTINE)loadddd,0 ,0,0);
}
return true;
}
what i am doing wrong ? help guys
You created a thread of the function called "Hacks," which doesn't exist. You also have the code you probably meant to have in "Hacks" in global space.
Code:
if(GetAsyncKeyState(VK_F2) || GetAsyncKeyState(VK_F2) &1) {Change = true; Beep(550, 120); }
if(Change) {
if (0x2428) {
for(int i=0; i<445; i++) {
if((*(DWORD*)((*(DWORD*)(CShell+0x2428))+(4*i))) != NULL)
*(float*)((*(DWORD*)((*(DWORD*)(CShell+0xA287A8))+(4*i) )) + 0x2428y) = 9999;
}
}
}
That section will never execute. Meanwhile, the compiler will tell you have you haven't declared a function called "Hacks."
Thirdly, "CShell" is never declared. You should either create a variable "void * CShell" and assign to it the correct address, or use a macro, "#define CShell" with the correct address declared (this is all assuming you don't know how to scan for byte patterns).
It looks like you really need to spend more time learning C++ before you try to make hacks.