⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 hookserv.c

📁 编程高手箴言-原书源码
💻 C
字号:
#include <windows.h>
#include "../PEHOOK/APIHook32.h"
#include "../RUN/RUN.c"

PROC lpAdder = MessageBoxA;

int WINAPI MyMesageBoxA(
			  HWND hWnd,          // handle of owner window
			  LPCTSTR lpText,     // address of text in message box
			  LPCTSTR lpCaption,  // address of title of message box
			  UINT uType          // style of message box
			  )
{
	return lpAdder(NULL,"new","new",MB_OK);
	
}

void main()
{
	
	APIHOOK32_ENTRY pe;
	
	
	pe.pszAPIName		= "MessageBoxA";
	pe.pszCallerModuleName	= "user32.DLL";
	pe.pfnOriginApiAddress	= MessageBoxA;
	pe.pfnDummyFuncAddress	= MyMesageBoxA;
	pe.hModCallerModule	= NULL;
	
	lpAdder = MessageBoxA;
	
	//钩挂MessageBoxA
	SetWindowsAPIHook(&pe);
	MessageBox(NULL,"old","old",MB_OK);
	run();
	//去除钩挂
	UnhookWindowsAPIHooks(&pe);
	//MessageBox(NULL,"old","old",MB_OK);
	run();
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -