能力值:
( LV2,RANK:10 )
|
-
-
2 楼
源码呢???
|
能力值:
( LV2,RANK:10 )
|
-
-
3 楼
dll的cpp文件
BOOL
LRESULT CALLBACK GetMsgProc(int code,WPARAM wParam,LPARAM lParam)
{
return CallNextHookEx(hHook,code,wParam,lParam);
}
extern "C"
__declspec(dllexport)
HHOOK InstHook ()
{
HMODULE hMod = GetModuleHandle("APIHookDll.dll");
hHook = SetWindowsHookEx(WH_GETMESSAGE,&GetMsgProc,hMod,0);
return hHook;
}
WINAPI MyCreateProcessInternalW(
HANDLE hToken,
LPCTSTR lpApplicationName,
LPTSTR lpCommandLine,
LPSECURITY_ATTRIBUTES lpProcessAttributes,
LPSECURITY_ATTRIBUTES lpThreadAttributes,
BOOL bInheritHandles,
DWORD dwCreationFlags,
LPVOID lpEnvironment,
LPCTSTR lpCurrentDirectory,
LPSTARTUPINFO lpStartupInfo,
LPPROCESS_INFORMATION lpProcessInformation,
PHANDLE hNewToken
)
{
HMODULE hLib = LoadLibrary("kernel32.dll");
OriCreateProcessInternalW = (_CreateProcessInternalW)GetProcAddress( hLib, "CreateProcessInternalW");
BOOL bRet=(OriCreateProcessInternalW)(hToken,lpApplicationName,lpCommandLine,NULL,NULL,0,CREATE_SUSPENDED,NULL,lpCurrentDirectory,lpStartupInfo,lpProcessInformation,hNewToken);
MessageBox(NULL,lpCommandLine,"asdfasdfa",MB_OK);
return bRet;
}
BOOL APIENTRY DllMain( HANDLE hModule,
DWORD ul_reason_for_call,
LPVOID lpReserved
)
{
switch( ul_reason_for_call)
{
case DLL_PROCESS_ATTACH:
{
hkA.hModCallerModule = NULL;
hkA.pszAPIName = "CreateProcessInternalW";
hkA.pszCalleeModuleName = "kernel32.dll";
hkA.pfnDummyFuncAddress = (PROC) & MyCreateProcessInternalW;
hkA.pfnOriginApiAddress = GetProcAddress(GetModuleHandle("kernel32.dll"),"CreateProcessInternalW");
if( FALSE == SetWindowsAPIHook(&hkA) )
MessageBox(NULL,"Hook CreateProcessInternalW失败" ,"Note",0);
MessageBox(NULL,"1","1",MB_OK);
}
break;
case DLL_PROCESS_DETACH:
if( FALSE == UnhookWindowsAPIHooks(hkA) )
MessageBox(NULL,"UnHook CreateProcessInternalW失败" ,"Note",0);
break;
default:
break;
}
return TRUE;
}
|
能力值:
( LV5,RANK:66 )
|
-
-
4 楼
你肯定是在exe里调用的dll导出函数吧,调试exe跟进去就行了呗。
|
能力值:
( LV2,RANK:10 )
|
-
-
5 楼
导出的函数是可以跟进去的,但是其他,比如这里的MyCreateProcessInternal函数就跟不了
|
能力值:
( LV5,RANK:66 )
|
-
-
6 楼
可以按Ctrl+小键盘的'*'键更改EIP,在这个函数这执行,不过要注意参数。
其实,都是可以变通的,你把他声明成导出不就可以调试了;或者你在其他导出函数里调用一下这个函数,等正式发布的时候,再改回去,总之是有办法的。再不行,你复制代码到exe程序里编译后调试。
|