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. 如何分析解读systemstat dump产生的trc文件

    ORACLE数据库的systemstat dump生成trace文件虽然比较简单,但是怎么从trace文件中浩如烟海的信息中提炼有用信息,并作出分析诊断是一件技术活,下面收集.整理如何分析解读syst ...

  2. javascript-建造者模式

    建造者模式笔记 1.工厂模式主要是为了创建对象实例或者类簇(抽象工厂),关心的是最终产出(创建)的是什么,不关心你创建的整个过程,仅仅需要知道你最终创建的结果 2.建造者模式目的也是为了创建对象,但是 ...

  3. mysql主从日志的定期清理

    mysql主从的binlog定时删除是很重要的,一般是通过expire_logs_days = 10来设置binlog保留的天数(mysql5.0一下版本不支持),但有时这还不够,假如有几天的日志量非 ...

  4. Linux简介及常用命令使用2--linux常用命令:查看 删除 编辑 创建等

    cd .       // 进入当前目录 cd ~     //进入根目录 pwd      //当前路径 echo "my name is makaidong">makai ...

  5. 010 使用netmap API接管网卡,接收数据包,回应ARP请求

    一.本文目的: 上一节中,我们已经在CentOS 6.7 上安装好了netmap,也能接收和发送包了,这节我们来调用netmap中的API,接管网卡,对网卡上收到的数据包做分析,并回应ARP请求. 二 ...

  6. [转]C#网络编程(同步传输字符串) - Part.2

    本文转自:http://www.tracefact.net/CSharp-Programming/Network-Programming-Part2.aspx 服务端客户端通信 在与服务端的连接建立以 ...

  7. 【2016-10-13】【坚持学习】【Day4】【WPF】【ObservableCollection<T>】

    今天在项目中使用到这个 ObservableCollection<T> 类,作为数据源集合绑定到控件. 当数据源发生变化,会通知界面显示. 如果用List<T> ,当数据源发生 ...

  8. C#迭代重载等

    迭代器 迭代器是作为一个容器,将要遍历的数据放入,通过统一的接口返回相同类型的值 迭代器代码使用 yield return 语句依次返回每个元素.yield break 将终止迭代 类中实现多个迭代器 ...

  9. save(),saveorupdate()还有marqe()

    所有这三个方法,也就是save().saveOrUpdate()和persist()都是用于将对象保存到数据库中的方法,但其中有些细微的差别.例如,save()只能INSERT记录,但是saveOrU ...

  10. 在Ubuntu14.04下安装vsftp服务器

    猜想在Ubuntu下搭建ftp服务器来实现windows和ubuntu下文件互传是一件很简单的事儿,但是在网上找了好几篇文章都不行,故自己在这里总结一下方法. 首先安装vsftp服务器 sudo ap ...