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

📄 hookmng.h

📁 在驱动下实现进程隐藏,在驱动下实现进程隐藏.
💻 H
字号:
#if !defined(AFX_HOOKMNG_H__CC466B43_CEF2_4037_8D0C_630973995D56__INCLUDED_)
#define AFX_HOOKMNG_H__CC466B43_CEF2_4037_8D0C_630973995D56__INCLUDED_

#include "common.h"
#include "SingleMode.h"

class HookMng
{
protected:
	SingleProcessorMode mSingleMode;
public:
	HookMng(){}
	~HookMng(){}
	
	template<class _Type> 
		bool ExSetHook(
		_Type& refObject,				// Object of specified _Type
		void (_Type::*FuncPtr)());	// Pointer to a method of specified _Type

};
template<class _Type> 
bool HookMng::ExSetHook(
			   _Type& refObject,				// Object of specified _Type
			   void (_Type::*FuncPtr)())	// Pointer to a method of specified _Type
{
	ULONG CR0Reg;
	mSingleMode.Enter();

	__asm
	{
		mov eax, cr0
			mov CR0Reg,eax			// save WP bit
			and eax,0xFFFEFFFF		// clear WP bit
			mov cr0, eax
	}

	// Calling a method of specified _Type
	(refObject.*FuncPtr)();

	__asm
	{
		mov eax, CR0Reg
			mov cr0, eax            // restore WP bit                    
	}

	mSingleMode.Exit();

	return true;
}
#endif // !defined(AFX_HOOKMNG_H__CC466B43_CEF2_4037_8D0C_630973995D56__INCLUDED_)

⌨️ 快捷键说明

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