Results 1 to 3 of 3
  1. #1
    lilghost8631's Avatar
    Join Date
    Jul 2013
    Gender
    male
    Posts
    68
    Reputation
    10
    Thanks
    14

    DLL Not Attaching?

    Hello, so I'm just making a really basic function to produce a popup when the DLL attaches. The problem is DllMain never seems to run.
    My code:
    Code:
    #include <iostream>
    #include <Windows.h>
    #include <TlHelp32.h>
    #include <Psapi.h>
    #include <d3d9.h>
    
    BOOL _stdcall DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpReserved){
    	DisableThreadLibraryCalls(hinstDLL);
    	MessageBox(NULL, "Go for it", "", MB_OK);
    	return false;
    }
    I just want the popup to appear so the process is "paused" and then I can attach OllyDBG.

    Any help or clarification about the issue would be appreciated. Thanks.

  2. #2
    Timboy67678's Avatar
    Join Date
    Jul 2010
    Gender
    male
    Posts
    82
    Reputation
    25
    Thanks
    80
    My Mood
    Aggressive
    Code:
    BOOL APIENTRY DllMain(HMODULE hModule, DWORD ul_reason_for_call, LPVOID lpReserved)
    {
    	switch (ul_reason_for_call)
    	{
    	case DLL_PROCESS_ATTACH:
                DisableThreadLibraryCalls(hModule);
                MessageBox(NULL, "Go for it", "", MB_OK);
                break;
            }
    	return TRUE;
    }
    you need to wait for the process to call DLL_PROCESS_ATTATCH, and you also need to return TRUE, or 1 otherwise it wont work

  3. The Following User Says Thank You to Timboy67678 For This Useful Post:

    lilghost8631 (12-17-2013)

  4. #3
    lilghost8631's Avatar
    Join Date
    Jul 2013
    Gender
    male
    Posts
    68
    Reputation
    10
    Thanks
    14
    Thanks. I ended up switching it over to:
    Code:
    int __stdcall DllMain(HINSTANCE hinstDLL, DWORD dwReason, LPVOID lpvReserved)
    {
    	DisableThreadLibraryCalls(hinstDLL);
        switch( dwReason )
        {
    		case 1:
    			MessageBox(NULL, "Get to dbgin", "stopped!",  MB_OK);
            break;
        }
        return 1;
    }
    and using a different injector. That seemed to do the trick.
    Last edited by lilghost8631; 12-17-2013 at 08:51 PM.

Similar Threads

  1. Dlls not working? Solution.
    By Kevin Rudd in forum Combat Arms Help
    Replies: 4
    Last Post: 12-22-2009, 05:01 PM
  2. Sexytastic.dll ( not mine )
    By Doom3dInF4ith in forum Gunz Hacks
    Replies: 20
    Last Post: 10-25-2009, 04:23 PM
  3. dll not found
    By pledpled12 in forum WarRock Discussions
    Replies: 5
    Last Post: 09-04-2009, 03:51 PM
  4. Mhs's Not attaching to Engine.exe
    By maxisking in forum Combat Arms Hacks & Cheats
    Replies: 19
    Last Post: 08-28-2008, 04:46 PM
  5. Dammit To Hell, I have A DLL virus attaching to my explorer.exe
    By radnomguywfq3 in forum Hardware & Software Support
    Replies: 6
    Last Post: 10-22-2007, 04:28 PM