Skip to content

Commit

Permalink
Merge pull request #99 from Deji69/master
Browse files Browse the repository at this point in the history
Add hooks for loading screen detection
  • Loading branch information
OrfeasZ authored Mar 21, 2024
2 parents 38bef54 + 08ea96c commit a243d1a
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 1 deletion.
5 changes: 4 additions & 1 deletion ZHMModSDK/Include/Hooks.h
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,10 @@ class ZHMSDK_API Hooks
static Hook<TEntityRef<ZHitman5>*(ZPlayerRegistry* th, TEntityRef<ZHitman5>* out)>* ZPlayerRegistry_GetLocalPlayer;
static Hook<void(ZDynamicPageController* th, ZDynamicObject& data, void* a3, void* a4, void* a5)>* ZDynamicPageController_Expand;
static Hook<void(ZDynamicPageController* th, ZDynamicObject& actionObj, void* menuNode)>* ZDynamicPageController_HandleActionObject2;
static Hook<EOS_PlatformHandle*(EOS_Platform_Options* Options)>* EOS_Platform_Create;
static Hook<void*(void* th, void* a2)>* ZLevelManagerStateCondition_ZLevelManagerStateCondition;
static Hook<void*(void* th, void* a1)>* ZLoadingScreenVideo_ActivateLoadingScreen;
static Hook<bool(void* th, void* a1)>* ZLoadingScreenVideo_StartNewVideo;
static Hook<EOS_PlatformHandle*(EOS_Platform_Options* Options)>* EOS_Platform_Create;
//static Hook<void(ZTemplateEntityFactory* th, ZEntityRef entity, void* a3, void* a4)>* ZTemplateEntityFactory_ConfigureEntity;
//static Hook<void(ZCppEntityFactory* th, ZEntityRef entity, void* a3, void* a4)>* ZCppEntityFactory_ConfigureEntity;
//static Hook<void(ZBehaviorTreeEntityFactory* th, ZEntityRef entity, void* a3, void* a4)>* ZBehaviorTreeEntityFactory_ConfigureEntity;
Expand Down
21 changes: 21 additions & 0 deletions ZHMModSDK/Src/Hooks.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -314,6 +314,27 @@ PATTERN_HOOK(
void(ZDynamicPageController* th, ZDynamicObject& actionObj, void* menuNode)
);

PATTERN_HOOK(
"\x40\x53\x48\x83\xEC\x00\x48\x8B\xD9\x48\x8D\x0D\x00\x00\x00\x00\xFF\x15\x00\x00\x00\x00\x48\x8B\xCB\xE8\x00\x00\x00\x00\x83\xBB\xE8\x00\x00\x00",
"xxx????xxxxxxxxxxxxx????xxxxxx????xxxxxxxxxxx????xxx????x???????xxx????xxxxxxxxxxxxx????xxxxxxxxxx????xxx????x??xxx",
ZLevelManagerStateCondition_ZLevelManagerStateCondition,
void*(void* th, void* a2)
);

PATTERN_HOOK(
"\x48\x89\x5C\x24\x08\x48\x89\x74\x24\x10\x57\x48\x83\xEC\x00\x48\x8B\xF9\x0F\xB6\xDA\x48\x8D\x0D",
"xxxxxxxxxxxxxx?xxxxxxxxx",
ZLoadingScreenVideo_ActivateLoadingScreen,
void*(void* th, void* a1)
);

PATTERN_HOOK(
"\x40\x53\x48\x83\xEC\x00\x48\x8B\xD9\x48\x8D\x0D\x00\x00\x00\x00\xFF\x15\x00\x00\x00\x00\x48\x8B\xCB\xE8\x00\x00\x00\x00\x83\xBB\xE8\x00\x00\x00",
"xxxxx?xxxxxx????xx????xxxx????xxxxxx",
ZLoadingScreenVideo_StartNewVideo,
bool(void* th, void* a1)
);

MODULE_HOOK(
"EOSSDK-Win64-Shipping.dll",
"EOS_Platform_Create",
Expand Down

0 comments on commit a243d1a

Please sign in to comment.