[HELP] DLL Making

Posts 1–4 of 4 · Page 1 of 1
[HELP] DLL Making
sir can you teach me how to make a dll that shows an message box when injected ??

and when the process is closed.

Example:
i inject the dll and i closed the process i want to make the person who use my dll will be redirected to this site..

Thanks in Advance !
Code:
#include <windows.h>

BOOL APIENTRY DllMain(HMODULE hDll, DWORD dwReason, LPVOID lpReserved)
{
    switch(dwReason)
    {
    case DLL_PROCESS_ATTACH:
        DisableThreadLibraryCalls(hDll);
        MessageBox(0, "Attached!", "WARNING", MB_OK);
        break;
    case DLL_PROCESS_DETACH:
        MessageBox(0, "Detached!", "WARNING", MB_OK);
        break;
    }
}
I don't think DLL_PROCESS_DETACH is used when the application exits, if you really want to do something when the game/application is closed you'll probably need to hook some stuff.
Quote Originally Posted by Hell_Demon View Post
Code:
#include <windows.h>

BOOL APIENTRY DllMain(HMODULE hDll, DWORD dwReason, LPVOID lpReserved)
{
    switch(dwReason)
    {
    case DLL_PROCESS_ATTACH:
        DisableThreadLibraryCalls(hDll);
        MessageBox(0, "Attached!", "WARNING", MB_OK);
        break;
    case DLL_PROCESS_DETACH:
        MessageBox(0, "Detached!", "WARNING", MB_OK);
        break;
    }
}
I don't think DLL_PROCESS_DETACH is used when the application exits, if you really want to do something when the game/application is closed you'll probably need to hook some stuff.
Actually, DLL_PROCESS_DETACH will be called... in most cases (we're talking about normal exits here, nothing about process terminations).

@OP I'll kill you if you stick a popup in my face when I start or exit your app, or even worse, open up IE to a laggy site.
You could try Hooking ExitProcess() or WM_DESTROY to show your message of launch the web page before it closes. BTW that's really annoying when programs do that.
Posts 1–4 of 4 · Page 1 of 1

Post a Reply

Tags for this Thread

None

Talk with us