[MetaHook] BaseUI hook
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的更多相关文章
- [MetaHook] GameUI hook
Hook GameUI function. #include <metahook.h> #include <IGameUI.h> IGameUI *g_pGameUI = ; ...
- [MetaHook] Surface hook
Hook ISurface function. #include <metahook.h> #include <vgui/ISurface.h> using namespace ...
- [MetaHook] Event Hook
#include <metahook.h> struct event_hook_t { event_hook_t *next; char *name; void (*pfnEvent)(e ...
- [MetaHook] Load large texture from model
We need hook "GL_LoadTexture" engine function. GL_LOADTEXTURE_SIG from hw.dll(3266) engine ...
- svnserver hook python
在使用中可能会遇到的错误排除 :1.Error: svn: 解析"D:\www\test"出错,或svn: E020024: Error resolving case of 'D: ...
- Android Hook技术
原文:http://blog.csdn.net/u011068702/article/details/53208825 附:Android Hook 全面入侵监听器 第一步.先爆项目demo照片,代码 ...
- Frida HOOK微信实现骰子作弊
由于微信摇骰子的功能在本地进行随机后在发送,所以存在可以hook掉判断骰子数的方法进行修改作弊. 1.frida实现hook java层函数1)写个用来测试的demo,当我们点击按钮的时候会弹出窗口显 ...
- java的关闭钩子(Shutdown Hook)
Runtime.getRuntime().addShutdownHook(shutdownHook); 这个方法的含义说明: 这个方法的意思就是在jvm中增加一个关闭的钩子,当jv ...
- IDT HOOK思路整理
IDT(中断描述符表)分为IRQ(真正的硬件中断)和软件中断(又叫异常). HOOK的思路为,替换键盘中断处理的函数地址为自己的函数地址.这样在键盘驱动和过滤驱动之前就可以截获键盘输入. 思路确定之后 ...
随机推荐
- jquery操作select(取值,设置选中)
最近工作中总出现select 和 option问题,整理一下,内容大部分源于网络资料 一.基础取值问题 例如<select class="selector"></ ...
- centos7 添加图形界面的功能
一般安装centos最小版的时候默认没有图形界面 需要自己安装 sudo yum groupinstall "GNOME Desktop" "Graphical Adm ...
- SQL Server中字符串转化为GUID的标量函数实现
还是工作中遇到的需求,有时候和外部的系统对接,进行数据的核对功能,外部的系统有时候主键字段列数据类是UNIQUEIDENTIFER(GUID)类型的字符串格式,去除了GUID格式中的分隔符“- ...
- dos2unix用法
windows下编写的脚本,上传到linux上执行,有时会出现莫名其妙的结果,也是折腾了半天才找出原因,windows和linux有些编码不同,经dos2unix处理后,结果一切正常man dos2u ...
- docker-6 管理工具
Shipyard 是一个基于 Web 的 Docker 管理工具,支持多 host,可以把多个 Docker host 上的 containers 统一管理:可以查看 images,甚至 build ...
- java 正则表达式的应用:读取文件,获取其中的电话号码
1.正则表达式 正则表达式,又称正规表示法.常规表示法(英语:Regular Expression,在代码中常简写为regex.regexp或RE),计算机科学的一个概念.正则表达式使用单个字符串来描 ...
- ELF Format 笔记(五)—— 特殊 Section
ilocker:关注 Android 安全(新入行,0基础) QQ: 2597294287 链接器把一些独立的 object files 和库文件链接起来,形成可执行文件.在这个过程中,链接器需要解决 ...
- Ubuntu14.02.2下安装JDK并配置Jetty服务器
首先第一步先取得JDK的安装文件,由于我的系统是64位的,所以安装包是jdk-7u80-linux-x64.gz 上传到unbuntu服务器下 执行tar -xvf jdk-7u80-linux-x6 ...
- Android ViewPager再探:增加滑动指示条
上一篇:<Android ViewPager初探:让页面滑动起来> ViewPager只是左右滑动有些丑,也不知道当前位于第几页面. 可以在上方加入滑动指示条,来确定当前位置. 只需要修改 ...
- ganglia安装简记
首先需要安装EPEL的源. yum install -y ganglia.x86_64 ganglia-gmetad.x86_64 ganglia-web.x86_64 ganglia-gmond.x ...