Hook GameUI function.

 #include <metahook.h>

 #include <IGameUI.h>

 IGameUI *g_pGameUI = ;

 void (__fastcall *g_pfnCGameUI_Initialize)(void *pthis, int edx, CreateInterfaceFn *factories, int count) = ;
void (__fastcall *g_pfnCGameUI_Start)(void *pthis, int edx, struct cl_enginefuncs_s *engineFuncs, int interfaceVersion, void *system) = ;
void (__fastcall *g_pfnCGameUI_Shutdown)(void *pthis, int edx) = ;
int (__fastcall *g_pfnCGameUI_ActivateGameUI)(void *pthis, int edx) = ;
int (__fastcall *g_pfnCGameUI_ActivateDemoUI)(void *pthis, int edx) = ;
int (__fastcall *g_pfnCGameUI_HasExclusiveInput)(void *pthis, int edx) = ;
void (__fastcall *g_pfnCGameUI_RunFrame)(void *pthis, int edx) = ;
void (__fastcall *g_pfnCGameUI_ConnectToServer)(void *pthis, int edx, const char *game, int IP, int port) = ;
void (__fastcall *g_pfnCGameUI_DisconnectFromServer)(void *pthis, int edx) = ;
void (__fastcall *g_pfnCGameUI_HideGameUI)(void *pthis, int edx) = ;
bool (__fastcall *g_pfnCGameUI_IsGameUIActive)(void *pthis, int edx) = ;
void (__fastcall *g_pfnCGameUI_LoadingStarted)(void *pthis, int edx, const char *resourceType, const char *resourceName) = ;
void (__fastcall *g_pfnCGameUI_LoadingFinished)(void *pthis, int edx, const char *resourceType, const char *resourceName) = ;
void (__fastcall *g_pfnCGameUI_StartProgressBar)(void *pthis, int edx, const char *progressType, int progressSteps) = ;
int (__fastcall *g_pfnCGameUI_ContinueProgressBar)(void *pthis, int edx, int progressPoint, float progressFraction) = ;
void (__fastcall *g_pfnCGameUI_StopProgressBar)(void *pthis, int edx, bool bError, const char *failureReason, const char *extendedReason) = ;
int (__fastcall *g_pfnCGameUI_SetProgressBarStatusText)(void *pthis, int edx, const char *statusText) = ;
void (__fastcall *g_pfnCGameUI_SetSecondaryProgressBar)(void *pthis, int edx, float progress) = ;
void (__fastcall *g_pfnCGameUI_SetSecondaryProgressBarText)(void *pthis, int edx, const char *statusText) = ; class CGameUI : public IGameUI
{
public:
void Initialize(CreateInterfaceFn *factories, int count);
void Start(struct cl_enginefuncs_s *engineFuncs, int interfaceVersion, void *system);
void Shutdown(void);
int ActivateGameUI(void);
int ActivateDemoUI(void);
int HasExclusiveInput(void);
void RunFrame(void);
void ConnectToServer(const char *game, int IP, int port);
void DisconnectFromServer(void);
void HideGameUI(void);
bool IsGameUIActive(void);
void LoadingStarted(const char *resourceType, const char *resourceName);
void LoadingFinished(const char *resourceType, const char *resourceName);
void StartProgressBar(const char *progressType, int progressSteps);
int ContinueProgressBar(int progressPoint, float progressFraction);
void StopProgressBar(bool bError, const char *failureReason, const char *extendedReason = NULL);
int SetProgressBarStatusText(const char *statusText);
void SetSecondaryProgressBar(float progress);
void SetSecondaryProgressBarText(const char *statusText);
}; void CGameUI::Initialize(CreateInterfaceFn *factories, int count)
{
return g_pfnCGameUI_Initialize(this, , factories, count);
} void CGameUI::Start(struct cl_enginefuncs_s *engineFuncs, int interfaceVersion, void *system)
{
return g_pfnCGameUI_Start(this, , engineFuncs, interfaceVersion, system);
} void CGameUI::Shutdown(void)
{
return g_pfnCGameUI_Shutdown(this, );
} int CGameUI::ActivateGameUI(void)
{
return g_pfnCGameUI_ActivateGameUI(this, );
} int CGameUI::ActivateDemoUI(void)
{
return g_pfnCGameUI_ActivateDemoUI(this, );
} int CGameUI::HasExclusiveInput(void)
{
return g_pfnCGameUI_HasExclusiveInput(this, );
} void CGameUI::RunFrame(void)
{
return g_pfnCGameUI_RunFrame(this, );
} void CGameUI::ConnectToServer(const char *game, int IP, int port)
{
return g_pfnCGameUI_ConnectToServer(this, , game, IP, port);
} void CGameUI::DisconnectFromServer(void)
{
return g_pfnCGameUI_DisconnectFromServer(this, );
} void CGameUI::HideGameUI(void)
{
return g_pfnCGameUI_HideGameUI(this, );
} bool CGameUI::IsGameUIActive(void)
{
return g_pfnCGameUI_IsGameUIActive(this, );
} void CGameUI::LoadingStarted(const char *resourceType, const char *resourceName)
{
return g_pfnCGameUI_LoadingStarted(this, , resourceType, resourceName);
} void CGameUI::LoadingFinished(const char *resourceType, const char *resourceName)
{
return g_pfnCGameUI_LoadingFinished(this, , resourceType, resourceName);
} void CGameUI::StartProgressBar(const char *progressType, int progressSteps)
{
return g_pfnCGameUI_StartProgressBar(this, , progressType, progressSteps);
} int CGameUI::ContinueProgressBar(int progressPoint, float progressFraction)
{
return g_pfnCGameUI_ContinueProgressBar(this, , progressPoint, progressFraction);
} void CGameUI::StopProgressBar(bool bError, const char *failureReason, const char *extendedReason)
{
return g_pfnCGameUI_StopProgressBar(this, , bError, failureReason, extendedReason);
} int CGameUI::SetProgressBarStatusText(const char *statusText)
{
return g_pfnCGameUI_SetProgressBarStatusText(this, , statusText);
} void CGameUI::SetSecondaryProgressBar(float progress)
{
return g_pfnCGameUI_SetSecondaryProgressBar(this, , progress);
} void CGameUI::SetSecondaryProgressBarText(const char *statusText)
{
return g_pfnCGameUI_SetSecondaryProgressBarText(this, , statusText);
} void GameUI_InstallHook(void)
{
CreateInterfaceFn GameUICreateInterface = Sys_GetFactory((HINTERFACEMODULE)GetModuleHandleA("GameUI.dll"));
g_pGameUI = (IGameUI *)GameUICreateInterface(GAMEUI_INTERFACE_VERSION, ); CGameUI GameUI;
DWORD *pVFTable = *(DWORD **)&GameUI; g_pMetaHookAPI->VFTHook(g_pGameUI, , , (void *)pVFTable[ ], (void *&)g_pfnCGameUI_Initialize);
g_pMetaHookAPI->VFTHook(g_pGameUI, , , (void *)pVFTable[ ], (void *&)g_pfnCGameUI_Start);
g_pMetaHookAPI->VFTHook(g_pGameUI, , , (void *)pVFTable[ ], (void *&)g_pfnCGameUI_Shutdown);
g_pMetaHookAPI->VFTHook(g_pGameUI, , , (void *)pVFTable[ ], (void *&)g_pfnCGameUI_ActivateGameUI);
g_pMetaHookAPI->VFTHook(g_pGameUI, , , (void *)pVFTable[ ], (void *&)g_pfnCGameUI_ActivateDemoUI);
g_pMetaHookAPI->VFTHook(g_pGameUI, , , (void *)pVFTable[ ], (void *&)g_pfnCGameUI_HasExclusiveInput);
g_pMetaHookAPI->VFTHook(g_pGameUI, , , (void *)pVFTable[ ], (void *&)g_pfnCGameUI_RunFrame);
g_pMetaHookAPI->VFTHook(g_pGameUI, , , (void *)pVFTable[ ], (void *&)g_pfnCGameUI_ConnectToServer);
g_pMetaHookAPI->VFTHook(g_pGameUI, , , (void *)pVFTable[ ], (void *&)g_pfnCGameUI_DisconnectFromServer);
g_pMetaHookAPI->VFTHook(g_pGameUI, , , (void *)pVFTable[], (void *&)g_pfnCGameUI_HideGameUI);
g_pMetaHookAPI->VFTHook(g_pGameUI, , , (void *)pVFTable[], (void *&)g_pfnCGameUI_IsGameUIActive);
g_pMetaHookAPI->VFTHook(g_pGameUI, , , (void *)pVFTable[], (void *&)g_pfnCGameUI_LoadingStarted);
g_pMetaHookAPI->VFTHook(g_pGameUI, , , (void *)pVFTable[], (void *&)g_pfnCGameUI_LoadingFinished);
g_pMetaHookAPI->VFTHook(g_pGameUI, , , (void *)pVFTable[], (void *&)g_pfnCGameUI_StartProgressBar);
g_pMetaHookAPI->VFTHook(g_pGameUI, , , (void *)pVFTable[], (void *&)g_pfnCGameUI_ContinueProgressBar);
g_pMetaHookAPI->VFTHook(g_pGameUI, , , (void *)pVFTable[], (void *&)g_pfnCGameUI_StopProgressBar);
g_pMetaHookAPI->VFTHook(g_pGameUI, , , (void *)pVFTable[], (void *&)g_pfnCGameUI_SetProgressBarStatusText);
g_pMetaHookAPI->VFTHook(g_pGameUI, , , (void *)pVFTable[], (void *&)g_pfnCGameUI_SetSecondaryProgressBar);
g_pMetaHookAPI->VFTHook(g_pGameUI, , , (void *)pVFTable[], (void *&)g_pfnCGameUI_SetSecondaryProgressBarText);
}

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

  1. [MetaHook] BaseUI hook

    Hook IBaseUI function. #include <metahook.h> #include <IBaseUI.h> IBaseUI *g_pBaseUI = ; ...

  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. WPF学习之路(九)导航链接

    Hyperlink WPF中超链接类型是Hyperlink,除了能在页面之间导航,还能再同一个页面下进行段落导航 实例: <Grid> <FlowDocumentReader> ...

  2. 8、需求分析师要阅读的书籍 - IT软件人员书籍系列文章

    需求分析是软件项目开始阶段重要的一步.而需求分析是项目经理或产品经理需要经历的一环,所以说需求分析是项目经理或产品经理需要具备的知识.但是,项目角色中却分离出了需求分析师这个角色,也就是说,在大型的或 ...

  3. VBS进行http请求及JSON数据的读取和生成

    背景: 近期帮一个公司做第三方API的二次封装,需要部署到该公司网站.所获取的是Json数据格式.由于该公司原系统采用的ASP+VBS技术方案,因此采用VBS对API进行请求.封装. 实现: 废话不多 ...

  4. (转,有改动)测试网页响应时间的shell脚本[需要curl支持]

    用法及返回结果如下: [root@myserver01 tmp]# sh test_web.sh -n500 http://www.baidu.com Request url: http://www. ...

  5. IntelliJ IDEA14.1中java项目Maven中没有配置JDK时的问题

    在IntelliJ IDEA 14.1中使用在java项目中使用Maven时当没有在Maven中配置JDK编译版本.源码版本时,IDEA将默认的编译版本.源码版本设置为jdk5. 在IDEA中Lang ...

  6. shell执行mysql命令

    难点主要在参数的传递方式吧,不过查资料后发现很简单. 1.使用-e参数传递命令,适用于简单语句      mysql -uuser -ppasswd -e "create database ...

  7. HTTP 请求报文 响应报文

    引言 超文本传输协议(HTTP,HyperText Transfer Protocol)是互联网上应用最为广泛的一种网络协议.所有的WWW文件都必须遵守这个标准.设计HTTP最初的目的是为了提供一种发 ...

  8. 在Ubuntu上安装docker常见问题

    安装完docker之后,发现docker是装好了,但是运行docker就会报“Segmentation Fault or Critical Error encountered. Dumping cor ...

  9. DevOps Workshop 研发运维一体化第一场(微软亚太研发集团总部)

    准备了近两周,写了大量的操作手册,设计了大量的动手实验场景,终于在中关村的微软大厦完成了两天的DevOps培训. 最初报名160人,按照之前的培训经验,一般能到一半就不错了,没想到这次现场登记人员就超 ...

  10. 用FineReport做的共建共享填报系统

    一.应用背景 随着信息技术的不断发展,快速开发出适合用户业务需求发展的填报报表是势在必然的,因此在不断的研究和分析下针对这一业务特点制作了此报表系统,以使不同开发商之间共建共享数据进行填报和统计分析的 ...