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);
}

最新文章

  1. 关于网络-get/post
  2. 最快让你上手ReactiveCocoa之进阶篇
  3. 【转】数据库无关的GO语言ORM - hood
  4. [No000017]单词拼写记不住?试试这俩方法-单词拼写,怎么记又快又好?
  5. Android 签名比较
  6. [BZOJ4632]树的编码
  7. window.top、window.parent
  8. 对Spring from中日期显示格式化问题
  9. jspl零散知识点
  10. jsp中一些重要的问题
  11. kubernetes1.13.5安装部署
  12. SQLite占用资源少原因
  13. composer更改源为国际
  14. ng-click 发两次ajax请求的原因及解决方法
  15. 谈谈IE针对Ajax请求结果的缓存
  16. HDU - 3974 Assign the task (线段树区间修改+构建模型)
  17. 【Python】Docx解析
  18. Media change: please insert the disc labeled
  19. c实现 简单的文件管理 不含交互
  20. 让UpdatePanel支持文件上传(1):开始 .

热门文章

  1. Java基础知识学习(四)
  2. RPM方式安装MySQL5.5.48 (Aliyun CentOS 7.0 &amp; 卸载MySQL5.7)
  3. JavaScript Patterns 4.9 Configuration Objects
  4. cocos2d之json使用实例
  5. x01.Game.CubeRun: 风一样的女子
  6. linux 添加用户、权限
  7. android Java instanceof关键字
  8. C++ 中指针与引用的区别
  9. html特殊字符的html,js,css写法汇总
  10. 又是一周-AJAX(三)