Hook IBaseUI function.

 #include <metahook.h>

 #include <IBaseUI.h>

 IBaseUI *g_pBaseUI = ;

 void (__fastcall *g_pfnCBaseUI_Initialize)(void *pthis, int edx, CreateInterfaceFn *factories, int count) = ;
void (__fastcall *g_pfnCBaseUI_Start)(void *pthis, int edx, struct cl_enginefuncs_s *engineFuncs, int interfaceVersion) = ;
void (__fastcall *g_pfnCBaseUI_Shutdown)(void *pthis, int edx) = ;
int (__fastcall *g_pfnCBaseUI_Key_Event)(void *pthis, int edx, int down, int keynum, const char *pszCurrentBinding) = ;
void (__fastcall *g_pfnCBaseUI_CallEngineSurfaceProc)(void *pthis, int edx, void *hwnd, unsigned int msg, unsigned int wparam, long lparam) = ;
void (__fastcall *g_pfnCBaseUI_Paint)(void *pthis, int edx, int x, int y, int right, int bottom) = ;
void (__fastcall *g_pfnCBaseUI_HideGameUI)(void *pthis, int edx) = ;
void (__fastcall *g_pfnCBaseUI_ActivateGameUI)(void *pthis, int edx) = ;
bool (__fastcall *g_pfnCBaseUI_IsGameUIVisible)(void *pthis, int edx) = ;
void (__fastcall *g_pfnCBaseUI_HideConsole)(void *pthis, int edx) = ;
void (__fastcall *g_pfnCBaseUI_ShowConsole)(void *pthis, int edx) = ; class CBaseUI : public IBaseUI
{
public:
void Initialize(CreateInterfaceFn *factories, int count);
void Start(struct cl_enginefuncs_s *engineFuncs, int interfaceVersion);
void Shutdown(void);
int Key_Event(int down, int keynum, const char *pszCurrentBinding);
void CallEngineSurfaceProc(void *hwnd, unsigned int msg, unsigned int wparam, long lparam);
void Paint(int x, int y, int right, int bottom);
void HideGameUI(void);
void ActivateGameUI(void);
bool IsGameUIVisible(void);
void HideConsole(void);
void ShowConsole(void);
}; void CBaseUI::Initialize(CreateInterfaceFn *factories, int count)
{
return g_pfnCBaseUI_Initialize(this, , factories, count);
} void CBaseUI::Start(struct cl_enginefuncs_s *engineFuncs, int interfaceVersion)
{
return g_pfnCBaseUI_Start(this, , engineFuncs, interfaceVersion);
} void CBaseUI::Shutdown(void)
{
return g_pfnCBaseUI_Shutdown(this, );
} int CBaseUI::Key_Event(int down, int keynum, const char *pszCurrentBinding)
{
return g_pfnCBaseUI_Key_Event(this, , down, keynum, pszCurrentBinding);
} void CBaseUI::CallEngineSurfaceProc(void *hwnd, unsigned int msg, unsigned int wparam, long lparam)
{
return g_pfnCBaseUI_CallEngineSurfaceProc(this, , hwnd, msg, wparam, lparam);
} void CBaseUI::Paint(int x, int y, int right, int bottom)
{
return g_pfnCBaseUI_Paint(this, , x, y, right, bottom);
} void CBaseUI::HideGameUI(void)
{
return g_pfnCBaseUI_HideGameUI(this, );
} void CBaseUI::ActivateGameUI(void)
{
return g_pfnCBaseUI_ActivateGameUI(this, );
} bool CBaseUI::IsGameUIVisible(void)
{
return g_pfnCBaseUI_IsGameUIVisible(this, );
} void CBaseUI::HideConsole(void)
{
return g_pfnCBaseUI_HideConsole(this, );
} void CBaseUI::ShowConsole(void)
{
return g_pfnCBaseUI_ShowConsole(this, );
} void BaseUI_InstallHook(void)
{
CreateInterfaceFn EngineCreateInterface = g_pMetaHookAPI->GetEngineFactory();
g_pBaseUI = (IBaseUI *)EngineCreateInterface(BASEUI_INTERFACE_VERSION, ); CBaseUI BaseUI;
DWORD *pVFTable = *(DWORD **)&BaseUI; g_pMetaHookAPI->VFTHook(g_pBaseUI, , , (void *)pVFTable[ ], (void *&)g_pfnCBaseUI_Initialize);
g_pMetaHookAPI->VFTHook(g_pBaseUI, , , (void *)pVFTable[ ], (void *&)g_pfnCBaseUI_Start);
g_pMetaHookAPI->VFTHook(g_pBaseUI, , , (void *)pVFTable[ ], (void *&)g_pfnCBaseUI_Shutdown);
g_pMetaHookAPI->VFTHook(g_pBaseUI, , , (void *)pVFTable[ ], (void *&)g_pfnCBaseUI_Key_Event);
g_pMetaHookAPI->VFTHook(g_pBaseUI, , , (void *)pVFTable[ ], (void *&)g_pfnCBaseUI_CallEngineSurfaceProc);
g_pMetaHookAPI->VFTHook(g_pBaseUI, , , (void *)pVFTable[ ], (void *&)g_pfnCBaseUI_Paint);
g_pMetaHookAPI->VFTHook(g_pBaseUI, , , (void *)pVFTable[ ], (void *&)g_pfnCBaseUI_HideGameUI);
g_pMetaHookAPI->VFTHook(g_pBaseUI, , , (void *)pVFTable[ ], (void *&)g_pfnCBaseUI_ActivateGameUI);
g_pMetaHookAPI->VFTHook(g_pBaseUI, , , (void *)pVFTable[ ], (void *&)g_pfnCBaseUI_IsGameUIVisible);
g_pMetaHookAPI->VFTHook(g_pBaseUI, , , (void *)pVFTable[], (void *&)g_pfnCBaseUI_HideConsole);
g_pMetaHookAPI->VFTHook(g_pBaseUI, , , (void *)pVFTable[], (void *&)g_pfnCBaseUI_ShowConsole);
}

[MetaHook] BaseUI hook的更多相关文章

  1. [MetaHook] GameUI hook

    Hook GameUI function. #include <metahook.h> #include <IGameUI.h> IGameUI *g_pGameUI = ; ...

  2. [MetaHook] Surface hook

    Hook ISurface function. #include <metahook.h> #include <vgui/ISurface.h> using namespace ...

  3. [MetaHook] Event Hook

    #include <metahook.h> struct event_hook_t { event_hook_t *next; char *name; void (*pfnEvent)(e ...

  4. [MetaHook] Load large texture from model

    We need hook "GL_LoadTexture" engine function. GL_LOADTEXTURE_SIG from hw.dll(3266) engine ...

  5. svnserver hook python

    在使用中可能会遇到的错误排除 :1.Error: svn: 解析"D:\www\test"出错,或svn: E020024: Error resolving case of 'D: ...

  6. Android Hook技术

    原文:http://blog.csdn.net/u011068702/article/details/53208825 附:Android Hook 全面入侵监听器 第一步.先爆项目demo照片,代码 ...

  7. Frida HOOK微信实现骰子作弊

    由于微信摇骰子的功能在本地进行随机后在发送,所以存在可以hook掉判断骰子数的方法进行修改作弊. 1.frida实现hook java层函数1)写个用来测试的demo,当我们点击按钮的时候会弹出窗口显 ...

  8. java的关闭钩子(Shutdown Hook)

    Runtime.getRuntime().addShutdownHook(shutdownHook);    这个方法的含义说明:        这个方法的意思就是在jvm中增加一个关闭的钩子,当jv ...

  9. IDT HOOK思路整理

    IDT(中断描述符表)分为IRQ(真正的硬件中断)和软件中断(又叫异常). HOOK的思路为,替换键盘中断处理的函数地址为自己的函数地址.这样在键盘驱动和过滤驱动之前就可以截获键盘输入. 思路确定之后 ...

随机推荐

  1. #一周五# (视频) 手掌四轴Estes 4606,树莓派2和WRTNode,WinHEC 2015深圳

    又到周五,本周<快速创建网站>系列接近尾声,主要部分已经完成,还差最后一篇博主我正在整理.这里给大家分享一些最近看到的有意思的东西. 手掌四轴飞行器 无人机这段时间可是大出风头,DJI或者 ...

  2. Java基础知识学习(七)

    线程(续) 线程同步 当两个或两个以上的线程需要共享资源,它们需要某种方法来确定资源在某一刻仅被一个线程占用.达到此目的的过程叫做同步(synchronization) 可以用两种方法同步化代码.两者 ...

  3. iOS开发进阶

    <iOS开发进阶>基本信息作者: 唐巧 出版社:电子工业出版社ISBN:9787121247453上架时间:2014-12-26出版日期:2015 年1月开本:16开页码:268版次:1- ...

  4. ORA-01501: CREATE DATABASE failed

    使用dbca建库时遇到ORA-01501: CREATE DATABASE failed这个错误,检查告警日志,发现有下面错误信息: SMON: enabling tx recovery Fri Ap ...

  5. node.js表单——formidable

    node处理表单请求,需要用到formidable包.安装formidable包的命令如下: npm install formidable 安装package的路径分为两种,一种是本地目录,一种是全局 ...

  6. [转]nopcommerce商城系统--如何编写一个插件

    本文转自:http://www.cnblogs.com/ganqiyin/p/3680771.html 原址:http://www.nopcommerce.com/docs/77/how-to-wri ...

  7. POJ 3384 Feng Shui --直线切平面

    题意:房间是一个凸多边形,要在里面铺设两条半径为r的圆形地毯,可以重叠,现在要求分别铺设到哪,使地毯所占的地面面积最大. 解法:要使圆形地毯所占面积最大,圆形地毯一定是与边相切的,这样才能使尽量不重叠 ...

  8. POJ1849Two[DP|树的直径](扩展HDU4003待办)

    Two Time Limit: 1000MS   Memory Limit: 30000K Total Submissions: 1390   Accepted: 701 Description Th ...

  9. AC日记——基因相关性 openjudge 1.7 03

    03:基因相关性 总时间限制:  1000ms 内存限制:   65536kB 描述 为了获知基因序列在功能和结构上的相似性,经常需要将几条不同序列的DNA进行比对,以判断该比对的DNA是否具有相关性 ...

  10. java 之前的安全的类回顾,以及以后需要线程安全时使用哪些类

    之前所学习到的线程安全的类: StringBuffer:线程安全的可变字符序列.一个类似于 String 的字符串缓冲区,但不能修改. Vector:Vector 类可以实现可增长的对象数组. Has ...