DLLmain -dll_attach_procces-

Posts 19 of 9 · Page 1 of 1
DLLmain -dll_attach_procces-
Hey , i build my first hack (helped by few people !) ,

I successd to create the dll but when i inject and i start game and i press the keys nothing happens...

and six99 said the problem is in the DLLMain that i need to create thread for the DLL_PROCCES_ATTACH... and i dont know how to do that...

I go this:
Code:
     BOOL WINAPI DllMain(HMODULE hModule, DWORD ul_reason_for_call, LPVOID lpReserved)
{
	DisableThreadLibraryCalls(hModule);
	if (ul_reason_for_call == DLL_PROCESS_ATTACH)
	{
		MessageBoxA(0, "wOOOO eliya", "Yup", 0);
		CreateThread(NULL, NULL, (LPTHREAD_START_ROUTINE)&Hack, NULL, NULL, NULL);
	}
}
When i click build solution its gives me error :
1>dllmain.cpp(10): error C2065: 'Hack' : undeclared identifier
somebody can give a good dllmain code?
thankx!
Quote Originally Posted by eliac View Post
Hey , i build my first hack (helped by few people !) ,

I successd to create the dll but when i inject and i start game and i press the keys nothing happens...

and six99 said the problem is in the DLLMain that i need to create thread for the DLL_PROCCES_ATTACH... and i dont know how to do that...

I go this:
Code:
     BOOL WINAPI DllMain(HMODULE hModule, DWORD ul_reason_for_call, LPVOID lpReserved)
{
	DisableThreadLibraryCalls(hModule);
	if (ul_reason_for_call == DLL_PROCESS_ATTACH)
	{
		MessageBoxA(0, "wOOOO eliya", "Yup", 0);
		CreateThread(NULL, NULL, (LPTHREAD_START_ROUTINE)&Hack, NULL, NULL, NULL);
	}
}
When i click build solution its gives me error :


somebody can give a good dllmain code?
thankx!

It's almost correct, but look more closely at your error, what do you think you are missing?

/b/ro tip:

After dll main is called it returns true (or false) to kernel32.dll
That means that execution will stop, you don't want that, but you don't want to stop the execution of the caller either, so you create another process.

try doing it like this:

dllmain thingy(){
CreateThreadThingy(....()&Hack...)
}


void Hack(){
Messagebox(...);
}
i dont get it... i need create more threads?

dllmain thingy(){
CreateThread(NULL, NULL, (LPTHREAD_START_ROUTINE)&Hack, NULL, NULL, NULL);
}


void Hack(){
MessageBoxA(0, "wOOOO eliya", "Yup", 0);
}

like that ?
Quote Originally Posted by eliac View Post
i dont get it... i need create more threads?

dllmain thingy(){
CreateThread(NULL, NULL, (LPTHREAD_START_ROUTINE)&Hack, NULL, NULL, NULL);
}


void Hack(){
MessageBoxA(0, "wOOOO eliya", "Yup", 0);
}

like that ?
WHAT THE HELLL. LEARN SOME C++.

It says LPTHREAD_START_ROUTINE.. what you think that does?
i give up already.. *sigh*
Quote Originally Posted by eliac View Post
i dont get it... i need create more threads?

dllmain thingy(){
CreateThread(NULL, NULL, (LPTHREAD_START_ROUTINE)&Hack, NULL, NULL, NULL);
}


void Hack(){
MessageBoxA(0, "wOOOO eliya", "Yup", 0);
}

like that ?
Yes, that's how you should do it. Of course you need to replace the dllmain thingy() with real winapi dll code.
LOL!
Craete a new void:
[html]void hack()
{
//Here add now ur hacks
//use a while to do it all the time:
while(1)
{
//add now ptc hacks or anything lol
}
}[/html]

AND PLZ!
LEARN C++!!!!!!!
lol, my name isn't six99 xD anyway, the problem is that ur "hack" function is not declared, maybe u have it but in another .cpp file... try to cut and paste the dllmain under the "hack" function... or just do as ChanceOfHax sayd: create that function
i successed to compile it to DLL... but when i go ingame then choose room and start the game its DC me :O!
Quote Originally Posted by eliac View Post
i successed to compile it to DLL... but when i go ingame then choose room and start the game its DC me :O!
because u can't patch memory's bytes in the lobby, u need the gamestatus pointer to check where the player is... or use the function that kotentopf released
Posts 19 of 9 · Page 1 of 1
This thread is closed for replies.

Tags for this Thread

None

Need help?