RhInjectLibrary()

Jul 4, 2013 at 6:06 AM
Edited Jul 4, 2013 at 6:08 AM
2.7 NetFX4.0
typedef NTSTATUS (_stdcall *MyInject)(ULONG,ULONG,ULONG,WCHAR*,WCHAR*,PVOID,ULONG);

HINSTANCE hInst;
    hInst=LoadLibrary(_T("D:\\EasyHook32.dll"));
    if(hInst==NULL)
    {
        FreeLibrary(hInst);
    }
    MyInject Inject=(MyInject)GetProcAddress(hInst,"RhInjectLibrary");
    if(Inject==NULL)//Inject = 0x00000000
    {
        FreeLibrary(hInst);
    }

    LONG ret = Inject(m_Pid,0,0x10000000,_T("D:\\ApiHookDll.dll"),NULL,NULL,0);
ERROR:
the Inject = 0x00000000; when Inject: 0xC0000005: Access violation