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. 2014.1.23 Discuz论坛迁移+VPS配置手记

    虽说这也不是我第一次转移这个论坛了,但毕竟还是第一次自己配置VPS,写点东西记一下 一:关于VPS的配置 1.用TeamViewer连接服务器 这个VPS的IDC自己带有一个远程控制的页面,用浏览器打 ...

  2. lvm[12446]: Another thread is handling an event. Waiting

    在检查一Linux服务器时,发现日志里面有大量"lvm[12446]: Another thread is handling an event. Waiting..." Jul  ...

  3. SQL Tune Report–sqltrpt.sql

    ORACLE 10g提供了一个脚本sqltrpt.sql用来查询最耗费资源的SQL语句,其输出的结果分为两部分: 15 Most expensive SQL in the cursor cache 1 ...

  4. 使用Hive或Impala执行SQL语句,对存储在Elasticsearch中的数据操作

    http://www.cnblogs.com/wgp13x/p/4934521.html 内容一样,样式好的版本. 使用Hive或Impala执行SQL语句,对存储在Elasticsearch中的数据 ...

  5. mkfifo

    管道是Linux的十种文件类型之一,使用管道通信本质上还是以文件作为通信的媒介 有名管道+无名管道=管道 有名管道(FIFO文件):就是 有文件名的管道, 可以用于任意两个进程间的通信 无名管道(pi ...

  6. ps, top, pstree

    ps 查看当前终端所启动的进程, 不加选项只查看当前终端的进程 PID TTY TIME CMD 2398 pts/1 00:00:00 bash 3625 pts/1 00:00:00 ps #PI ...

  7. android JAVA字符串转日期或日期转字符串(转)

    用法: SimpleDateFormat sdf = new SimpleDateFormat( " yyyy-MM-dd HH:mm:ss " ); 这一行最重要,它确立了转换的 ...

  8. win7下Qt5使用mysql C++编程配置

    先下载mysql的库文件链接:http://files.cnblogs.com/files/xiaobo-Linux/mysql.zip 把两个文件放入 Qt目录\Qt5.5.0\5.5\mingw4 ...

  9. 连载《一个程序猿的生命周期》-28、被忽悠来的单身HR(女同志)

    一个程序猿的生命周期 微信平台 口   号:职业交流,职业规划:面对现实,用心去交流.感悟. 公众号:iterlifetime 百木-ITer职业交流奋斗 群:141588103    微   博:h ...

  10. HDU5492 Find a path[DP 方差]

    Find a path Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total ...