Hi, can someone guide me on creating a DLL that will inject a value into a program's address after pressing a hotkey?
Example, After pressing the key 's' it changes the address from a certain digit to the digit i want.
Printable View
Hi, can someone guide me on creating a DLL that will inject a value into a program's address after pressing a hotkey?
Example, After pressing the key 's' it changes the address from a certain digit to the digit i want.
I think this is the code for that what you want to achieve. When injected it runs MyThread.
#include <windows.h>
void WINAPI MyThread ( )
{
MessageBox(NULL, "DLL is injected!", "Injected!", MB_OK);
}
BOOL WINAPI DllMain ( HMODULE hModule, DWORD dwReason, LPVOID lpvReserved )
{
switch ( dwReason ) {
case DLL_PROCESS_ATTACH:
DisableThreadLibraryCalls(hModule);
if ( CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)MyThread, NULL, 0, NULL) == NULL ) {
return FALSE;
}
break;
case DLL_PROCESS_DETACH:
break;
case DLL_THREAD_ATTACH:
break;
case DLL_THREAD_DETACH:
break;
}
return TRUE;
}
External processes can use WriteProcessMemory to edit values but i don´t know if that works here too. For the hotkeys u can use GetAsyncKeyState. MSDN has some good guides about that.
P.S. Correct me if I'm wrong. I'm nub.
Perharps you can tell me, which is the line that allow me to attach the the specify "...".exe?
I'm also a noob in such things.
read book
[Only registered and activated users can see links. Click Here To Register...]
What do you mean with that? Your DLL can't specify the process. The injector does.Quote:
Originally Posted by Icystormx [Only registered and activated users can see links. Click Here To Register...]