谢谢大家!

解决方案 »

  1.   

    LoadLibrary加载成功就有DLL内存地址啊
      

  2.   

    DllMain()
    函数中有一个DLL_PROCESS_ATTACH,当你的程序加载这个DLL的时候,这个消息
    通知就被触发,当你的程序中的某个线程用到DLL中的导出函数时DLL_THREAD_ATTACH
    消息通知被触发!加载DLL的方法有显式加载和隐式加载两种
    显式加载用LoadLibrary(),GetProcAddress(),FreeLibrary()等函数
    但是不要忘了,在LoadLibrary()之后,要在你的程序中用typedef来定义一下
    你要从DLL中调用的导出函数!隐式加载是在你的程序中包含你的DLL的头文件和.lib文件!祝你成功!
      

  3.   

    在dllmain函数中if (dwReason == DLL_PROCESS_ATTACH)
    {
        ....
    }dll是在这里加载的,你可以在这里写入一些信息来来确定dll是否加载。。
      

  4.   

    Enumerating All Modules For a ProcessTo determine which processes have loaded a particular DLL, you must enumerate the modules for each process. The following sample code uses the EnumProcessModules function to enumerate the modules of current processes in the system.
    #include <windows.h>
    #include <stdio.h>
    #include "psapi.h"void PrintModules( DWORD processID )
    {
        HMODULE hMods[1024];
        HANDLE hProcess;
        DWORD cbNeeded;
        unsigned int i;    // Print the process identifier.    printf( "\nProcess ID: %u\n", processID );    // Get a list of all the modules in this process.    hProcess = OpenProcess(  PROCESS_QUERY_INFORMATION |
                                        PROCESS_VM_READ,
                                        FALSE, processID );
        if (NULL == hProcess)
            return;    if( EnumProcessModules(hProcess, hMods, sizeof(hMods), &cbNeeded))
        {
            for ( i = 0; i < (cbNeeded / sizeof(HMODULE)); i++ )
            {
                char szModName[MAX_PATH];            // Get the full path to the module's file.            if ( GetModuleFileNameEx( hProcess, hMods[i], szModName,
                                          sizeof(szModName)))
                {
                    // Print the module name and handle value.                printf("\t%s (0x%08X)\n", szModName, hMods[i] );
                }
            }
        }    CloseHandle( hProcess );
    }void main( )
    {
        // Get the list of process identifiers.    DWORD aProcesses[1024], cbNeeded, cProcesses;
        unsigned int i;    if ( !EnumProcesses( aProcesses, sizeof(aProcesses), &cbNeeded ) )
            return;    // Calculate how many process identifiers were returned.    cProcesses = cbNeeded / sizeof(DWORD);    // Print the name of the modules for each process.    for ( i = 0; i < cProcesses; i++ )
            PrintModules( aProcesses[i] );
    }
      

  5.   

    通过上面的方法可以把程序load 的dll 找出来
      

  6.   

    加入你看过windows核心编程的话,你应该知道