├── .gitignore ├── ReHitman ├── Glacier │ ├── source │ │ ├── ZProjectile.cpp │ │ ├── ZProjectileBallistic.cpp │ │ ├── ZBaseConRout.cpp │ │ ├── ZEngineGeomControl.cpp │ │ ├── EventBase │ │ │ ├── ZEventBuffer.cpp │ │ │ └── ZLnkActionQueue.cpp │ │ ├── Geom │ │ │ ├── ZSNDOBJ.cpp │ │ │ ├── ZENVIRONMENT.cpp │ │ │ └── ZGROUP.cpp │ │ ├── ZActorCommunication.cpp │ │ ├── ZActorHeroCheckInside.cpp │ │ ├── CConfiguration.cpp │ │ ├── ZHumanBoid.cpp │ │ ├── ZCAMERA.cpp │ │ ├── ZMemory.cpp │ │ ├── CCom.cpp │ │ ├── ZGameStats.cpp │ │ ├── ZScriptC.cpp │ │ ├── CInventory.cpp │ │ ├── ZScheduledUpdate.cpp │ │ └── ZSTL │ │ │ └── ZHashBase.cpp │ ├── include │ │ └── Glacier │ │ │ ├── ZRenderViewD3D.h │ │ │ ├── Items │ │ │ ├── EDamageType.h │ │ │ ├── EWeaponOperation.h │ │ │ ├── ZItemTemplateContainer.h │ │ │ ├── ZItemAmmo.h │ │ │ ├── ZItemContainer.h │ │ │ ├── ZItemState.h │ │ │ └── ZItemTemplateAmmo.h │ │ │ ├── ZSTL │ │ │ ├── zstring.h │ │ │ ├── ZMemory.h │ │ │ ├── ZQElemsBuffer.h │ │ │ ├── ZPackedDictionary.h │ │ │ ├── ZPackedDataChunk.h │ │ │ ├── ZRTTI.h │ │ │ ├── ZOldTypeInfo.h │ │ │ ├── MYSTR.h │ │ │ ├── ALLOCREF.h │ │ │ └── ZLIST.h │ │ │ ├── Fysix │ │ │ ├── SExplosionInfo.h │ │ │ ├── SHitInfo.h │ │ │ ├── SRigidBodyVelocity.h │ │ │ └── COLI.h │ │ │ ├── Geom │ │ │ ├── ZSTDOBJ.h │ │ │ ├── ZSPOTLIGHTSQUARE.h │ │ │ ├── ZBOUND.h │ │ │ ├── ZSPOTLIGHT.h │ │ │ ├── ZOMNILIGHT.h │ │ │ ├── ZSNDOBJ.h │ │ │ ├── ZUSERLIGHT.h │ │ │ ├── ZENVIRONMENT.h │ │ │ ├── ZLIGHT.h │ │ │ ├── ZBoxPrimitive.h │ │ │ ├── ZGateLightSpot.h │ │ │ ├── ZGateLightSpotSquare.h │ │ │ ├── ZGateLightOmni.h │ │ │ └── ZEntityLocator.h │ │ │ ├── ZHandle.h │ │ │ ├── ZScheduledScript.h │ │ │ ├── ZIOInputStream.h │ │ │ ├── ZSDOwner.h │ │ │ ├── ZRenderObject.h │ │ │ ├── ZRenderMaterialClassD3D.h │ │ │ ├── ZListNodeBase.h │ │ │ ├── ZSetZDefine.h │ │ │ ├── ZELEVATORBOUND.h │ │ │ ├── ZRenderMaterialSubClassD3D.h │ │ │ ├── ZScriptC.h │ │ │ ├── ZOffsetAlloc.h │ │ │ ├── CProjectileActivate.h │ │ │ ├── Win32FWD.h │ │ │ ├── Glacier.h │ │ │ ├── ZGameStats.h │ │ │ ├── ZOpeningBase.h │ │ │ ├── ResourceCollection.h │ │ │ ├── CDoorBase.h │ │ │ ├── ZScheduledEvent.h │ │ │ ├── ZLinkedListHeader.hpp │ │ │ ├── ZWinEvents.h │ │ │ ├── ZActorCommunication.h │ │ │ ├── ZSysInputWintel.h │ │ │ ├── ZCameraSpace.h │ │ │ ├── ZDrawSurfaceD3D.h │ │ │ ├── AnimationManager.h │ │ │ ├── EventBase │ │ │ ├── ZLnkAction.h │ │ │ ├── ZLnkActionQueue.h │ │ │ └── ZEventBuffer.h │ │ │ ├── ZFactory.h │ │ │ ├── ZEngineGeomControl.h │ │ │ ├── ZBaseConRout.h │ │ │ ├── ZRenderMaterialLayerD3DFX.h │ │ │ ├── ZScheduledUpdate.h │ │ │ ├── ZBaseCamera.h │ │ │ ├── ZCTRLIKLNKOBJ.h │ │ │ ├── ZProjectile.h │ │ │ ├── CInventory.h │ │ │ ├── ZDrawBuffer.h │ │ │ ├── ZRenderDrawD3D.h │ │ │ ├── ZInputStream.h │ │ │ ├── Serializer │ │ │ └── IPackedInputVisitor.h │ │ │ ├── ZRenderEntryGeomD3D.h │ │ │ ├── IK │ │ │ └── ZIKHAND.h │ │ │ ├── ZActionManager.h │ │ │ ├── ZProjectileBallistic.h │ │ │ ├── ZTextureType.h │ │ │ └── ZGameData.h │ └── CMakeLists.txt ├── Modules │ ├── HF │ │ ├── tests │ │ │ ├── source │ │ │ │ ├── CodeExecutionOverride.cpp │ │ │ │ └── main.cpp │ │ │ └── CMakeLists.txt │ │ ├── README.md │ │ ├── CMakeLists.txt │ │ └── include │ │ │ └── HF │ │ │ └── HackingFrameworkFWD.h │ └── ImGui │ │ └── CMakeLists.txt ├── BloodMoney │ ├── source │ │ ├── Game │ │ │ ├── ZWheelChairLock.cpp │ │ │ ├── CEVENTCONTROLLER.cpp │ │ │ ├── UI │ │ │ │ ├── IWindowInterface.cpp │ │ │ │ ├── ZComponentWindow.cpp │ │ │ │ ├── ZStandardWindow.cpp │ │ │ │ ├── ZTTFONT.cpp │ │ │ │ ├── ZColorSet.cpp │ │ │ │ ├── ZKerningFont.cpp │ │ │ │ ├── ZLINEOBJ.cpp │ │ │ │ ├── ZWINOBJ.cpp │ │ │ │ ├── ZXMLGUISystem.cpp │ │ │ │ ├── ZGUIBase.cpp │ │ │ │ └── ZHM3MenuElements.cpp │ │ │ ├── ZClothTracker.cpp │ │ │ ├── Items │ │ │ │ └── ZHM3ItemBomb.cpp │ │ │ ├── PF4 │ │ │ │ └── PF4RunTime.cpp │ │ │ ├── CTelePortList.cpp │ │ │ ├── ZGuardQuarterController.cpp │ │ │ ├── CElevatorHouse.cpp │ │ │ ├── ZTie.cpp │ │ │ ├── OnLevel │ │ │ │ ├── CMetalDetector.cpp │ │ │ │ └── ZVCR.cpp │ │ │ ├── ZHM3Actor.cpp │ │ │ └── PF │ │ │ │ └── ZPathFollower.cpp │ │ ├── Engine │ │ │ ├── ZUTC4.cpp │ │ │ └── ZBoidSystem.cpp │ │ ├── Debug │ │ │ └── GizmosControl.cpp │ │ ├── UI │ │ │ ├── DebugWidget.cpp │ │ │ └── Widgets │ │ │ │ └── CutSequencePlayerWidget.cpp │ │ ├── Editors │ │ │ └── CutSequencesPool.cpp │ │ └── Delegates │ │ │ └── ImGuiInputDelegate.cpp │ ├── include │ │ └── BloodMoney │ │ │ ├── Game │ │ │ ├── UI │ │ │ │ ├── eZWUserEvents.h │ │ │ │ ├── ZHM3MenuFactory.h │ │ │ │ ├── UIFWD.h │ │ │ │ ├── ZStandardWindow.h │ │ │ │ ├── ZComponentWindow.h │ │ │ │ ├── ZKerningFont.h │ │ │ │ ├── EHM3Menu.h │ │ │ │ ├── ZTTFONT.h │ │ │ │ ├── ZStandardMenuFactory.h │ │ │ │ ├── ZGUIBase.h │ │ │ │ ├── ZColorSet.h │ │ │ │ ├── ZLINEOBJ.h │ │ │ │ ├── ZXMLGUISystem.h │ │ │ │ ├── ZHM3InventoryMenu.h │ │ │ │ ├── ZWINDOW.h │ │ │ │ ├── ZCHAROBJ.h │ │ │ │ ├── ZWINGROUP.h │ │ │ │ ├── ZFONT.h │ │ │ │ ├── ZSimpleDisplay.h │ │ │ │ └── ZHM3MenuElements.h │ │ │ ├── LevelControls │ │ │ │ └── ESecurityZone.h │ │ │ ├── Items │ │ │ │ ├── EHM3WeaponScope.h │ │ │ │ ├── ESilencerType.h │ │ │ │ ├── ZHM3ItemAmmo.h │ │ │ │ ├── ZHM3ItemTemplateBomb.h │ │ │ │ ├── ZHM3ItemTemplateAmmo.h │ │ │ │ ├── ZHM3ItemContainer.h │ │ │ │ ├── ZHM3ItemTemplateAmmoCustom.h │ │ │ │ ├── ZHM3ItemTemplate.h │ │ │ │ ├── ZHM3Item.h │ │ │ │ ├── ZHM3ItemTemplateContainer.h │ │ │ │ ├── ZHM3ItemWeaponCustomTemplate.h │ │ │ │ ├── ZHM3ItemWeaponCustom.h │ │ │ │ └── ZHM3ItemBomb.h │ │ │ ├── SIconBase.h │ │ │ ├── ZHM3GameStats.h │ │ │ ├── SMapGroup.h │ │ │ ├── PF4 │ │ │ │ └── PF4RunTime.h │ │ │ ├── ZTie.h │ │ │ ├── OnLevel │ │ │ │ ├── ZVCR.h │ │ │ │ ├── ZFireAlarm.h │ │ │ │ ├── CMetalDetector.h │ │ │ │ └── CKeycardReader.h │ │ │ ├── CEVENTCONTROLLER.h │ │ │ ├── CTelePortList.h │ │ │ ├── CCheat.h │ │ │ ├── ZUpgradeInfo.h │ │ │ ├── ZWheelChairLock.h │ │ │ ├── Globals.h │ │ │ ├── ZHM3ClothBundle.h │ │ │ ├── ZPodiumController.h │ │ │ ├── ZHM3HmAs.h │ │ │ ├── Actions │ │ │ │ └── ZHitmanAction.h │ │ │ ├── ZClothTracker.h │ │ │ ├── ZHM3WeaponUpgradeControl.h │ │ │ ├── SDifficultySettings.h │ │ │ ├── ZCloth.h │ │ │ ├── PF │ │ │ │ └── ZPathFollower.h │ │ │ ├── ZGuardQuarterController.h │ │ │ └── ZCheatMenu.h │ │ │ ├── Engine │ │ │ ├── ZGui.h │ │ │ ├── ZUTC4.h │ │ │ ├── ZHM3CameraClass.h │ │ │ ├── ZHM3CameraClassBase.h │ │ │ ├── ZHM3CameraBaseFunc.h │ │ │ ├── ZBoidSystem.h │ │ │ ├── ZHM3CameraBase.h │ │ │ ├── ZHM3OverlayCameraClass.h │ │ │ └── ZLoaderSequenceD3D.h │ │ │ ├── UI │ │ │ ├── ImGuiInspector.h │ │ │ ├── Widgets │ │ │ │ ├── SandboxWidget.h │ │ │ │ ├── ActorsListWidget.h │ │ │ │ ├── SceneViewer.h │ │ │ │ ├── PlayerTeleportWidget.h │ │ │ │ └── CutSequencePlayerWidget.h │ │ │ ├── DebugTools.h │ │ │ └── DebugWidget.h │ │ │ ├── Debug │ │ │ ├── Gizmo │ │ │ │ └── ActorsDebugGizmo.h │ │ │ └── GizmosControl.h │ │ │ ├── Patches │ │ │ ├── Mods │ │ │ │ └── SkinChanger.h │ │ │ ├── ModPack.h │ │ │ ├── All │ │ │ │ ├── RenderScenePatch.h │ │ │ │ ├── FreeFileSystemPatch.h │ │ │ │ ├── ZCutSequencePlayerPatch.h │ │ │ │ ├── EnableCheatsPatch.h │ │ │ │ ├── InputDevicesPatches.h │ │ │ │ ├── ZHitman3Patches.h │ │ │ │ ├── ZDirect3D9DevicePatches.h │ │ │ │ └── ZGEOMManagementPatch.h │ │ │ ├── BasicPatch.h │ │ │ └── CommonPatches.h │ │ │ ├── Delegates │ │ │ ├── ImGuiInputDelegate.h │ │ │ ├── IInputDelegate.h │ │ │ ├── IDirect3DDelegate.h │ │ │ └── DX9Delegate.h │ │ │ ├── Editors │ │ │ ├── CutSequencesPool.h │ │ │ └── LevelEditorGeomsPool.h │ │ │ ├── FreeFS │ │ │ └── HBMFreeFsProxy.h │ │ │ └── Client.h │ └── CMakeLists.txt ├── NVCPL │ ├── CMakeLists.txt │ └── README.md ├── Client │ ├── CMakeLists.txt │ └── include │ │ └── Client │ │ └── IClient.h ├── DLL │ ├── include │ │ └── DLL │ │ │ ├── DebugConsole.h │ │ │ ├── CrashHandlerReporter.h │ │ │ ├── ReHitman.h │ │ │ └── Logger.h │ └── source │ │ ├── DebugConsole.cpp │ │ ├── ReHitmanDLL.cpp │ │ └── Logger.cpp └── CMakeLists.txt ├── .github └── logo.png ├── CMakeLists.txt ├── .gitmodules └── appveyor.yml /.gitignore: -------------------------------------------------------------------------------- 1 | cmake-build* 2 | build 3 | .idea 4 | .vscode -------------------------------------------------------------------------------- /ReHitman/Glacier/source/ZProjectile.cpp: -------------------------------------------------------------------------------- 1 | #include -------------------------------------------------------------------------------- /.github/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ReGlacier/ReHitman/HEAD/.github/logo.png -------------------------------------------------------------------------------- /ReHitman/Glacier/source/ZProjectileBallistic.cpp: -------------------------------------------------------------------------------- 1 | #include -------------------------------------------------------------------------------- /ReHitman/Modules/HF/tests/source/CodeExecutionOverride.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | -------------------------------------------------------------------------------- /ReHitman/BloodMoney/source/Game/ZWheelChairLock.cpp: -------------------------------------------------------------------------------- 1 | #include -------------------------------------------------------------------------------- /ReHitman/BloodMoney/source/Game/CEVENTCONTROLLER.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | -------------------------------------------------------------------------------- /ReHitman/BloodMoney/source/Game/UI/IWindowInterface.cpp: -------------------------------------------------------------------------------- 1 | #include -------------------------------------------------------------------------------- /ReHitman/BloodMoney/source/Game/UI/ZComponentWindow.cpp: -------------------------------------------------------------------------------- 1 | #include -------------------------------------------------------------------------------- /ReHitman/BloodMoney/source/Game/UI/ZStandardWindow.cpp: -------------------------------------------------------------------------------- 1 | #include -------------------------------------------------------------------------------- /ReHitman/BloodMoney/source/Game/ZClothTracker.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | namespace Hitman::BloodMoney { 4 | 5 | } -------------------------------------------------------------------------------- /ReHitman/BloodMoney/include/BloodMoney/Game/UI/eZWUserEvents.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace Hitman::BloodMoney { 4 | enum class eZWUserEvents; 5 | } -------------------------------------------------------------------------------- /ReHitman/Glacier/include/Glacier/ZRenderViewD3D.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace Glacier { 4 | class ZRenderViewD3D { 5 | public: 6 | }; 7 | } -------------------------------------------------------------------------------- /ReHitman/BloodMoney/include/BloodMoney/Engine/ZGui.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace Hitman::BloodMoney 4 | { 5 | class ZGui 6 | { 7 | 8 | }; 9 | } -------------------------------------------------------------------------------- /CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.16) 2 | project(ReHitmanRoot) 3 | 4 | #TODO Check that we will compile only under x86! 5 | 6 | add_subdirectory(ReHitman) -------------------------------------------------------------------------------- /ReHitman/Modules/HF/README.md: -------------------------------------------------------------------------------- 1 | The Hacking Framework 2 | --------------------- 3 | 4 | Little framework to make hooks (vftable or static functions) from ReHitman project (HM3Function) -------------------------------------------------------------------------------- /ReHitman/BloodMoney/include/BloodMoney/Game/LevelControls/ESecurityZone.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace Hitman::BloodMoney 4 | { 5 | enum ESecurityZone 6 | { 7 | 8 | }; 9 | } -------------------------------------------------------------------------------- /ReHitman/Glacier/include/Glacier/Items/EDamageType.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace Glacier { 4 | enum class EDamageType { 5 | LETHAL = 0, 6 | TRANQUILIZING = 1 7 | }; 8 | } -------------------------------------------------------------------------------- /ReHitman/Modules/HF/tests/source/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int main(int argc, char** argv) 4 | { 5 | testing::InitGoogleTest(&argc, argv); 6 | return RUN_ALL_TESTS(); 7 | } -------------------------------------------------------------------------------- /ReHitman/NVCPL/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.17) 2 | project(NVCPL) 3 | 4 | set(CMAKE_CXX_STANDARD 14) 5 | 6 | add_library(NVCPL SHARED ${CMAKE_CURRENT_SOURCE_DIR}/Source/NVCPL.cpp) -------------------------------------------------------------------------------- /ReHitman/BloodMoney/include/BloodMoney/Game/Items/EHM3WeaponScope.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace Hitman::BloodMoney { 4 | enum class EHM3WeaponScope { 5 | eHiTech, 6 | eNoScope 7 | }; 8 | } -------------------------------------------------------------------------------- /ReHitman/BloodMoney/include/BloodMoney/Engine/ZUTC4.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace Hitman::BloodMoney 4 | { 5 | class ZUTC4 6 | { 7 | public: 8 | static int GetNextUTC4Char(const char*&); 9 | }; 10 | } -------------------------------------------------------------------------------- /ReHitman/BloodMoney/include/BloodMoney/UI/ImGuiInspector.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | namespace ImGui 6 | { 7 | // Default impl 8 | template struct Inspector { static void Draw(const char* id, T*) {} }; 9 | } -------------------------------------------------------------------------------- /ReHitman/Glacier/include/Glacier/ZSTL/zstring.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace Glacier 4 | { 5 | class zstring 6 | { 7 | public: 8 | char* str; 9 | int length; 10 | int m_field8; //? 11 | }; 12 | } -------------------------------------------------------------------------------- /ReHitman/NVCPL/README.md: -------------------------------------------------------------------------------- 1 | NVCPL 2 | ----- 3 | 4 | This is a new DLL injector for ReHitman project. Old 'Launcher' was deprecated. 5 | 6 | Usage 7 | ------ 8 | 9 | 1. Put NVCPL.dll & ReHitman.dll into folder with HitmanBloodMoney.exe 10 | 2. Run HitmanBloodMoney.exe -------------------------------------------------------------------------------- /ReHitman/BloodMoney/include/BloodMoney/Game/UI/ZHM3MenuFactory.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | namespace Hitman::BloodMoney 6 | { 7 | class ZHM3MenuFactory : public ZStandardMenuFactory 8 | { 9 | }; 10 | } -------------------------------------------------------------------------------- /ReHitman/Glacier/include/Glacier/Fysix/SExplosionInfo.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | namespace Glacier 6 | { 7 | struct SExplosionInfo 8 | { 9 | ZVector3 m_vector; 10 | float m_velocity; 11 | }; 12 | } -------------------------------------------------------------------------------- /ReHitman/Glacier/include/Glacier/Geom/ZSTDOBJ.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | namespace Glacier 6 | { 7 | class ZSTDOBJ : public ZGEOM 8 | { // no changes, same size, same vftable size (maybe something overridden) 9 | }; 10 | } -------------------------------------------------------------------------------- /ReHitman/Glacier/include/Glacier/Items/EWeaponOperation.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace Glacier { 4 | enum class EWeaponOperation : int { 5 | WO_MANUAL = 1, 6 | WO_SEMIAUTO = 2, 7 | WO_FULLAUTO = 4, 8 | WO_FULLAUTO3 = 8 9 | }; 10 | } -------------------------------------------------------------------------------- /ReHitman/Glacier/include/Glacier/ZHandle.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace Glacier 4 | { 5 | class ZActionMapTree; 6 | 7 | struct ZHandle 8 | { 9 | const char* hotkey; 10 | ZActionMapTree* m_field4; 11 | int m_pAction; 12 | }; 13 | } -------------------------------------------------------------------------------- /ReHitman/BloodMoney/include/BloodMoney/Game/SIconBase.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | namespace Hitman::BloodMoney 6 | { 7 | struct SIconBase 8 | { 9 | Glacier::ZREF m_iIconREF; 10 | bool m_bIsVisible; 11 | }; 12 | } -------------------------------------------------------------------------------- /ReHitman/Client/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.16) 2 | project(Client) 3 | set(CMAKE_CXX_STANDARD 20) 4 | 5 | add_library(Client INTERFACE) 6 | add_library(ReHitman::IClient ALIAS Client) 7 | 8 | target_include_directories(Client INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}/include) -------------------------------------------------------------------------------- /ReHitman/DLL/include/DLL/DebugConsole.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | namespace ReHitman 6 | { 7 | class DebugConsole 8 | { 9 | static bool g_bIsCreated; 10 | public: 11 | static void Create(std::string_view caption); 12 | }; 13 | } -------------------------------------------------------------------------------- /ReHitman/Modules/HF/tests/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.16) 2 | project(HFTests) 3 | 4 | file(GLOB_RECURSE HFTESTS_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/source/*.cpp) 5 | add_executable(HFTests ${HFTESTS_SOURCES}) 6 | target_link_libraries(HFTests PRIVATE gtest gtest_main HF::Core) -------------------------------------------------------------------------------- /ReHitman/Glacier/include/Glacier/ZScheduledScript.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | namespace Glacier { 6 | class ZScheduledScript : public ZScheduledEvent { 7 | public: 8 | //vftable (no changes) 9 | //data (no changes) 10 | }; 11 | } -------------------------------------------------------------------------------- /ReHitman/BloodMoney/include/BloodMoney/Debug/Gizmo/ActorsDebugGizmo.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | namespace Hitman::BloodMoney::Debug { 6 | struct ActorDebugGizmo { 7 | static void OnDrawGizmo(EGizmoLayer layer, IDirect3DDevice9* device); 8 | }; 9 | } -------------------------------------------------------------------------------- /ReHitman/Glacier/include/Glacier/ZIOInputStream.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace Glacier 4 | { 5 | class ZIOInputStream 6 | { 7 | public: 8 | // vftable 9 | virtual void Func0(); 10 | 11 | // data 12 | void* m_buffer; 13 | int m_size; 14 | }; 15 | } -------------------------------------------------------------------------------- /ReHitman/BloodMoney/include/BloodMoney/Game/UI/UIFWD.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace Hitman::BloodMoney 4 | { 5 | class ZWINGROUP; 6 | class ZWINDOW; 7 | class ZWINDOWS; 8 | class ZFONT; 9 | class ZCHAROBJ; 10 | class ZWinGfxHandler; 11 | 12 | using _evdata = unsigned int; 13 | } -------------------------------------------------------------------------------- /ReHitman/BloodMoney/include/BloodMoney/Game/Items/ESilencerType.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace Hitman::BloodMoney { 4 | enum class ESilencerType { 5 | eSilentWithNoEvent, 6 | eSilentOver20, 7 | eSilentUpTo20, 8 | eSilentLowVelocityAmmo, 9 | eNotSilent 10 | }; 11 | } -------------------------------------------------------------------------------- /ReHitman/BloodMoney/include/BloodMoney/Game/UI/ZStandardWindow.h: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | namespace Hitman::BloodMoney { 4 | class ZStandardWindow : public IWindowInterface { 5 | public: 6 | //vftable 7 | //data (total size is 0x15C, base size is 0x90) 8 | }; 9 | } -------------------------------------------------------------------------------- /ReHitman/DLL/include/DLL/CrashHandlerReporter.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | namespace ReHitman 6 | { 7 | class CrashHandlerReporter 8 | { 9 | std::intptr_t m_prevHandler; 10 | public: 11 | CrashHandlerReporter(); 12 | ~CrashHandlerReporter(); 13 | }; 14 | } -------------------------------------------------------------------------------- /ReHitman/Glacier/include/Glacier/Geom/ZSPOTLIGHTSQUARE.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | namespace Glacier { 6 | class ZSPOTLIGHTSQUARE : public ZLIGHT { 7 | public: 8 | //vftable (no changes) 9 | //data (total size is 0x20, base size is 0x20) 10 | }; 11 | } -------------------------------------------------------------------------------- /ReHitman/Glacier/include/Glacier/ZSDOwner.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace Glacier 4 | { 5 | struct ZSDOwner 6 | { 7 | int m_field0; 8 | char m_field4; 9 | char m_field5; 10 | char m_field6; 11 | char m_field7; 12 | int m_field8; 13 | int m_fieldC; 14 | }; 15 | } -------------------------------------------------------------------------------- /ReHitman/Modules/HF/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.16) 2 | project(HF CXX) 3 | set(CMAKE_CXX_STANDARD 20) 4 | 5 | # Root Project 6 | add_library(HF INTERFACE) 7 | add_library(HF::Core ALIAS HF) 8 | target_include_directories(HF INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}/include) 9 | 10 | # Tests 11 | add_subdirectory(tests) -------------------------------------------------------------------------------- /ReHitman/BloodMoney/include/BloodMoney/UI/Widgets/SandboxWidget.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | namespace Hitman::BloodMoney 6 | { 7 | class SandboxWidget final : public DebugWidget 8 | { 9 | static bool g_bIsVisible; 10 | public: 11 | void draw() override; 12 | }; 13 | } -------------------------------------------------------------------------------- /ReHitman/Modules/HF/include/HF/HackingFrameworkFWD.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | namespace HF::Win32 6 | { 7 | class Module; using ModuleRef = std::weak_ptr; using ModulePtr = std::shared_ptr; 8 | class Process; using ProcessRef = std::weak_ptr; using ProcessPtr = std::shared_ptr; 9 | } -------------------------------------------------------------------------------- /ReHitman/BloodMoney/include/BloodMoney/UI/Widgets/ActorsListWidget.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | namespace Hitman::BloodMoney 6 | { 7 | class ActorsListWidget final : public DebugWidget 8 | { 9 | public: 10 | static bool g_bIsOpened; 11 | 12 | void draw() override; 13 | }; 14 | } -------------------------------------------------------------------------------- /ReHitman/Glacier/include/Glacier/ZRenderObject.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace Glacier 4 | { 5 | class ZRenderObject 6 | { 7 | public: 8 | //vftable 9 | virtual void Release(bool doFreeMem); 10 | virtual void* CreateInstance(); 11 | virtual int DoSmth(); ///??? 12 | 13 | //data 14 | }; 15 | } -------------------------------------------------------------------------------- /ReHitman/Glacier/source/ZBaseConRout.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | 5 | namespace Glacier 6 | { 7 | ZBaseConRoutTypeInfo** ZBaseConRout::GetFactory() 8 | { 9 | return ((ZBaseConRoutTypeInfo**(__stdcall*)())G1ConfigurationService::G1API_FunctionAddress_ZBaseConRout_GetFactory)(); 10 | } 11 | } -------------------------------------------------------------------------------- /ReHitman/BloodMoney/include/BloodMoney/UI/Widgets/SceneViewer.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | 4 | #include 5 | 6 | 7 | namespace Hitman::BloodMoney 8 | { 9 | class SceneViewer final : public DebugWidget 10 | { 11 | public: 12 | void draw() override; 13 | 14 | static bool g_bIsVisible; 15 | }; 16 | } -------------------------------------------------------------------------------- /ReHitman/Glacier/include/Glacier/ZRenderMaterialClassD3D.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace Glacier 4 | { 5 | class ZRenderMaterialClassD3D 6 | { 7 | public: 8 | //vftable 9 | virtual void Release(bool); 10 | 11 | //data 12 | char* m_name; 13 | char* m_name2; 14 | int m_fieldC; 15 | }; 16 | } -------------------------------------------------------------------------------- /ReHitman/BloodMoney/include/BloodMoney/Game/UI/ZComponentWindow.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | namespace Hitman::BloodMoney { 6 | class ZComponentWindow : public IWindowInterface { 7 | public: 8 | //vftable (no changes) 9 | //data (total size is 0x39C, base size is 0x90) 10 | }; 11 | } -------------------------------------------------------------------------------- /ReHitman/BloodMoney/include/BloodMoney/UI/Widgets/PlayerTeleportWidget.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | namespace Hitman::BloodMoney 6 | { 7 | class PlayerTeleportWidget final : public DebugWidget 8 | { 9 | public: 10 | static bool g_bIsShowed; 11 | 12 | void draw() override; 13 | }; 14 | } -------------------------------------------------------------------------------- /ReHitman/BloodMoney/include/BloodMoney/UI/Widgets/CutSequencePlayerWidget.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | namespace Hitman::BloodMoney 6 | { 7 | class CutSequencePlayerWidget final : public DebugWidget 8 | { 9 | public: 10 | static bool g_bIsShowed; 11 | 12 | void draw() override; 13 | }; 14 | } -------------------------------------------------------------------------------- /ReHitman/Glacier/include/Glacier/ZListNodeBase.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | namespace Glacier 6 | { 7 | struct ZListNodeBase 8 | { 9 | struct ZListNodeBase* pNext; // +0 10 | struct ZListNodeBase* pPrev; // +4 11 | int32_t mId; // +8 12 | float m_unk0; // +C 13 | }; 14 | } -------------------------------------------------------------------------------- /ReHitman/Glacier/include/Glacier/ZSetZDefine.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | namespace Glacier { 6 | class ZSetZDefine : public ZEventBase { 7 | public: 8 | //vftable (no changes) 9 | //data (total size is 0x38, base size is 0x30) 10 | int m_field30; 11 | int m_field34; 12 | }; 13 | } -------------------------------------------------------------------------------- /ReHitman/Glacier/include/Glacier/Geom/ZBOUND.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | namespace Glacier { 6 | class ZBOUND : public ZSTDOBJ { 7 | public: 8 | //vftable 9 | void Draw(ZDrawBuffer* pDrawBuffer, ZCAMERA* pCamera, const float* a2, const float* a3); 10 | //data (total size is 0x10, base size is 0x10) 11 | }; 12 | } -------------------------------------------------------------------------------- /ReHitman/Glacier/include/Glacier/ZSTL/ZMemory.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace Glacier 4 | { 5 | /** 6 | * @struct UseManagedAllocator 7 | * @brief Wrapper under Glacier's ZMalloc, ZFree functions 8 | */ 9 | struct UseManagedAllocator 10 | { 11 | void* operator new(size_t sz); 12 | void operator delete(void* ptr) noexcept; 13 | }; 14 | } -------------------------------------------------------------------------------- /ReHitman/BloodMoney/include/BloodMoney/Game/ZHM3GameStats.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | namespace Hitman::BloodMoney { 6 | class ZHM3GameStats : public Glacier::ZGameStats { 7 | public: 8 | //vftable (no changes) 9 | //data (total size is 0x14, base size is 0xC) 10 | int m_fieldC; 11 | int m_field10; 12 | }; 13 | } -------------------------------------------------------------------------------- /ReHitman/BloodMoney/include/BloodMoney/Game/Items/ZHM3ItemAmmo.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | 6 | namespace Hitman::BloodMoney 7 | { 8 | class ZHM3ItemAmmo : public Glacier::ZItemAmmo 9 | { 10 | public: 11 | // vftable 12 | virtual EHM3ItemType GetHM3ItemType(); 13 | }; 14 | } -------------------------------------------------------------------------------- /ReHitman/BloodMoney/include/BloodMoney/Game/SMapGroup.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | namespace Hitman::BloodMoney 6 | { 7 | struct SMapGroup 8 | { 9 | int m_unk0; //0x0000 10 | Glacier::ZREF m_ROOM_REF; //0x0004 (ZGROUP or derived from ZGROUP) 11 | char* m_name; //0x0008 12 | }; //Size is 0xC 13 | } -------------------------------------------------------------------------------- /ReHitman/BloodMoney/include/BloodMoney/Game/UI/ZKerningFont.h: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | namespace Hitman::BloodMoney { 4 | class ZKerningFont : public ZTTFONT { 5 | public: 6 | // vftable 7 | // custom api 8 | static ZKerningFont* Create(); 9 | 10 | // data (size is 0x9C, base size is 0x98) 11 | int m_field98; 12 | }; 13 | } -------------------------------------------------------------------------------- /ReHitman/Glacier/include/Glacier/ZSTL/ZQElemsBuffer.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace Glacier 4 | { 5 | 6 | class ZQElemsBuffer 7 | { 8 | public: 9 | // data 10 | int m_field4; 11 | int m_field8; 12 | int m_fieldC; 13 | int m_field10; 14 | int m_field14; 15 | 16 | // vftable 17 | virtual void Release(); 18 | }; 19 | } -------------------------------------------------------------------------------- /ReHitman/Glacier/include/Glacier/ZELEVATORBOUND.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | 6 | namespace Glacier 7 | { 8 | class ZELEVATORBOUND : public ZSTDOBJ 9 | { 10 | public: 11 | // vtable (not changed) 12 | 13 | // data (total size is 0x2C) 14 | Glacier::ZVector3 m_topPoint; 15 | Glacier::ZVector3 m_bottomPoint; 16 | }; 17 | } -------------------------------------------------------------------------------- /ReHitman/BloodMoney/include/BloodMoney/Game/PF4/PF4RunTime.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace Hitman::BloodMoney::PF4RunTime { 4 | class ZData { 5 | public: 6 | //vtable 7 | virtual void Release(bool bFreeMem); 8 | 9 | //static 10 | ZData* CreatePathFinder(void* pData); 11 | //data (total size is 0x5E80) 12 | int m_field4; 13 | //TODO: Complete reverse here 14 | }; 15 | } -------------------------------------------------------------------------------- /ReHitman/Glacier/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.16) 2 | project(BloodMoney) 3 | set(CMAKE_CXX_STANDARD 20) 4 | 5 | file(GLOB_RECURSE GLACIER_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/source/*.cpp) 6 | 7 | add_library(Glacier STATIC ${GLACIER_SOURCES}) 8 | add_library(G1::Core ALIAS Glacier) 9 | target_include_directories(Glacier PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/include) 10 | 11 | target_link_libraries(Glacier PUBLIC HF::Core) -------------------------------------------------------------------------------- /ReHitman/BloodMoney/include/BloodMoney/Game/ZTie.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | namespace Hitman::BloodMoney 6 | { 7 | class ZTie : public ZCloth 8 | { 9 | public: 10 | // vftable (no changes) 11 | // api 12 | void HideTie(bool); 13 | void HideTieInMirror(bool); 14 | // Data (total size is 0xB4, ZCloth size is 0xB0) 15 | int field_B0; 16 | }; 17 | } -------------------------------------------------------------------------------- /ReHitman/Glacier/include/Glacier/ZRenderMaterialSubClassD3D.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace Glacier 4 | { 5 | class ZRenderMaterialClassD3D; 6 | class ZRenderMaterialLayerD3DFX; 7 | 8 | class ZRenderMaterialSubClassD3D 9 | { 10 | public: 11 | // vftable 12 | virtual void Release(bool); 13 | 14 | // data 15 | char* name; 16 | ZRenderMaterialClassD3D* m_materialClass; 17 | 18 | 19 | }; 20 | } -------------------------------------------------------------------------------- /ReHitman/BloodMoney/include/BloodMoney/Game/UI/EHM3Menu.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace Hitman::BloodMoney 4 | { 5 | enum EHM3Menu : unsigned int { 6 | Briefing = 0, 7 | InGameMenu = 1, 8 | UnknownDemoMapWindow = 2, 9 | Map = 3, 10 | TutorialMenu = 4, 11 | InventoryMenu = 5, 12 | LoadResultMenu = 6, 13 | LoadSuccessMenu = LoadResultMenu, 14 | LoadErrorMenu = LoadResultMenu 15 | }; 16 | } -------------------------------------------------------------------------------- /ReHitman/Glacier/include/Glacier/Geom/ZSPOTLIGHT.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | namespace Glacier { 6 | class ZSPOTLIGHT : public ZLIGHT { 7 | public: 8 | //vftable 9 | virtual float GetHotSpotAngle(); 10 | virtual float GetFallOffAngle(); 11 | virtual float GetNearRange(); 12 | virtual float GetFarRange(); 13 | 14 | //data (total size is 0x20, base size is 0x20) 15 | }; 16 | } -------------------------------------------------------------------------------- /ReHitman/Glacier/include/Glacier/Items/ZItemTemplateContainer.h: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | namespace Glacier 5 | { 6 | class ZItemTemplateContainer : public ZItemTemplate 7 | { 8 | public: 9 | //vftable 10 | virtual bool CanContainItem(const ZItem* item); 11 | 12 | //data (total size is 0x90 , ZItemTemplate size is 0x74) 13 | REFTAB m_containedItems; 14 | }; 15 | } -------------------------------------------------------------------------------- /ReHitman/BloodMoney/include/BloodMoney/Patches/Mods/SkinChanger.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | 6 | namespace Hitman::BloodMoney 7 | { 8 | class SkinChanger final : public BasicPatch 9 | { 10 | public: 11 | std::string_view GetName() const override; 12 | bool Apply(const ModPack& modules) override; 13 | void Revert(const ModPack& modules) override; 14 | }; 15 | } -------------------------------------------------------------------------------- /ReHitman/BloodMoney/include/BloodMoney/Patches/ModPack.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | namespace Hitman::BloodMoney 6 | { 7 | /** 8 | * @struct ModPack 9 | * @brief Just a pack of modules who will be passed into Patch::Apply & Patch::Revert method 10 | */ 11 | struct ModPack 12 | { 13 | HF::Win32::ProcessRef process; 14 | HF::Win32::ModuleRef self; 15 | HF::Win32::ModuleRef d3d9; 16 | }; 17 | } -------------------------------------------------------------------------------- /ReHitman/Glacier/include/Glacier/Geom/ZOMNILIGHT.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | namespace Glacier { 6 | class ZOMNILIGHT : public ZLIGHT { 7 | public: 8 | //vftable 9 | virtual void SetNearRange(float value); 10 | virtual void SetFarRange(float value); 11 | virtual float GetNearRange(); 12 | virtual float GetFarRange(); 13 | 14 | //data (total size is 0x20, base size is 0x20) 15 | }; 16 | } -------------------------------------------------------------------------------- /ReHitman/Glacier/include/Glacier/ZScriptC.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | namespace Glacier 6 | { 7 | class ZScriptC : public ZEventBase 8 | { 9 | public: 10 | // vftable 11 | 12 | // api 13 | int FindScript(const char* scriptName); 14 | int CreateScript(int pScriptCreator); 15 | 16 | // data (0x38) 17 | int m_pScriptsTable; //+0x30 18 | int m_field34; 19 | }; 20 | } -------------------------------------------------------------------------------- /ReHitman/BloodMoney/include/BloodMoney/Game/UI/ZTTFONT.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | namespace Hitman::BloodMoney { 6 | class ZTTFONT : public ZFONT 7 | { 8 | public: 9 | // vftable 10 | // custom api 11 | static ZTTFONT* Create(); 12 | 13 | // data (size is 0x98, base size is 0x88) 14 | int m_field88; 15 | int m_field8C; 16 | int m_field90; 17 | int m_field94; 18 | }; 19 | } -------------------------------------------------------------------------------- /ReHitman/Glacier/include/Glacier/ZOffsetAlloc.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace Glacier { 4 | class ZOffsetAlloc { 5 | public: 6 | // virtual methods 7 | virtual ~ZOffsetAlloc(); 8 | 9 | // data 10 | int m_field0; 11 | void* m_pLocation; 12 | int m_field8; 13 | int m_iChunkSize; //RLY? 14 | bool m_bIsPlacementAllocated; 15 | bool m_field11; 16 | bool m_field12; 17 | bool m_field13; 18 | }; 19 | } -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "ReHitman/Modules/fmt"] 2 | path = ReHitman/Modules/fmt 3 | url = https://github.com/fmtlib/fmt 4 | [submodule "ReHitman/Modules/spdlog"] 5 | path = ReHitman/Modules/spdlog 6 | url = https://github.com/gabime/spdlog 7 | [submodule "ReHitman/Modules/ImGui/imgui"] 8 | path = ReHitman/Modules/ImGui/imgui 9 | url = https://github.com/ocornut/imgui 10 | [submodule "ReHitman/Modules/gtest"] 11 | path = ReHitman/Modules/gtest 12 | url = https://github.com/google/googletest -------------------------------------------------------------------------------- /ReHitman/BloodMoney/include/BloodMoney/Game/OnLevel/ZVCR.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | namespace Hitman::BloodMoney 6 | { 7 | class ZVCR : public Glacier::ZEventBase 8 | { 9 | public: 10 | // vtbl (no changes) 11 | // custom api 12 | static void SetTapeStolen(bool value); 13 | static bool TapeWasStolen(); 14 | 15 | // data (size is 0x34) 16 | Glacier::ZAction* m_stealTapeAction; 17 | }; 18 | } -------------------------------------------------------------------------------- /ReHitman/BloodMoney/include/BloodMoney/Game/Items/ZHM3ItemTemplateBomb.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | namespace Hitman::BloodMoney 6 | { 7 | class ZHM3ItemTemplateBomb : public ZHM3ItemTemplateWeapon 8 | { 9 | public: 10 | // data (total size is 0x1B4, base size is 0x1A0) 11 | int m_field1A0; 12 | int m_field1A4; 13 | int m_field1A8; 14 | int m_field1AC; 15 | int m_field1B0; 16 | }; 17 | } -------------------------------------------------------------------------------- /ReHitman/Glacier/include/Glacier/Geom/ZSNDOBJ.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | namespace Glacier 6 | { 7 | class ZSNDOBJ : public ZSTDOBJ 8 | { 9 | public: 10 | // vftable 11 | virtual void ModifyGeomCon(int, int); 12 | 13 | // api 14 | bool AttachToDefaultRoom(bool a1); 15 | 16 | // data (total size is 0x1C, base size is 0x10) 17 | int m_field10; 18 | int m_field14; 19 | int m_field18; 20 | }; 21 | } -------------------------------------------------------------------------------- /ReHitman/Glacier/include/Glacier/ZSTL/ZPackedDictionary.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace Glacier 4 | { 5 | class ZPackedDictionary { 6 | public: 7 | // Virtual Functions 8 | virtual void Release_ZPackedDictionary(); //#0000 at 00439560 org ZPackedDictionary::~ZPackedDictionary() 9 | virtual void* GetToken(char const*); //#0001 at 0010CEF0 org ZPackedDictionary::GetToken(char const*) 10 | 11 | // Member Functions 12 | 13 | }; //End of ZPackedDictionary from 0054F248 14 | } -------------------------------------------------------------------------------- /ReHitman/Glacier/include/Glacier/Fysix/SHitInfo.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | namespace Glacier 6 | { 7 | struct SHitInfo 8 | { 9 | struct SUnknown; 10 | 11 | SUnknown* m_unk0; 12 | int m_field4; 13 | int m_ref8; 14 | int m_refC; 15 | }; 16 | 17 | struct SHitInfo::SUnknown { 18 | int m_field0; 19 | int m_field4; 20 | int m_field8; 21 | ZVector3 m_vec0; 22 | ZVector3 m_vec4; 23 | }; 24 | } -------------------------------------------------------------------------------- /ReHitman/Glacier/include/Glacier/ZSTL/ZPackedDataChunk.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | namespace Glacier 6 | { 7 | class ZPackedDataChunk 8 | { 9 | public: 10 | bool m_bufferWasFreed; 11 | bool __unused1__; 12 | bool __unused2__; 13 | bool __unused3__; 14 | uint8_t* m_buffer; 15 | uint32_t m_bufferSize; 16 | uint32_t m_uncompressedSize; 17 | int field_10; 18 | bool m_isUncompressedAlready; 19 | }; 20 | } -------------------------------------------------------------------------------- /ReHitman/BloodMoney/source/Engine/ZUTC4.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | namespace Hitman::BloodMoney 5 | { 6 | namespace Consts 7 | { 8 | constexpr std::intptr_t kGetNextUTC4CharFuncAddr = 0x004390C0; 9 | } 10 | 11 | int ZUTC4::GetNextUTC4Char(const char*& arg) 12 | { 13 | typedef int(__cdecl* GetNextUTC4Char_t)(const char*&); 14 | auto func = (GetNextUTC4Char_t)Consts::kGetNextUTC4CharFuncAddr; 15 | return func(arg); 16 | } 17 | } -------------------------------------------------------------------------------- /ReHitman/BloodMoney/include/BloodMoney/Engine/ZHM3CameraClass.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | #include 6 | 7 | namespace Hitman::BloodMoney 8 | { 9 | class ZHM3CameraClass : public ZHM3CameraClassBase 10 | { 11 | public: 12 | // vftable 13 | virtual void InitializeView(); 14 | 15 | // data (total size is 0x1AC, ZHM3CameraClassBase size is 0x1A8) 16 | int m_field1A8; 17 | }; 18 | } -------------------------------------------------------------------------------- /ReHitman/BloodMoney/include/BloodMoney/Engine/ZHM3CameraClassBase.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | namespace Hitman::BloodMoney 6 | { 7 | class ZHM3CameraClassBase : public Glacier::ZCAMERA 8 | { 9 | public: 10 | 11 | //data (total size is 0x1A8, ZCAMERA size is 0x18C) 12 | int m_field18C; 13 | int m_field190; 14 | int m_field194; 15 | int m_field198; 16 | int m_field19C; 17 | int m_field1A0; 18 | int m_field1A4; 19 | }; 20 | } -------------------------------------------------------------------------------- /ReHitman/BloodMoney/include/BloodMoney/Game/CEVENTCONTROLLER.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | 6 | namespace Hitman::BloodMoney { 7 | class CEVENTCONTROLLER { 8 | public: 9 | //vftable: no vftable 10 | //data (total size is 0x18) 11 | Glacier::REFTAB* m_refTab0; 12 | Glacier::LINKREFTAB* m_linkRefTab4; 13 | int m_field8; 14 | int m_fieldC; 15 | int m_field10; 16 | int m_field14; 17 | }; 18 | } -------------------------------------------------------------------------------- /ReHitman/BloodMoney/source/Game/UI/ZTTFONT.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | 5 | namespace Hitman::BloodMoney { 6 | ZTTFONT* ZTTFONT::Create() { 7 | if (BMConfigurationService::BMAPI_FunctionAddress_ZTTFONT_FactoryConstructor != BMConfigurationService::kNotConfiguredOption) { 8 | return ((ZTTFONT*(__cdecl*)())BMConfigurationService::BMAPI_FunctionAddress_ZTTFONT_FactoryConstructor)(); 9 | } 10 | return nullptr; 11 | } 12 | } -------------------------------------------------------------------------------- /ReHitman/BloodMoney/include/BloodMoney/Game/CTelePortList.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | 6 | namespace Hitman::BloodMoney { 7 | class CTelePortList : public Glacier::ZEventBase { 8 | public: 9 | // size is 0x3C 10 | int m_field30; 11 | int m_field34; 12 | Glacier::ZREF m_targetREF; // REF to entity who will be teleported to position 13 | 14 | // public API 15 | void TeleportToPointAtIndex(int index); 16 | }; 17 | } -------------------------------------------------------------------------------- /ReHitman/BloodMoney/include/BloodMoney/Game/Items/ZHM3ItemTemplateAmmo.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | 6 | namespace Hitman::BloodMoney 7 | { 8 | class ZHM3ItemTemplateAmmo : public Glacier::ZItemTemplateAmmo 9 | { 10 | public: 11 | //vftable 12 | virtual EHM3ItemType GetHM3ItemType(); 13 | 14 | //data (total size is 0xA8, Glacier::ZItemTemplateAmmo size is 0xA4) 15 | EHM3ItemType m_itemType; 16 | }; 17 | } -------------------------------------------------------------------------------- /ReHitman/BloodMoney/source/Game/UI/ZColorSet.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | namespace Hitman::BloodMoney { 4 | uint32_t ZColorSet::GetColor(EColorIndex colorIndex) { 5 | switch (colorIndex) { 6 | case EColorIndex::NormalColor: 7 | return m_NormalColor; 8 | case EColorIndex::DisableColor: 9 | return m_DisableColor; 10 | case EColorIndex::FocusColor: 11 | return m_FocusColor; 12 | } 13 | 14 | return 0u; 15 | } 16 | } -------------------------------------------------------------------------------- /ReHitman/Glacier/include/Glacier/Geom/ZUSERLIGHT.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | namespace Glacier { 6 | class ZUSERLIGHT : public ZLIGHT { 7 | public: 8 | //vftable (no changes) 9 | //data (total size is 0x44, base size is 0x20) 10 | int m_field20; 11 | int m_field24; 12 | int m_field28; 13 | int m_field2C; 14 | int m_field30; 15 | int m_field34; 16 | int m_field38; 17 | int m_field3C; 18 | int m_field40; 19 | }; 20 | } -------------------------------------------------------------------------------- /ReHitman/Glacier/include/Glacier/Items/ZItemAmmo.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | namespace Glacier 6 | { 7 | class ZItemAmmo : public ZItem 8 | { 9 | public: 10 | // vftable 11 | virtual int GetNrProjectiles(); 12 | virtual int SetNrProjectiles(int value); 13 | virtual void AddNrProjectiles(int amount); 14 | virtual void SubNrProjectiles(int amount); 15 | 16 | // data (total size is 0x88, ZItem size is 0x84) 17 | int m_iNrOfProjectiles; 18 | }; 19 | } -------------------------------------------------------------------------------- /ReHitman/Client/include/Client/IClient.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace ReHitman::Client 4 | { 5 | class IClient 6 | { 7 | private: 8 | bool m_isOnline = true; 9 | 10 | public: 11 | virtual ~IClient() noexcept = default; 12 | 13 | virtual bool OnAttach() = 0; 14 | virtual void OnDestroy() = 0; 15 | virtual void Run() { m_isOnline = true; } 16 | 17 | [[nodiscard]] bool IsOnline() const { return m_isOnline; } 18 | protected: 19 | void Stop() { m_isOnline = false; } 20 | }; 21 | } -------------------------------------------------------------------------------- /ReHitman/Glacier/include/Glacier/CProjectileActivate.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | namespace Glacier { 6 | struct CProjectileActivate { 7 | Glacier::ZREF m_unkREF0; 8 | int m_field4; 9 | float m_field8; 10 | int m_fieldC; 11 | bool m_field10; 12 | bool m_field11; 13 | bool m_field12; 14 | bool m_field13; 15 | Glacier::ZVector3 m_vTargetPosition; 16 | float m_fPrecision; 17 | int m_field24; 18 | int m_field28; 19 | }; 20 | } -------------------------------------------------------------------------------- /ReHitman/Glacier/include/Glacier/Win32FWD.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | namespace Glacier 6 | { 7 | // Win32 API defs 8 | struct SYSTEMTIME 9 | { 10 | uint16_t wYear; 11 | uint16_t wMonth; 12 | uint16_t wDayOfWeek; 13 | uint16_t wDay; 14 | uint16_t wHour; 15 | uint16_t wMinute; 16 | uint16_t wSecond; 17 | uint16_t wMilliseconds; 18 | }; 19 | 20 | struct FILETIME { 21 | uint32_t dwLowDateTime; 22 | uint32_t dwHighDateTime; 23 | }; 24 | } -------------------------------------------------------------------------------- /ReHitman/BloodMoney/source/Game/UI/ZKerningFont.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | namespace Hitman::BloodMoney { 5 | ZKerningFont* ZKerningFont::Create() { 6 | if (BMConfigurationService::BMAPI_FunctionAddress_ZKerningFont_FactoryConstructor != BMConfigurationService::kNotConfiguredOption) { 7 | return ((ZKerningFont*(__cdecl*)())BMConfigurationService::BMAPI_FunctionAddress_ZKerningFont_FactoryConstructor)(); 8 | } 9 | return nullptr; 10 | } 11 | } -------------------------------------------------------------------------------- /ReHitman/Glacier/include/Glacier/Glacier.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | #include 6 | 7 | #include 8 | 9 | namespace Glacier 10 | { 11 | template 12 | T* getInterface(std::uintptr_t baseAddr) 13 | { 14 | return ((*(T**)baseAddr)); 15 | } 16 | 17 | namespace Animation 18 | { 19 | struct ActiveAnimation {}; 20 | struct Header {}; 21 | class ZMetaKey; 22 | } 23 | 24 | struct SBoneDefinition {}; 25 | } -------------------------------------------------------------------------------- /ReHitman/BloodMoney/include/BloodMoney/Delegates/ImGuiInputDelegate.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | namespace Hitman::BloodMoney 6 | { 7 | class ImGuiInputDelegate final : public IInputDelegate 8 | { 9 | public: 10 | void setKeyState(int keyCode, int state) override; 11 | void setMouseKeyState(int keyId, bool state) override; 12 | void setMouseWheelState(float dt) override; 13 | 14 | void onWindowsEvent(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) override; 15 | }; 16 | } -------------------------------------------------------------------------------- /ReHitman/Glacier/include/Glacier/ZGameStats.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | namespace Glacier 6 | { 7 | class ZGameStats 8 | { 9 | public: 10 | //vftable 11 | virtual void Release(bool); 12 | virtual float GetIntensity(); 13 | 14 | //api 15 | void IncreaseCurrentShotCount(); 16 | void DecreaseCurrentShotCount(); 17 | 18 | //data (total size is 0xC) 19 | unsigned short m_iShootCount; 20 | unsigned short m_field6; 21 | float m_fIntensity; 22 | }; 23 | } -------------------------------------------------------------------------------- /ReHitman/Glacier/source/ZEngineGeomControl.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | namespace Glacier 6 | { 7 | ZEngineGeomControl* ZEngineGeomControl::GetInstance() { 8 | if (G1ConfigurationService::G1API_InstanceAddress_ZEngineGeomControl != G1ConfigurationService::kNotConfiguredOption) { 9 | return reinterpret_cast(G1ConfigurationService::G1API_InstanceAddress_ZEngineGeomControl); 10 | } 11 | 12 | return nullptr; 13 | } 14 | } -------------------------------------------------------------------------------- /ReHitman/BloodMoney/include/BloodMoney/Game/Items/ZHM3ItemContainer.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | 6 | namespace Hitman::BloodMoney 7 | { 8 | class ZHM3ItemContainer : public Glacier::ZItemContainer 9 | { 10 | public: 11 | // vftable 12 | virtual EHM3ItemType GetHM3ItemType(); 13 | virtual bool IsDetectable(); 14 | 15 | // data (total size is 0xD0, ZItemContainer size is 0xC8) 16 | int m_fieldC8; 17 | int m_fieldCC; 18 | }; 19 | } -------------------------------------------------------------------------------- /ReHitman/BloodMoney/include/BloodMoney/Patches/All/RenderScenePatch.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | 6 | namespace Hitman::BloodMoney 7 | { 8 | class RenderScenePatch final : public BasicPatch 9 | { 10 | HF::Hook::TrampolinePtr<6> m_patch; 11 | public: 12 | RenderScenePatch() = default; 13 | 14 | std::string_view GetName() const override; 15 | bool Apply(const ModPack& modules) override; 16 | void Revert(const ModPack& modules) override; 17 | }; 18 | } -------------------------------------------------------------------------------- /ReHitman/BloodMoney/include/BloodMoney/Game/OnLevel/ZFireAlarm.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | 6 | namespace Hitman::BloodMoney 7 | { 8 | class ZFireAlarm : public Glacier::ZEventBase 9 | { 10 | /// vftable - no custom vftable 11 | /// data (total size : 0x48, ZEventBase size: 0x30) 12 | int m_field30; 13 | int m_field34; 14 | int m_field38; 15 | Glacier::REFTAB* m_listeners; 16 | Glacier::REFTAB* m_reftab40; 17 | int m_field44; 18 | }; 19 | } -------------------------------------------------------------------------------- /ReHitman/BloodMoney/include/BloodMoney/Patches/All/FreeFileSystemPatch.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | 6 | 7 | namespace Hitman::BloodMoney { 8 | class FreeFileSystemPatch final : public BasicPatch { 9 | HF::Hook::TrampolinePtr<10> m_FsZipConstructor; 10 | public: 11 | FreeFileSystemPatch() = default; 12 | 13 | std::string_view GetName() const override; 14 | bool Apply(const ModPack& modules) override; 15 | void Revert(const ModPack& modules) override; 16 | }; 17 | } -------------------------------------------------------------------------------- /ReHitman/BloodMoney/include/BloodMoney/UI/DebugTools.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | namespace Hitman::BloodMoney 6 | { 7 | class DebugTools : public DebugWidget 8 | { 9 | private: 10 | bool m_bIsVisible { false }; 11 | 12 | public: 13 | void draw() override; 14 | void toggleVisibility(); 15 | [[nodiscard]] bool isVisible() const; 16 | 17 | private: 18 | void onPreDraw(); 19 | void onPostDraw(); 20 | 21 | void drawLevelsTopMenu(); 22 | void drawTopMenu(); 23 | }; 24 | } -------------------------------------------------------------------------------- /ReHitman/BloodMoney/include/BloodMoney/Delegates/IInputDelegate.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | 6 | namespace Hitman::BloodMoney 7 | { 8 | class IInputDelegate 9 | { 10 | public: 11 | virtual ~IInputDelegate() noexcept = default; 12 | 13 | virtual void setKeyState(int keyCode, int state) {}; 14 | virtual void setMouseKeyState(int keyId, bool state) {}; 15 | virtual void setMouseWheelState(float dt) {}; 16 | 17 | virtual void onWindowsEvent(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) {}; 18 | }; 19 | } -------------------------------------------------------------------------------- /ReHitman/BloodMoney/include/BloodMoney/Game/Items/ZHM3ItemTemplateAmmoCustom.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | 6 | namespace Hitman::BloodMoney 7 | { 8 | class ZHM3ItemTemplateAmmoCustom : public ZHM3ItemTemplateAmmo 9 | { 10 | public: 11 | // data (total size is 0xC0, ZHM3ItemTemplateAmmo size is 0xA8) 12 | int m_fieldA8; 13 | int m_fieldAC; 14 | int m_fieldB0; 15 | int m_fieldB4; 16 | int m_fieldB8; 17 | int m_fieldBC; 18 | }; 19 | } -------------------------------------------------------------------------------- /ReHitman/BloodMoney/include/BloodMoney/Delegates/IDirect3DDelegate.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | namespace Hitman::BloodMoney 6 | { 7 | class IDirect3DDelegate 8 | { 9 | public: 10 | virtual ~IDirect3DDelegate() noexcept = default; 11 | 12 | virtual void OnInitialised(IDirect3DDevice9* device) = 0; 13 | virtual void OnPresent(IDirect3DDevice9* device) = 0; 14 | virtual void OnDeviceLost() = 0; 15 | virtual void OnReset(IDirect3DDevice9* device) = 0; 16 | virtual void OnDeviceRestored(IDirect3DDevice9* device) = 0; 17 | }; 18 | } -------------------------------------------------------------------------------- /ReHitman/BloodMoney/include/BloodMoney/Game/CCheat.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | #include 6 | 7 | namespace Glacier { 8 | class CInventory; 9 | } 10 | 11 | namespace Hitman::BloodMoney { 12 | class CCheat 13 | { 14 | public: 15 | static void GiveItem(Glacier::ZREF rItem); 16 | static void GiveItem(Glacier::ZGROUP* pWeaponsGroup, std::string_view sItemName); 17 | static void GiveItem(Glacier::CInventory* pInventory, std::string_view sItemName, unsigned int iCount = 1); 18 | static void GiveSome(); 19 | }; 20 | } -------------------------------------------------------------------------------- /ReHitman/BloodMoney/source/Game/UI/ZLINEOBJ.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | namespace Hitman::BloodMoney { 5 | ZLINEOBJ* ZLINEOBJ::Create() { 6 | using ZLINEOBJ_FactoryBuilder_t = ZLINEOBJ*(__cdecl*)(); 7 | 8 | if (BMConfigurationService::BMAPI_FunctionAddress_ZLINEOBJ_FactoryConstructor != BMConfigurationService::kNotConfiguredOption) { 9 | return ((ZLINEOBJ_FactoryBuilder_t)BMConfigurationService::BMAPI_FunctionAddress_ZLINEOBJ_FactoryConstructor)(); 10 | } 11 | 12 | return nullptr; 13 | } 14 | } -------------------------------------------------------------------------------- /ReHitman/Glacier/include/Glacier/Geom/ZENVIRONMENT.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | namespace Glacier { 6 | class ZENVIRONMENT : public ZLIGHT { 7 | public: 8 | //vftable (no changes) 9 | //api 10 | void ToggleColor(bool value); 11 | void SetDiffuseColor(unsigned int c1, unsigned int c2); 12 | 13 | //data (total size is 0x38, base size is 0x20) 14 | int m_field20; 15 | int m_field24; 16 | int m_color1_1; 17 | int m_color1_2; 18 | int m_color2_1; 19 | int m_color2_2; //0x34 20 | }; 21 | } -------------------------------------------------------------------------------- /ReHitman/Glacier/include/Glacier/ZOpeningBase.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | namespace Glacier 6 | { 7 | class ZOpeningBase 8 | { 9 | public: 10 | // vftable 11 | virtual void* FindReferenceNormal(); 12 | virtual void FindRootNormal(); // pure virtual 13 | virtual void* FindGates(); 14 | virtual Glacier::ZGEOM* GetBaseGeom(); // pure virtual 15 | virtual void AdjustOpenness(float, float); 16 | virtual void ZOpeningBase_Destructor(); 17 | virtual void Init(); 18 | virtual void Init2(); 19 | }; 20 | } -------------------------------------------------------------------------------- /ReHitman/BloodMoney/include/BloodMoney/Patches/All/ZCutSequencePlayerPatch.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | 6 | namespace Hitman::BloodMoney 7 | { 8 | class ZCutSequencePlayerPatch final : public BasicPatch 9 | { 10 | HF::Hook::TrampolinePtr<8> m_constructorTrampoline; 11 | HF::Hook::TrampolinePtr<6> m_destructorTrampoline; 12 | public: 13 | std::string_view GetName() const override; 14 | bool Apply(const ModPack& modules) override; 15 | void Revert(const ModPack& modules) override; 16 | }; 17 | } -------------------------------------------------------------------------------- /ReHitman/BloodMoney/source/Debug/GizmosControl.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | namespace Hitman::BloodMoney::Debug { 4 | void GizmosControl::RegisterGizmo(EGizmoLayer layer, const GizmoHandler& gizmoHandler) { 5 | m_handlers[layer].push_back(gizmoHandler); 6 | } 7 | 8 | void GizmosControl::DrawGizmo(EGizmoLayer layer, IDirect3DDevice9* device) { 9 | auto it = m_handlers.find(layer); 10 | if (it != m_handlers.end()) { 11 | for (const auto& handler: it->second) { 12 | handler(layer, device); 13 | } 14 | } 15 | } 16 | } -------------------------------------------------------------------------------- /ReHitman/BloodMoney/include/BloodMoney/Game/ZUpgradeInfo.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | namespace Hitman::BloodMoney 6 | { 7 | // Type forwardings for class ZUpgradeInfo 8 | class ZGUIBase; 9 | class ZXMLGUISystem; 10 | class ZWINGROUP; 11 | class ZResourceManager; 12 | 13 | // Class definition ZUpgradeInfo 14 | class ZUpgradeInfo : public IGUIElement { 15 | public: 16 | //vftable 17 | //api 18 | void SetupTextGraphic(); 19 | 20 | //data (total size is 0x110, base size is 0x6c) 21 | int m_field6C; 22 | }; 23 | } -------------------------------------------------------------------------------- /ReHitman/Glacier/source/EventBase/ZEventBuffer.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | namespace Glacier { 6 | std::intptr_t ZEventBuffer::GetGQC(Glacier::ZREF ref) { 7 | if (G1ConfigurationService::G1API_FunctionAddress_GetGQC != G1ConfigurationService::kNotConfiguredOption) { 8 | return ((std::intptr_t(__cdecl*)(Glacier::ZREF))(G1ConfigurationService::G1API_FunctionAddress_GetGQC))(ref); 9 | } 10 | 11 | assert(false && "Option G1API_FunctionAddress_GetGQC not configured!"); 12 | return 0x0; 13 | } 14 | } -------------------------------------------------------------------------------- /ReHitman/BloodMoney/include/BloodMoney/Game/ZWheelChairLock.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | namespace Hitman::BloodMoney { 6 | class ZHM3Actor; 7 | 8 | class ZWheelChairLock : public Glacier::ZEventBase { 9 | public: 10 | //static 11 | static constexpr Glacier::ZMSGID kDeactivateFrameUpdate = 0x915; 12 | 13 | //vftable (no changes) 14 | //api 15 | //data (total size is 0x3C, base size is 0x30) 16 | int m_rActorREF; 17 | ZHM3Actor* m_pAttachedActor; 18 | short m_rAnimation; 19 | short m_field3A; 20 | }; 21 | } -------------------------------------------------------------------------------- /ReHitman/DLL/include/DLL/ReHitman.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace ReHitman 4 | { 5 | class Core 6 | { 7 | public: 8 | static int EntryPoint(const void*); 9 | 10 | private: 11 | enum class GameVersion { 12 | BloodMoney_PC_1_0_USA, 13 | BloodMoney_PC_1_0_RU_ND, //Russian Build, New Disk retailer 14 | BloodMoney_PC_1_2_UK, 15 | BloodMoney_PC_1_2_Steam, 16 | BloodMoney_PC_1_2_GOG, 17 | // Not a version 18 | UnknownBuild = 0xDEAD 19 | }; 20 | 21 | static GameVersion TryToDetectGameVersion(); 22 | }; 23 | } -------------------------------------------------------------------------------- /ReHitman/Glacier/include/Glacier/ResourceCollection.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | namespace Glacier 6 | { 7 | class ResourceCollection { 8 | public: 9 | uint32_t m_field4; 10 | 11 | virtual void* GetResourceText(char const*); //#0000 at 00550F58 12 | virtual void* GetResourceText(char const*,char const*); //#0001 at 0014CD94 org ResourceCollection::GetResourceText(char const*,char const*) 13 | virtual void* GetElementText(char const*,int); //#0002 at 0014CE34 org ResourceCollection::GetElementText(char const*,int) 14 | }; //End of ResourceCollection from 00550F58 15 | } -------------------------------------------------------------------------------- /ReHitman/BloodMoney/include/BloodMoney/Editors/CutSequencesPool.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | #include 6 | #include 7 | 8 | namespace Hitman::BloodMoney 9 | { 10 | class CutSequencesPool final 11 | { 12 | std::set m_cutSequencePlayers; 13 | public: 14 | static CutSequencesPool& GetInstance(); 15 | 16 | void Add(ZCutSequencePlayer* instance); 17 | void Remove(ZCutSequencePlayer* instance); 18 | void ForEach(std::function pred); 19 | 20 | bool IsEmpty() const; 21 | }; 22 | } -------------------------------------------------------------------------------- /ReHitman/BloodMoney/include/BloodMoney/FreeFS/HBMFreeFsProxy.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | namespace Hitman::BloodMoney::FreeFS { 6 | class HBMFreeFsProxy { 7 | public: 8 | char pad_0000[16]; //0x0000 9 | char* m_missionZipFilePath; //0x0010 10 | char pad_0014[100]; //0x0014 11 | char* m_zipFilePath; //0x0078 12 | 13 | static std::string findFileInFolderRecursively(const std::string& folder, const std::string& file); 14 | 15 | int readFileProvider(const char* name, void* dest, int fileSize, int unk1); 16 | int getFileSizeProvider(const char* name); 17 | }; 18 | } -------------------------------------------------------------------------------- /ReHitman/BloodMoney/include/BloodMoney/Patches/All/EnableCheatsPatch.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | 6 | namespace Hitman::BloodMoney 7 | { 8 | class EnableCheatsPatch final : public BasicPatch 9 | { 10 | HF::Patch m_firstPatch, m_secondPatch; 11 | HF::Hook::TrampolineBasicPtr m_giveSomeTrampoline; 12 | public: 13 | EnableCheatsPatch() = default; 14 | 15 | std::string_view GetName() const override; 16 | bool Apply(const ModPack& modules) override; 17 | void Revert(const ModPack& modules) override; 18 | }; 19 | } -------------------------------------------------------------------------------- /ReHitman/BloodMoney/include/BloodMoney/Game/Globals.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | namespace Hitman::BloodMoney::Globals 6 | { 7 | static constexpr std::uintptr_t kSysInterfaceAddr = 0x00820820; 8 | static constexpr std::uintptr_t kGameDataAddr = 0x0082083C; 9 | static constexpr std::uintptr_t kFileSystemAddr = 0x0082081C; 10 | static constexpr std::uintptr_t kGeomBufferAddr = 0x008BA0C0; 11 | static constexpr std::uintptr_t kActionManagerAddr = 0x008ACAC4; 12 | static constexpr std::uintptr_t kD3DDllAddr = 0x008ACA30; 13 | static constexpr std::uintptr_t kSysInputAddr = 0x008ACAA0; 14 | } -------------------------------------------------------------------------------- /ReHitman/DLL/source/DebugConsole.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | namespace ReHitman 5 | { 6 | bool DebugConsole::g_bIsCreated = false; 7 | 8 | void DebugConsole::Create(std::string_view caption) 9 | { 10 | if (g_bIsCreated || caption.empty()) 11 | return; 12 | 13 | if (AllocConsole()) { 14 | freopen("CONOUT$", "w", stdout); 15 | SetConsoleTitle(caption.data()); 16 | SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), FOREGROUND_GREEN | FOREGROUND_BLUE | FOREGROUND_RED); 17 | 18 | g_bIsCreated = true; 19 | } 20 | } 21 | } -------------------------------------------------------------------------------- /ReHitman/Glacier/include/Glacier/CDoorBase.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | namespace Glacier 6 | { 7 | class CDoorBase : public ZOpeningBase 8 | { 9 | public: 10 | // vftable 11 | virtual void SetPercentOpen(float); 12 | virtual void __pure_function_0(); //Pure virtual 13 | virtual void __pure_function_1(); //Pure virtual 14 | virtual void PostInit2(); 15 | virtual void LoadObject(Glacier::IInputSerializerStream&); 16 | virtual void SaveObject(Glacier::IOutputSerializerStream&); 17 | 18 | //TODO: Complete later, it's too hard for now 19 | }; 20 | } -------------------------------------------------------------------------------- /ReHitman/BloodMoney/include/BloodMoney/Patches/All/InputDevicesPatches.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | 6 | namespace Hitman::BloodMoney 7 | { 8 | class IInputDelegate; 9 | 10 | class InputDevicesPatches final : public BasicPatch 11 | { 12 | public: 13 | InputDevicesPatches() = default; 14 | explicit InputDevicesPatches(std::unique_ptr&& delegate); 15 | 16 | std::string_view GetName() const override; 17 | bool Apply(const ModPack& modules) override; 18 | void Revert(const ModPack& modules) override; 19 | }; 20 | } -------------------------------------------------------------------------------- /ReHitman/BloodMoney/include/BloodMoney/Game/UI/ZStandardMenuFactory.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace Hitman::BloodMoney 4 | { 5 | class ZGUIBase; 6 | class ZStandardWindow; 7 | class ZHM3MenuElements; 8 | 9 | class ZStandardMenuFactory 10 | { 11 | public: 12 | virtual void* GetListDataInteface(const char* dataListTypeName); 13 | virtual void* GetTableDataInterface(const char*); // DO NOT USE THIS! NOT IMPLEMNETED IN BLOOD MONEY 14 | virtual ZStandardWindow* WindowFactory(const char* windowName, ZHM3MenuElements* menuElements); 15 | virtual ZGUIBase* GUIElementFactory(const char* elementName); 16 | }; 17 | } -------------------------------------------------------------------------------- /ReHitman/BloodMoney/include/BloodMoney/Game/UI/ZGUIBase.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | namespace Hitman::BloodMoney 6 | { 7 | class ZHM3MenuElements; 8 | class ZWINGROUP; 9 | 10 | class ZGUIBase 11 | { 12 | public: 13 | // vtable 14 | virtual void readParams(const char**, ZHM3MenuElements*); 15 | virtual void addElement(const char*, ZGUIBase*); 16 | 17 | // api 18 | void GetSize(ZWINGROUP* pGroup, Glacier::Vector2* pSize); 19 | 20 | // data (total size is 0x4C) 21 | char m_name[0x40] { 0 }; //0x0004 22 | Glacier::ZVector2 m_position {}; //0x0044 23 | }; 24 | } -------------------------------------------------------------------------------- /ReHitman/Glacier/include/Glacier/ZSTL/ZRTTI.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | namespace Glacier 6 | { 7 | struct ZRTTI 8 | { 9 | char* ComplexTypeName; //0x0000 10 | char pad_0x0004[0x14]; //0x0004 11 | int32_t TypeID; //0x0018 12 | char pad_0x001C[0x4]; //0x001C 13 | char* SelfType; //0x0020 14 | char* Parent; //0x0024 15 | char pad_0x0028[0x4]; //0x0028 16 | int32_t Unk0; //0x002C 17 | int32_t Unk1; //0x0030 18 | char* SelfName2; //0x0034 19 | char pad_0x0038[0x4]; //0x0038 20 | ZRTTI* NextEntity; //0x003C 21 | }; 22 | } -------------------------------------------------------------------------------- /ReHitman/BloodMoney/include/BloodMoney/Game/UI/ZColorSet.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | namespace Hitman::BloodMoney { 6 | class ZColorSet : public ZGUIBase { 7 | public: 8 | enum EColorIndex { 9 | DisableColor, 10 | FocusColor, 11 | NormalColor 12 | }; 13 | 14 | //vftable (no changes) 15 | //api 16 | uint32_t GetColor(EColorIndex colorIndex); 17 | 18 | //data (total size is 0x58, base size is 0x4C) 19 | int m_field4C; 20 | uint32_t m_NormalColor; 21 | uint32_t m_FocusColor; 22 | uint32_t m_DisableColor; 23 | }; 24 | } -------------------------------------------------------------------------------- /ReHitman/BloodMoney/include/BloodMoney/Patches/All/ZHitman3Patches.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | 6 | namespace Hitman::BloodMoney 7 | { 8 | class ZHitman3Patches final : public BasicPatch 9 | { 10 | private: 11 | HF::Hook::TrampolineBasicPtr m_constructor; 12 | HF::Hook::TrampolineBasicPtr m_guardControlCtor; 13 | HF::Hook::TrampolineBasicPtr m_guardControlDtor; 14 | 15 | public: 16 | std::string_view GetName() const override; 17 | bool Apply(const ModPack& modules) override; 18 | void Revert(const ModPack& modules) override; 19 | }; 20 | } -------------------------------------------------------------------------------- /ReHitman/Glacier/include/Glacier/ZScheduledEvent.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace Glacier { 4 | class ZScheduledEvent { 5 | public: 6 | enum EScheduledEventState { 7 | STATE_RUNNING = 0x40000000u 8 | }; 9 | 10 | // vftable 11 | virtual void Run(); 12 | virtual int GetNextThread(); 13 | virtual ZScheduledEvent* Fork(); 14 | 15 | // data (no base size, current size is 0x1C) 16 | int m_rOwnerEntity; 17 | int m_field8; 18 | int m_rNextThread; 19 | int m_field10; 20 | int m_field14; // some kind of mask, see EScheduledEventState for details 21 | int m_field18; 22 | }; 23 | } -------------------------------------------------------------------------------- /ReHitman/BloodMoney/include/BloodMoney/Engine/ZHM3CameraBaseFunc.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | 6 | 7 | namespace Hitman::BloodMoney 8 | { 9 | class ZHM3CameraBaseFunc 10 | { 11 | public: 12 | //vftable 13 | virtual Glacier::ZGEOM* CameraGeom(); //pure virtual 14 | virtual void CameraCalcRotVector(Glacier::Vector3* pvVec, float, float, float); 15 | virtual void GetCameraRotVector(Glacier::Vector3* pvRotVec); 16 | virtual void LoadObject(int); //IInputSerializerStream& 17 | virtual void SaveObject(int); //IOutputSerializerStream& 18 | 19 | //data 20 | int m_field4; 21 | int m_field8; 22 | int m_fieldC; 23 | }; 24 | } -------------------------------------------------------------------------------- /ReHitman/Glacier/include/Glacier/ZSTL/ZOldTypeInfo.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | 6 | namespace Glacier 7 | { 8 | struct ZOldTypeInfo 9 | { 10 | char *m_psName; 11 | uint32_t m_unk4; 12 | uint32_t m_unk8; 13 | struct ZOldTypeInfo* m_pParentType; 14 | uint32_t m_unk10; 15 | uint32_t m_unk14; 16 | uint32_t m_iInnerIndex; 17 | uint32_t m_unk1C; 18 | uint32_t m_unk20; 19 | uint32_t m_iTypeId2; 20 | uint32_t m_unk28; 21 | char* m_psParentTypeName; 22 | uint32_t *m_piID; 23 | uint32_t *m_piMask; 24 | uint32_t m_unk38; 25 | uint32_t m_iTypeId; 26 | void(__cdecl* m_pProduce)(struct ZOldTypeInfo*); 27 | struct ZOldTypeInfo* m_pNext; 28 | }; 29 | } 30 | -------------------------------------------------------------------------------- /ReHitman/BloodMoney/include/BloodMoney/Game/Items/ZHM3ItemTemplate.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | 6 | namespace Hitman::BloodMoney 7 | { 8 | class ZHM3ItemTemplate : public Glacier::ZItemTemplate 9 | { 10 | public: 11 | // vftable 12 | virtual EHM3ItemType GetHM3ItemType(); 13 | 14 | // data (total size is 0x94, ZItemTemplate size is 0x74) 15 | EHM3ItemType m_itemType; 16 | int m_field78; 17 | int m_field7C; 18 | int m_field80; 19 | int m_field84; 20 | int m_field88; 21 | int m_field8C; 22 | int m_field90; 23 | }; 24 | } -------------------------------------------------------------------------------- /ReHitman/Glacier/include/Glacier/Geom/ZLIGHT.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | namespace Glacier { 6 | class ZLIGHT : public ZGEOM { 7 | public: 8 | //vftable 9 | virtual void Enable(); 10 | virtual void Disable(); 11 | virtual void SetMultiplier(float fValue); // In default implementation it's do nothing 12 | virtual void SetDiffuseColor(unsigned int rgba); // In default implementation it's do nothing 13 | virtual void MakeLightUnique(); 14 | 15 | //data (total size is 0x20, base size is 0x10) 16 | int m_flags; 17 | int m_field14; 18 | int m_field18; 19 | int m_field1C; 20 | }; 21 | } -------------------------------------------------------------------------------- /ReHitman/Glacier/source/Geom/ZSNDOBJ.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | namespace Glacier 6 | { 7 | bool ZSNDOBJ::AttachToDefaultRoom(bool a1) 8 | { 9 | assert(G1ConfigurationService::G1API_FunctionAddress_ZSNDOBJ_AttachToDefaultRoom != G1ConfigurationService::kNotConfiguredOption); 10 | if (G1ConfigurationService::G1API_FunctionAddress_ZSNDOBJ_AttachToDefaultRoom != G1ConfigurationService::kNotConfiguredOption) { 11 | return ((bool(__thiscall*)(ZSNDOBJ*,bool))(G1ConfigurationService::G1API_FunctionAddress_ZSNDOBJ_AttachToDefaultRoom))(this, a1); 12 | } 13 | return false; 14 | } 15 | } -------------------------------------------------------------------------------- /ReHitman/Glacier/include/Glacier/Geom/ZBoxPrimitive.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | 6 | namespace Glacier 7 | { 8 | class ZBoxPrimitive : public ZSTDOBJ 9 | { 10 | public: 11 | //vftable 12 | virtual void CalcPositionInBox(Glacier::ZVector3*); 13 | virtual void GetClosestPosDirInBox(Glacier::ZVector3*, float, Glacier::ZVector3*, float); 14 | virtual void SetScale(float xScale, float yScale, float zScale); 15 | virtual Glacier::ZVector3* GetScale(Glacier::ZVector3* outScale); 16 | 17 | //data (total size is 0x1C, original size is ox10) 18 | Glacier::ZVector3 m_scale; 19 | }; 20 | } -------------------------------------------------------------------------------- /ReHitman/BloodMoney/source/Game/Items/ZHM3ItemBomb.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | #include 5 | 6 | namespace Hitman::BloodMoney 7 | { 8 | void ZHM3ItemBomb::Explode() 9 | { 10 | assert(BMConfigurationService::BMAPI_FunctionAddress_ZHM3ItemBomb_Explode != BMConfigurationService::kNotConfiguredOption); 11 | if (BMConfigurationService::BMAPI_FunctionAddress_ZHM3ItemBomb_Explode != BMConfigurationService::kNotConfiguredOption) 12 | { 13 | ((void(__thiscall*)(ZHM3ItemBomb*))(BMConfigurationService::BMAPI_FunctionAddress_ZHM3ItemBomb_Explode))(this); 14 | } 15 | } 16 | 17 | } 18 | -------------------------------------------------------------------------------- /ReHitman/BloodMoney/include/BloodMoney/Game/UI/ZLINEOBJ.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | namespace Hitman::BloodMoney 6 | { 7 | class ZLINEOBJ : public ZCHAROBJ 8 | { 9 | public: 10 | // vftable 11 | virtual void Wrap(); 12 | virtual int GetCharWidth(const char**); 13 | virtual int GetStringWidth(const char* str, int length); 14 | virtual void SetWidth(int); 15 | virtual float GetWidth(); 16 | 17 | // custom method 18 | static ZLINEOBJ* Create(); 19 | 20 | // data (total size is 0xAC, base size is 0xA0) 21 | int m_fieldA0; 22 | int m_fieldA4; 23 | int m_fieldA8; 24 | }; 25 | } -------------------------------------------------------------------------------- /ReHitman/Glacier/include/Glacier/ZLinkedListHeader.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | namespace Glacier 6 | { 7 | template struct ZLinkedListHeader 8 | { 9 | using ItemType = T; 10 | 11 | ItemType* prev; 12 | ItemType* next; 13 | 14 | ItemType* begin() { return reinterpret_cast(reinterpret_cast(next) - 1); } 15 | ItemType* end() { return reinterpret_cast(reinterpret_cast(prev) - 1); } 16 | }; 17 | 18 | struct ZLinkedListNodeBase 19 | { 20 | ZLinkedListNodeBase* next; 21 | ZLinkedListNodeBase* prev; 22 | int32_t ID; 23 | char __PAD10__[4]; 24 | }; 25 | } -------------------------------------------------------------------------------- /ReHitman/BloodMoney/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.16) 2 | project(BloodMoney) 3 | set(CMAKE_CXX_STANDARD 20) 4 | 5 | file(GLOB_RECURSE HITMAN_BM_SOURCES 6 | ${CMAKE_CURRENT_SOURCE_DIR}/source/*.cpp 7 | ${CMAKE_CURRENT_SOURCE_DIR}/source/*.cc 8 | ${CMAKE_CURRENT_SOURCE_DIR}/source/*.c 9 | ${CMAKE_CURRENT_SOURCE_DIR}/source/*.cxx 10 | ${CMAKE_CURRENT_SOURCE_DIR}/source/*.asm) 11 | 12 | add_library(BloodMoney STATIC ${HITMAN_BM_SOURCES}) 13 | add_library(Hitman::BloodMoney ALIAS BloodMoney) 14 | target_include_directories(BloodMoney PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/include) 15 | target_link_libraries(BloodMoney G1::Core HF::Core ReHitman::IClient ImGui::Core ImGui::DX9 spdlog) -------------------------------------------------------------------------------- /ReHitman/BloodMoney/include/BloodMoney/Game/UI/ZXMLGUISystem.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | #include 6 | #include 7 | 8 | #include 9 | #include 10 | 11 | namespace Hitman::BloodMoney 12 | { 13 | class ZXMLGUISystem : public CWinEvent 14 | { 15 | public: 16 | int m_field30; //0x0030 17 | Glacier::ZGROUP* m_windowGroups[18]; //0x0034 18 | 19 | /// vftable 20 | virtual void SetFocus(); 21 | virtual void AddOtherWindowCount(int); 22 | 23 | // api 24 | ZWINDOW* GetTopWindow(); 25 | }; 26 | } -------------------------------------------------------------------------------- /ReHitman/BloodMoney/include/BloodMoney/Game/ZHM3ClothBundle.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | namespace Hitman::BloodMoney 6 | { 7 | class ZHM3ClothBundle : public Glacier::ZSTDOBJ 8 | { 9 | public: 10 | //vftable 11 | virtual void CopyDataFromClothBundle(ZHM3ClothBundle* from); 12 | 13 | //data (total size is 0x40, base size is 0x10) 14 | int field_10; 15 | int field_14; 16 | int field_18; 17 | int field_1C; 18 | int field_20; 19 | int field_24; 20 | int field_28; 21 | int field_2C; 22 | int field_30; 23 | int field_34; 24 | int field_38; 25 | int field_3C; 26 | }; 27 | } -------------------------------------------------------------------------------- /ReHitman/BloodMoney/source/Game/UI/ZWINOBJ.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | namespace Hitman::BloodMoney 6 | { 7 | int ZWINOBJ::GetTexture(unsigned int iTextureType) { 8 | assert(BMConfigurationService::BMAPI_FunctionAddress_ZWINOBJ_GetTexture != BMConfigurationService::kNotConfiguredOption); 9 | 10 | if (BMConfigurationService::BMAPI_FunctionAddress_ZWINOBJ_GetTexture != BMConfigurationService::kNotConfiguredOption) { 11 | return ((int(__thiscall*)(ZWINOBJ*,unsigned int))BMConfigurationService::BMAPI_FunctionAddress_ZWINOBJ_GetTexture)(this, iTextureType); 12 | } 13 | return 0; 14 | } 15 | } -------------------------------------------------------------------------------- /ReHitman/Glacier/include/Glacier/ZWinEvents.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | namespace Glacier 6 | { 7 | using SMouseColi = Glacier::Vector4; 8 | 9 | enum EWMEventType 10 | { 11 | OPEN_WINDOW = 0x100, 12 | CLOSE_WINDOW = 0x200, 13 | MOUSE_SCROLL = 0x10, 14 | MOUSE_LEAVE = 0x40, 15 | MOUSE_PRESS = 0x2, 16 | MOUSE_RELEASE = 0x1, 17 | UNKNOWN_EVENT_0 = 0x80, 18 | UNKNOWN_EVENT_1 = 0x1000, 19 | UNKNOWN_EVENT_2 = 0x100000, 20 | }; 21 | 22 | struct ZWMEVENT { 23 | int field_0; // unknown field, maybe unused 24 | EWMEventType eventType; 25 | int objectId; 26 | int flag; 27 | }; 28 | } -------------------------------------------------------------------------------- /ReHitman/BloodMoney/include/BloodMoney/Delegates/DX9Delegate.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | 6 | namespace Hitman::BloodMoney 7 | { 8 | class DX9Delegate final : public IDirect3DDelegate, public Debug::GizmosControl 9 | { 10 | public: 11 | void OnInitialised(IDirect3DDevice9* device) override; 12 | void OnDeviceLost() override; 13 | void OnReset(IDirect3DDevice9* device) override; 14 | void OnDeviceRestored(IDirect3DDevice9* device) override; 15 | void OnPresent(IDirect3DDevice9* device) override; 16 | 17 | private: 18 | void DrawDebugUI(IDirect3DDevice9* device); 19 | }; 20 | } -------------------------------------------------------------------------------- /ReHitman/BloodMoney/include/BloodMoney/Game/Items/ZHM3Item.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | #include 6 | 7 | namespace Hitman::BloodMoney 8 | { 9 | class ZHM3Item : public Glacier::ZItem 10 | { 11 | public: 12 | // vftable 13 | virtual EHM3ItemType GetHM3ItemType(); 14 | virtual void OverrideItemType(EHM3ItemType itemType); 15 | virtual void UseItemActivateAnimation(); 16 | 17 | // data (total size is 0x9C, ZItem size is 0x84) 18 | int m_field84; 19 | int m_field88; 20 | EHM3ItemType m_itemType; 21 | int m_field90; 22 | int m_field94; 23 | int m_field98; 24 | }; 25 | } -------------------------------------------------------------------------------- /ReHitman/BloodMoney/source/Game/UI/ZXMLGUISystem.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | namespace Hitman::BloodMoney 6 | { 7 | ZWINDOW* ZXMLGUISystem::GetTopWindow() { 8 | assert(BMConfigurationService::BMAPI_FunctionAddress_ZXMLGUISystem_GetTopWindow != BMConfigurationService::kNotConfiguredOption); 9 | if (BMConfigurationService::BMAPI_FunctionAddress_ZXMLGUISystem_GetTopWindow != BMConfigurationService::kNotConfiguredOption) { 10 | return ((ZWINDOW*(__thiscall*)(ZXMLGUISystem*))BMConfigurationService::BMAPI_FunctionAddress_ZXMLGUISystem_GetTopWindow)(this); 11 | } 12 | return nullptr; 13 | } 14 | } -------------------------------------------------------------------------------- /ReHitman/BloodMoney/include/BloodMoney/UI/DebugWidget.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | 6 | namespace Hitman::BloodMoney 7 | { 8 | class DebugWidget 9 | { 10 | public: 11 | using Ref = std::weak_ptr; 12 | using Ptr = std::shared_ptr; 13 | 14 | virtual ~DebugWidget() noexcept = default; 15 | 16 | DebugWidget() = default; 17 | 18 | void addChild(const DebugWidget::Ptr& child); 19 | void removeChild(const DebugWidget::Ptr& child); 20 | 21 | virtual void draw(); 22 | 23 | protected: 24 | DebugWidget::Ref m_parent; 25 | 26 | private: 27 | std::vector m_child; 28 | }; 29 | } -------------------------------------------------------------------------------- /ReHitman/BloodMoney/include/BloodMoney/Patches/All/ZDirect3D9DevicePatches.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | 6 | namespace Hitman::BloodMoney 7 | { 8 | class IDirect3DDelegate; 9 | 10 | class ZDirect3D9DevicePatches final : public BasicPatch 11 | { 12 | private: 13 | HF::Hook::TrampolinePtr<10> m_ZDirect3DDevice_Constructor { nullptr }; 14 | public: 15 | explicit ZDirect3D9DevicePatches(std::unique_ptr&& delegate); 16 | 17 | [[nodiscard]] std::string_view GetName() const override; 18 | bool Apply(const ModPack& modules) override; 19 | void Revert(const ModPack& modules) override; 20 | }; 21 | 22 | } -------------------------------------------------------------------------------- /ReHitman/Glacier/include/Glacier/Fysix/SRigidBodyVelocity.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | namespace Glacier 6 | { 7 | struct SRigidBodyVelocity 8 | { 9 | int m_field0; 10 | int m_field4; 11 | int m_field8; 12 | int m_fieldC; 13 | int m_field10; 14 | int m_field14; 15 | int m_field18; 16 | int m_field1C; 17 | int m_field20; 18 | int m_field24; 19 | int m_field28; 20 | int m_field2C; 21 | int m_field30; 22 | int m_field34; 23 | int m_field38; 24 | int m_field3C; 25 | int m_field40; 26 | int m_field44; 27 | ZVector3 m_vec48; 28 | ZVector3 m_vec54; 29 | }; 30 | } -------------------------------------------------------------------------------- /ReHitman/Glacier/include/Glacier/Geom/ZGateLightSpot.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | namespace Glacier { 6 | class ZGateLightSpot : public ZSPOTLIGHT { 7 | public: 8 | //vftable (no changes) 9 | //data (total size is 0x60, base size is 0x20) 10 | int m_field20; 11 | int m_field24; 12 | int m_field28; 13 | int m_field2C; 14 | int m_field30; 15 | int m_field34; 16 | int m_field38; 17 | int m_field3C; 18 | int m_field40; 19 | int m_field44; 20 | int m_field48; 21 | int m_field4C; 22 | int m_field50; 23 | int m_field54; 24 | int m_field58; 25 | int m_field5C; 26 | }; 27 | } -------------------------------------------------------------------------------- /ReHitman/BloodMoney/include/BloodMoney/Game/UI/ZHM3InventoryMenu.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "ZNavigator.h" 4 | 5 | namespace Hitman::BloodMoney { 6 | class ZHM3InventoryMenu : public ZNavigator { 7 | public: 8 | //vftable (no changes) 9 | //api 10 | void InitInventoryList(); 11 | void CloseItemView(); 12 | void CloseInventoryMenu(); 13 | void UpdateItemView(); 14 | void UpdateItemInfo(); 15 | void SpinCircle(bool); 16 | void TurnLeft(); 17 | void TurnRight(); 18 | 19 | //data (total size is 0x1FF8, base size is 0x98) 20 | int m_field98; 21 | int m_field9C; 22 | int m_field100; 23 | //TODO: Complete fields list 24 | }; 25 | } -------------------------------------------------------------------------------- /ReHitman/BloodMoney/source/Game/PF4/PF4RunTime.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | namespace Hitman::BloodMoney::PF4RunTime { 6 | ZData* ZData::CreatePathFinder(void *pData) { 7 | if (!pData) return nullptr; 8 | assert(BMConfigurationService::BMAPI_FunctionAddress_PF4_CreatePathFinder != BMConfigurationService::kNotConfiguredOption); 9 | if (BMConfigurationService::BMAPI_FunctionAddress_PF4_CreatePathFinder != BMConfigurationService::kNotConfiguredOption) { 10 | return ((ZData*(__cdecl*)(void*))BMConfigurationService::BMAPI_FunctionAddress_PF4_CreatePathFinder)(pData); 11 | } 12 | 13 | return nullptr; 14 | } 15 | } -------------------------------------------------------------------------------- /ReHitman/Glacier/include/Glacier/Geom/ZGateLightSpotSquare.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | namespace Glacier { 6 | class ZGateLightSpotSquare : public ZSPOTLIGHTSQUARE { 7 | public: 8 | //vftable 9 | //data (total size is 0x60, base size is 0x20) 10 | int m_field20; 11 | int m_field24; 12 | int m_field28; 13 | int m_field2C; 14 | int m_field30; 15 | int m_field34; 16 | int m_field38; 17 | int m_field3C; 18 | int m_field40; 19 | int m_field44; 20 | int m_field48; 21 | int m_field4C; 22 | int m_field50; 23 | int m_field54; 24 | int m_field58; 25 | int m_field5C; 26 | }; 27 | } -------------------------------------------------------------------------------- /ReHitman/BloodMoney/include/BloodMoney/Game/Items/ZHM3ItemTemplateContainer.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | 6 | namespace Hitman::BloodMoney 7 | { 8 | class ZHM3ItemTemplateContainer : public Glacier::ZItemTemplateContainer 9 | { 10 | public: 11 | //vftable 12 | virtual EHM3ItemType GetHM3ItemType(); 13 | 14 | //data (total size is 0xB4, ZItemTemplateContainer is 0x90) 15 | int m_field90; 16 | int m_field94; 17 | EHM3ItemType m_itemType; 18 | int m_field9C; 19 | int m_fieldA0; 20 | int m_fieldA4; 21 | int m_fieldA8; 22 | int m_fieldAC; 23 | int m_fieldB0; 24 | }; 25 | } -------------------------------------------------------------------------------- /ReHitman/BloodMoney/include/BloodMoney/Game/OnLevel/CMetalDetector.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | 6 | namespace Hitman::BloodMoney 7 | { 8 | class CMetalDetector : public Glacier::ZEventBase 9 | { 10 | public: 11 | // api 12 | void DoDetectWeapon(); 13 | void DoAlarm(); 14 | 15 | // data (total size is 0xA8, ZEventBase size is 0x30) 16 | Glacier::REFTAB m_pAttachedActorsRefTab; 17 | int field_4C; 18 | Glacier::REFTAB m_reftab1; 19 | Glacier::REFTAB m_reftab2; 20 | Glacier::REFTAB m_reftab3; 21 | char m_bIsAlarming; 22 | char field_A5; 23 | char field_A6; 24 | char field_A7; 25 | }; 26 | } -------------------------------------------------------------------------------- /ReHitman/BloodMoney/include/BloodMoney/Patches/All/ZGEOMManagementPatch.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | 6 | namespace Hitman::BloodMoney 7 | { 8 | class ZGEOMManagementPatch final : public BasicPatch 9 | { 10 | private: 11 | static constexpr std::intptr_t CtorPatchSize = 7; 12 | static constexpr std::intptr_t DtorPatchSize = 6; 13 | 14 | HF::Hook::TrampolinePtr m_ZGEOM_Ctor; 15 | HF::Hook::TrampolinePtr m_ZGEOM_Dtor; 16 | 17 | public: 18 | std::string_view GetName() const override; 19 | bool Apply(const ModPack& modules) override; 20 | void Revert(const ModPack& modules) override; 21 | }; 22 | } -------------------------------------------------------------------------------- /ReHitman/BloodMoney/source/Game/CTelePortList.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | namespace Hitman::BloodMoney { 6 | void CTelePortList::TeleportToPointAtIndex(int index) { 7 | assert(BMConfigurationService::BMAPI_FunctionAddress_CTelePortList_TeleportToPointAtIndex != BMConfigurationService::kNotConfiguredOption); 8 | if (BMConfigurationService::BMAPI_FunctionAddress_CTelePortList_TeleportToPointAtIndex != BMConfigurationService::kNotConfiguredOption) { 9 | ((void(__thiscall*)(Hitman::BloodMoney::CTelePortList*, int)) 10 | (BMConfigurationService::BMAPI_FunctionAddress_CTelePortList_TeleportToPointAtIndex))(this, index); 11 | } 12 | } 13 | } -------------------------------------------------------------------------------- /ReHitman/Glacier/include/Glacier/ZActorCommunication.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | namespace Glacier { 6 | class ZLIST; 7 | 8 | class ZActorCommunication : public ZEventBase { 9 | public: 10 | //structures 11 | struct RADIOUSER { 12 | unsigned int rActor; 13 | unsigned int iChannel; 14 | }; 15 | 16 | //vftable (no changes) 17 | //data (size is 0x358, base size is 0x30) 18 | RADIOUSER m_aRadioUsers[100]; //+0x30 19 | unsigned int m_iListenersCount; //+0x350 20 | Glacier::ZLIST* m_pTrackLinkObjects; //+0x354 21 | 22 | //api methods 23 | void RegisterRadioUser(Glacier::ZREF rActor, unsigned int iChannel); 24 | }; 25 | } -------------------------------------------------------------------------------- /ReHitman/Glacier/source/ZActorCommunication.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | namespace Glacier { 6 | void ZActorCommunication::RegisterRadioUser(Glacier::ZREF rActor, unsigned int iChannel) { 7 | assert(G1ConfigurationService::G1API_FunctionAddress_ZActorCommunication_RegisterRadioUser != G1ConfigurationService::kNotConfiguredOption); 8 | if (G1ConfigurationService::G1API_FunctionAddress_ZActorCommunication_RegisterRadioUser != G1ConfigurationService::kNotConfiguredOption) { 9 | ((void(__thiscall*)(ZActorCommunication*, Glacier::ZREF, unsigned int))G1ConfigurationService::G1API_FunctionAddress_ZActorCommunication_RegisterRadioUser)(this, rActor, iChannel); 10 | } 11 | } 12 | } -------------------------------------------------------------------------------- /ReHitman/Glacier/include/Glacier/ZSysInputWintel.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | namespace Glacier { 6 | class ZSysInputWintel : public ZSysInput { 7 | public: 8 | // vftable (no changes) 9 | // data (total size is 0xAC) 10 | int m_unk4 { 0 }; 11 | int m_unk8 { 0 }; 12 | int m_unkC { 0 }; 13 | ZInputDevice* m_devices[32]; 14 | int m_attachedDevicesCount { 0 }; // 0x90 15 | bool m_isSuspended { false }; // field94 16 | bool m_field95; 17 | bool m_field96; 18 | bool m_field97; 19 | int m_field98; 20 | int m_field9C; 21 | int m_fieldA0; 22 | int m_fieldA4; 23 | int m_fieldA8; 24 | }; 25 | 26 | 27 | static_assert(offsetof(ZSysInputWintel, m_isSuspended) == 0x94, "ZSysInput bad offset!"); 28 | } -------------------------------------------------------------------------------- /ReHitman/BloodMoney/include/BloodMoney/Editors/LevelEditorGeomsPool.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | #include 6 | #include 7 | #include 8 | 9 | namespace Hitman::BloodMoney 10 | { 11 | class LevelEditorGeomsPool final 12 | { 13 | private: 14 | std::set m_geoms; 15 | bool m_shouldRebuildCache { true }; 16 | std::vector m_cache; 17 | 18 | public: 19 | static LevelEditorGeomsPool& GetInstance(); 20 | 21 | void AddGeom(Glacier::ZGEOM* geom); 22 | void RemoveGeom(Glacier::ZGEOM* geom); 23 | void ForEach(std::function pred); 24 | size_t GetCount() const; 25 | const std::vector& AsVector(); 26 | }; 27 | } -------------------------------------------------------------------------------- /ReHitman/BloodMoney/include/BloodMoney/Game/UI/ZWINDOW.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | #include 6 | #include 7 | 8 | #include 9 | #include 10 | 11 | namespace Hitman::BloodMoney 12 | { 13 | class ZWINDOW : public ZWINGROUP 14 | { 15 | public: 16 | //vftable 17 | virtual void OnWindowOpen(unsigned int, bool); 18 | virtual void OnWindowClose(unsigned int, bool); 19 | virtual ZWINGROUP* GetDefaultFocus(); 20 | virtual void SetDefaultFocus(ZWINGROUP* winGroup); 21 | 22 | //data (total size is 0x5C, ZWINGROUP size is 0x54) 23 | int m_field54; 24 | int m_field58; 25 | }; 26 | } -------------------------------------------------------------------------------- /ReHitman/BloodMoney/include/BloodMoney/Game/ZPodiumController.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | 6 | namespace Hitman::BloodMoney 7 | { 8 | class ZPodiumController 9 | { 10 | public: 11 | char field_0; 12 | char field_1; 13 | char field_2; 14 | char field_3; 15 | char m_field4; 16 | char field_5; 17 | char field_6; 18 | char field_7; 19 | bool m_bMoving; 20 | bool m_bHitmanOnTable; 21 | bool m_fieldA; 22 | bool m_fieldB; 23 | int m_fMoveEndTime; 24 | char field_10; 25 | __declspec(align(4)) bool m_bTrapDoorClosed; 26 | Glacier::Vector3 m_vCameraTargetPos; 27 | Glacier::Vector3 m_vCameraFocusPos; 28 | }; 29 | } -------------------------------------------------------------------------------- /ReHitman/BloodMoney/include/BloodMoney/Patches/BasicPatch.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | #include 6 | 7 | namespace Hitman::BloodMoney 8 | { 9 | class BasicPatch 10 | { 11 | private: 12 | bool m_applied { false }; 13 | public: 14 | using Ptr = std::shared_ptr; 15 | using Ref = std::weak_ptr; 16 | 17 | virtual ~BasicPatch() noexcept = default; 18 | 19 | virtual std::string_view GetName() const = 0; 20 | virtual bool Apply(const ModPack& modules) { m_applied = true; return true; } 21 | virtual void Revert(const ModPack& modules) { m_applied = false; return; } 22 | 23 | [[nodiscard]] bool IsApplied() const { return m_applied; } 24 | }; 25 | } -------------------------------------------------------------------------------- /ReHitman/DLL/include/DLL/Logger.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | namespace ReHitman 6 | { 7 | class Logger 8 | { 9 | public: 10 | static void Setup(); 11 | static void Shutdown(); 12 | static void Assert(bool condition, std::string_view function, std::string_view file, unsigned int line, std::string_view message, std::string_view condition_str); 13 | }; 14 | } 15 | 16 | #define RH_ASSERT2(condition, message) \ 17 | do { \ 18 | ReHitman::Logger::Assert((condition), __FUNCTION__, __FILE__, __LINE__, message, #condition); \ 19 | } while (0); 20 | 21 | #define RH_ASSERT(condition) \ 22 | do { \ 23 | ReHitman::Logger::Assert((condition), __FUNCTION__, __FILE__, __LINE__, "", #condition); \ 24 | } while (0); -------------------------------------------------------------------------------- /ReHitman/BloodMoney/source/Game/UI/ZGUIBase.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | 6 | namespace Hitman::BloodMoney { 7 | void ZGUIBase::GetSize(ZWINGROUP* pGroup, Glacier::Vector2* pSize) { 8 | assert(pGroup != nullptr); 9 | assert(pSize != nullptr); 10 | assert(BMConfigurationService::BMAPI_FunctionAddress_ZGUIBase_GetSize != BMConfigurationService::kNotConfiguredOption); 11 | if (BMConfigurationService::BMAPI_FunctionAddress_ZGUIBase_GetSize != BMConfigurationService::kNotConfiguredOption) { 12 | ((void(__thiscall*)(ZGUIBase*,ZWINGROUP*,Glacier::Vector2*))BMConfigurationService::BMAPI_FunctionAddress_ZGUIBase_GetSize)(this, pGroup, pSize); 13 | } 14 | } 15 | } -------------------------------------------------------------------------------- /ReHitman/Glacier/source/ZActorHeroCheckInside.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | 6 | namespace Glacier { 7 | bool ZActorHeroCheckInside::IsInside(Glacier::ZGEOM* pGeom) { 8 | if (!pGeom) { return false; } 9 | 10 | assert(G1ConfigurationService::G1API_FunctionAddress_ZActorHeroCheckInside_IsInside != G1ConfigurationService::kNotConfiguredOption); 11 | if (G1ConfigurationService::G1API_FunctionAddress_ZActorHeroCheckInside_IsInside != G1ConfigurationService::kNotConfiguredOption) { 12 | return ((bool(__thiscall*)(ZActorHeroCheckInside*,ZGEOM*))G1ConfigurationService::G1API_FunctionAddress_ZActorHeroCheckInside_IsInside)(this, pGeom); 13 | } 14 | 15 | return false; 16 | } 17 | } -------------------------------------------------------------------------------- /ReHitman/BloodMoney/include/BloodMoney/Engine/ZBoidSystem.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | #include 6 | 7 | namespace Hitman::BloodMoney 8 | { 9 | class ZBoid; 10 | 11 | /** 12 | * @class ZBoidSystem 13 | * @brief Store boids, update boids 14 | */ 15 | class ZBoidSystem // Size 0x14 16 | { 17 | public: 18 | // Data 19 | ZBoid** m_boidsPool; //0x0000 20 | int32_t m_pFreeAvailableMemForPoolBegin; //0x0004 21 | int32_t m_pFreeAvailableMemForPoolEnd; //0x0008 22 | Glacier::PF4::Interface* m_pPF4Interface; //0x000C (always nullptr, maybe unused) 23 | int32_t m_totalBoids; //0x0010 24 | int32_t m_unknownField; //0x0014 25 | 26 | // Methods 27 | ZBoid* AddBoid(ZBoid*); 28 | void FrameUpdate(); 29 | }; 30 | } -------------------------------------------------------------------------------- /ReHitman/Glacier/include/Glacier/ZCameraSpace.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | 6 | namespace Glacier { 7 | class ZCameraSpace { 8 | public: 9 | // data 10 | Matrix3x3 matrix {}; 11 | Vector3 position {}; 12 | char sub[512] { 0 }; /// That's should be enough, I guess 13 | 14 | // operators 15 | ZCameraSpace& operator=(ZCAMERA* pCamera); 16 | 17 | // api 18 | bool IsMirror(); 19 | bool IsMain(); 20 | void Proj2D(Vector2* pResult, const Vector3* pPoint); 21 | void Proj3D(Vector3* pResult, const Vector3* pPoint); 22 | void GetLocalMatPos(Matrix3x3* mat, Vector3* pos); 23 | void TransformInversMatPos(Matrix3x3* mat, Vector3* pos); 24 | void GetViewport(Vector4* pViewport); 25 | }; 26 | } -------------------------------------------------------------------------------- /ReHitman/Glacier/source/CConfiguration.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | namespace Glacier 5 | { 6 | bool CConfiguration::CanShowSubtitles() { 7 | if (G1ConfigurationService::G1API_InstanceAddress_CConfiguration_bSubtitles != G1ConfigurationService::kNotConfiguredOption) { 8 | return *reinterpret_cast(G1ConfigurationService::G1API_InstanceAddress_CConfiguration_bSubtitles); 9 | } 10 | return false; 11 | } 12 | 13 | void CConfiguration::SetCanShowSubtitles(bool value) { 14 | if (G1ConfigurationService::G1API_InstanceAddress_CConfiguration_bSubtitles != G1ConfigurationService::kNotConfiguredOption) { 15 | *reinterpret_cast(G1ConfigurationService::G1API_InstanceAddress_CConfiguration_bSubtitles) = value; 16 | } 17 | } 18 | } -------------------------------------------------------------------------------- /ReHitman/BloodMoney/include/BloodMoney/Game/ZHM3HmAs.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | #include 6 | 7 | namespace Hitman::BloodMoney 8 | { 9 | class ZHM3HmAs : public Glacier::ZGROUP 10 | { 11 | public: 12 | /// vftable 13 | virtual void CopyDataFromHmAs(ZHM3HmAs* from); 14 | virtual bool IsZoneAllowed(ESecurityZone zoneKind); 15 | 16 | /// data (total size is 0xA0, parent size is 0x4C) 17 | int m_field4C; //copied at CopyDataFromHmAs 18 | int m_field50; 19 | Glacier::REFTAB m_reftab54; 20 | int m_field70; 21 | uint32_t m_allowedRegionsMask; 22 | Glacier::REFTAB m_reftab78; 23 | int m_field94; 24 | int m_field98; 25 | int m_field9C; 26 | }; 27 | } -------------------------------------------------------------------------------- /ReHitman/BloodMoney/source/UI/DebugWidget.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include 4 | 5 | namespace Hitman::BloodMoney 6 | { 7 | void DebugWidget::addChild(const DebugWidget::Ptr& child) 8 | { 9 | if (child) 10 | { 11 | m_child.push_back(child); 12 | } 13 | } 14 | 15 | void DebugWidget::removeChild(const DebugWidget::Ptr& child) 16 | { 17 | if (child) 18 | { 19 | auto foundIt = std::find(std::begin(m_child), std::end(m_child), child); 20 | if (foundIt != std::end(m_child)) 21 | { 22 | m_child.erase(foundIt); 23 | } 24 | } 25 | } 26 | 27 | void DebugWidget::draw() 28 | { 29 | for (const auto& child : m_child) 30 | { 31 | child->draw(); 32 | } 33 | } 34 | } -------------------------------------------------------------------------------- /ReHitman/BloodMoney/include/BloodMoney/Client.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | #include 6 | #include 7 | 8 | namespace Hitman::BloodMoney 9 | { 10 | class Client : public ReHitman::Client::IClient 11 | { 12 | public: 13 | bool OnAttach() override; 14 | void OnDestroy() override; 15 | 16 | private: 17 | static bool RegisterGameConfigurationForGlacier(); 18 | 19 | bool LocateModules(); 20 | void ReleaseModules(); 21 | void RegisterPatches(); 22 | 23 | private: 24 | HF::Win32::ProcessPtr m_selfProcess { nullptr }; 25 | HF::Win32::ModulePtr m_selfModule { nullptr }; 26 | HF::Win32::ModulePtr m_d3d9Module { nullptr }; 27 | CommonPatches::Ptr m_patches { nullptr }; 28 | }; 29 | } -------------------------------------------------------------------------------- /ReHitman/BloodMoney/source/Game/UI/ZHM3MenuElements.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | namespace Hitman::BloodMoney { 6 | ZGUIBase* ZHM3MenuElements::GetGUIElement(const char *psElementName) { 7 | assert(BMConfigurationService::BMAPI_FunctionAddress_ZHM3MenuElements_GetGUIElement != BMConfigurationService::kNotConfiguredOption); 8 | assert(psElementName != nullptr); 9 | 10 | if (BMConfigurationService::BMAPI_FunctionAddress_ZHM3MenuElements_GetGUIElement != BMConfigurationService::kNotConfiguredOption && psElementName) { 11 | return ((ZGUIBase*(__thiscall*)(ZHM3MenuElements*,const char*))BMConfigurationService::BMAPI_FunctionAddress_ZHM3MenuElements_GetGUIElement)(this, psElementName); 12 | } 13 | 14 | return nullptr; 15 | } 16 | } -------------------------------------------------------------------------------- /ReHitman/Glacier/include/Glacier/ZDrawSurfaceD3D.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | namespace Glacier { 6 | class ZRenderWintelD3D; 7 | 8 | class ZDrawSurfaceD3D { 9 | public: 10 | //vftable 11 | virtual void Release(bool bFreeMem); 12 | virtual void Begin(); 13 | virtual void End(); 14 | virtual void Setup(int iOffsetX, int iOffsetY, int iWidth, int iHeight); 15 | 16 | //data (total size is 0x38) 17 | int m_isLocked; 18 | int m_field8; //??? 19 | IDirect3DSurface9* m_pNewRenderTarget; //+0xC 20 | IDirect3DSurface9* m_pNewDepthStencilBuffer; //+0x10 21 | IDirect3DSurface9* m_pOldRenderTarget; //+0x14 22 | IDirect3DSurface9* m_pOldDepthStencilBuffer; //+0x18 23 | D3DVIEWPORT9 m_sViewport; //+0x1C 24 | ZRenderWintelD3D m_pRender; //+0x34 25 | }; 26 | } -------------------------------------------------------------------------------- /ReHitman/DLL/source/ReHitmanDLL.cpp: -------------------------------------------------------------------------------- 1 | /** 2 | * @brief DLL Entry point for our project 3 | */ 4 | #include 5 | 6 | #include 7 | 8 | #ifndef _WIN32 9 | #error "Supported only x86" 10 | #endif 11 | 12 | DWORD g_dwWorkerThreadId = 0x0; 13 | 14 | static constexpr auto kDefaultStackSize = 0x0; 15 | 16 | DWORD WINAPI WorkerThread(void* arg) 17 | { 18 | return ReHitman::Core::EntryPoint(arg); 19 | } 20 | 21 | BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpReserved) 22 | { 23 | if (fdwReason == DLL_PROCESS_ATTACH) 24 | { 25 | CreateThread(nullptr, kDefaultStackSize, (LPTHREAD_START_ROUTINE)WorkerThread, nullptr, 0, &g_dwWorkerThreadId); 26 | } 27 | else if (fdwReason == DLL_PROCESS_DETACH) 28 | { 29 | FreeLibraryAndExitThread(hinstDLL, 0); 30 | } 31 | 32 | return TRUE; // Successful DLL_PROCESS_ATTACH. 33 | } -------------------------------------------------------------------------------- /ReHitman/BloodMoney/source/Engine/ZBoidSystem.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | namespace Hitman::BloodMoney 4 | { 5 | namespace Consts 6 | { 7 | static constexpr std::intptr_t kAddBoidFunctionAddr = 0x00585610; 8 | static constexpr std::intptr_t kFrameUpdateFunctionAddr = 0x00585490; 9 | } 10 | 11 | ZBoid* ZBoidSystem::AddBoid(ZBoid* boid) 12 | { 13 | using ZBoidSystem_AddBoid_t = ZBoid*(__thiscall* )(ZBoidSystem*, ZBoid*); 14 | auto func = reinterpret_cast(Consts::kAddBoidFunctionAddr); 15 | return func(this, boid); 16 | } 17 | 18 | void ZBoidSystem::FrameUpdate() 19 | { 20 | using ZBoidSystem_FrameUpdate_t = void(__thiscall*)(ZBoidSystem*); 21 | auto func = reinterpret_cast(Consts::kFrameUpdateFunctionAddr); 22 | func(this); 23 | } 24 | } -------------------------------------------------------------------------------- /ReHitman/BloodMoney/source/Game/ZGuardQuarterController.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | namespace Hitman::BloodMoney { 6 | void ZGuardQuarterController::RegisterActor(Glacier::ZREF rActorREF) { 7 | assert(BMConfigurationService::BMAPI_FunctionAddress_ZGuardQuarterController_RegisterActor != BMConfigurationService::kNotConfiguredOption); 8 | if (BMConfigurationService::BMAPI_FunctionAddress_ZGuardQuarterController_RegisterActor != BMConfigurationService::kNotConfiguredOption) { 9 | ((void(__thiscall*)(ZGuardQuarterController*,Glacier::ZREF))BMConfigurationService::BMAPI_FunctionAddress_ZGuardQuarterController_RegisterActor)(this, rActorREF); 10 | } 11 | } 12 | 13 | ZGuardQuarterController* ZGuardQuarterController::g_pCurrentLevelGuardControl = nullptr; 14 | } -------------------------------------------------------------------------------- /ReHitman/BloodMoney/source/Game/CElevatorHouse.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | namespace Hitman::BloodMoney { 6 | CElevatorHouse::EDoorStatus CElevatorHouse::GetDoorStatusOfElevatorByREF(Glacier::ZREF elevatorObjectREF) { 7 | assert(BMConfigurationService::BMAPI_FunctionAddress_CElevatorHouse_GetElevatorDoorStatus != BMConfigurationService::kNotConfiguredOption); 8 | if (BMConfigurationService::BMAPI_FunctionAddress_CElevatorHouse_GetElevatorDoorStatus != BMConfigurationService::kNotConfiguredOption) { 9 | using Func = EDoorStatus(__stdcall*)(Glacier::ZREF); 10 | return ((Func)BMConfigurationService::BMAPI_FunctionAddress_CElevatorHouse_GetElevatorDoorStatus)(elevatorObjectREF); 11 | } 12 | return CElevatorHouse::EDoorStatus::DOOR_STATUS_INVALID; 13 | } 14 | } -------------------------------------------------------------------------------- /ReHitman/Glacier/source/ZHumanBoid.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | namespace Glacier 6 | { 7 | void ZHumanBoid::SetTarget(Glacier::ZVector3* position, Glacier::Vector3* rotation, float a4, bool force) 8 | { 9 | assert(G1ConfigurationService::G1API_FunctionAddress_ZHumanBoid_SetTarget != G1ConfigurationService::kNotConfiguredOption); 10 | if (G1ConfigurationService::G1API_FunctionAddress_ZHumanBoid_SetTarget != G1ConfigurationService::kNotConfiguredOption) 11 | { 12 | using ZHumanBoid_SetTarget = void(__thiscall*)(ZHumanBoid*, Glacier::ZVector3*, Glacier::ZVector3*, float, bool); 13 | auto ZHumanBoid_SetTargetImpl = (ZHumanBoid_SetTarget)G1ConfigurationService::G1API_FunctionAddress_ZHumanBoid_SetTarget; 14 | ZHumanBoid_SetTargetImpl(this, position, rotation, a4, force); 15 | } 16 | } 17 | 18 | } -------------------------------------------------------------------------------- /ReHitman/Glacier/include/Glacier/Fysix/COLI.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | namespace Glacier 6 | { 7 | struct COLI 8 | { 9 | Glacier::Vector3 m_rootPoint; 10 | int m_fieldC; 11 | int m_field10; 12 | int m_field14; 13 | int m_field18; 14 | int m_field1C; 15 | int m_field20; 16 | int m_field24; 17 | int m_field28; 18 | int m_field2C; 19 | int m_field30; 20 | Glacier::ZREF m_unknownREF3C; 21 | int m_field38; 22 | int m_field3C; 23 | int m_field40; 24 | int m_field44; 25 | int m_field48; 26 | int m_field4C; 27 | int m_field50; 28 | int m_field54; 29 | int m_field58; 30 | int m_field5C; 31 | int m_field60; 32 | char m_field64; 33 | char m_field65; 34 | char m_field66; 35 | char m_field67; 36 | }; 37 | } -------------------------------------------------------------------------------- /ReHitman/Glacier/include/Glacier/Geom/ZGateLightOmni.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | namespace Glacier { 6 | class ZGateLightOmni : public ZOMNILIGHT { 7 | public: 8 | //vftable (no changes) 9 | //data (total size is 0x7C, base size is 0x20) 10 | int m_field20; 11 | int m_field24; 12 | int m_field28; 13 | int m_field2C; 14 | int m_field30; 15 | int m_field34; 16 | int m_field38; 17 | int m_field3C; 18 | int m_field40; 19 | int m_field44; 20 | int m_field48; 21 | int m_field4C; 22 | int m_field50; 23 | int m_field54; 24 | int m_field58; 25 | int m_field5C; 26 | int m_field60; 27 | int m_field64; 28 | int m_field68; 29 | int m_field6C; 30 | int m_field70; 31 | int m_field74; 32 | int m_field78; 33 | }; 34 | } -------------------------------------------------------------------------------- /ReHitman/Glacier/include/Glacier/AnimationManager.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace Glacier 4 | { 5 | class AnimationManager 6 | { 7 | public: 8 | // Data 9 | int field_0; 10 | int field_4; 11 | int field_8; 12 | int field_C; 13 | int field_10; 14 | int field_14; 15 | int field_18; 16 | int field_1C; 17 | int field_20; 18 | int field_24; 19 | int field_28; 20 | int field_2C; 21 | bool field_30; 22 | bool field_31; 23 | bool field_32; 24 | bool field_33; 25 | int field_34; 26 | int field_38; 27 | int field_3C; 28 | int field_40; 29 | int field_44; 30 | int field_48; 31 | int field_4C; 32 | int field_50; 33 | int field_54; 34 | int field_58; 35 | int field_5C; 36 | int field_60; 37 | int field_64; 38 | }; 39 | } -------------------------------------------------------------------------------- /ReHitman/BloodMoney/include/BloodMoney/Game/Actions/ZHitmanAction.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | namespace Hitman::BloodMoney 6 | { 7 | class ZHitman3; 8 | 9 | class ZHitmanAction : public Glacier::ZLnkAction 10 | { 11 | public: 12 | // vftable 13 | virtual void AddCallBack(float, int); //Animation::ActiveAnimation::ECallType 14 | virtual void AddCallBack(int, int); //ZHitmanAction::AddCallBack(MetaKey::Value,Animation::ActiveAnimation::ECallType) 15 | virtual void AddCallBack(const char*, int); // ZHitmanAction::AddCallBack(char const*,Animation::ActiveAnimation::ECallType) 16 | virtual void PlayAnim(Glacier::Animation::Header* anim, float, float); 17 | 18 | // data 19 | ZHitman3* m_player; 20 | int m_fieldC; 21 | int m_field10; 22 | int m_field14; 23 | int m_field18; 24 | int m_field1C; 25 | }; 26 | } -------------------------------------------------------------------------------- /ReHitman/Glacier/include/Glacier/EventBase/ZLnkAction.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | namespace Glacier 6 | { 7 | class ZLnkAction 8 | { 9 | public: 10 | // vftable 11 | virtual void Release(bool); 12 | virtual int GetActionId(); 13 | virtual bool Execute(); 14 | virtual void CallBack(); 15 | virtual void Update(); 16 | virtual void Terminate(); 17 | virtual void Save(int&); // unused 18 | virtual void Load(int&); // unused 19 | virtual const char* Name(); 20 | virtual bool DeleteOnExit(); 21 | virtual void AnimEnd(Animation::ActiveAnimation*); 22 | virtual void OnMetaKey(Animation::ActiveAnimation*, Animation::ZMetaKey*, const char*); 23 | virtual bool SupportsLoadSave(); 24 | virtual void LoadSave(ZPackedInput* packedInput, bool); 25 | 26 | // data 27 | int m_actionId; 28 | int m_field8; 29 | }; 30 | } -------------------------------------------------------------------------------- /ReHitman/BloodMoney/include/BloodMoney/Debug/GizmosControl.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | #include 6 | 7 | namespace Hitman::BloodMoney::Debug 8 | { 9 | enum class EGizmoLayer { 10 | Scene_OnEnd, ///< Called after d3d9 device present called 11 | ImGui_BeforeUI, ///< Called when ReHitman ready to draw debug UI and debug UI showed 12 | ImGui_AfterUI ///< Called when ReHitman finished to draw debug UI and ready to draw anything else in ImGui render stage 13 | }; 14 | 15 | using GizmoHandler = std::function; 16 | 17 | class GizmosControl { 18 | public: 19 | void RegisterGizmo(EGizmoLayer layer, const GizmoHandler& gizmoHandler); 20 | 21 | protected: 22 | void DrawGizmo(EGizmoLayer layer, IDirect3DDevice9* device); 23 | 24 | private: 25 | std::unordered_map> m_handlers; 26 | }; 27 | } -------------------------------------------------------------------------------- /ReHitman/Glacier/include/Glacier/ZSTL/MYSTR.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace Glacier 4 | { 5 | struct MYSTR 6 | { 7 | int field_0; 8 | const char *field_4; 9 | int field_8; 10 | int field_C; 11 | int field_10; 12 | int field_14; 13 | int field_18; 14 | int field_1C; 15 | int field_20; 16 | int field_24; 17 | int field_28; 18 | int field_2C; 19 | int field_30; 20 | int field_34; 21 | int field_38; 22 | int field_3C; 23 | int field_40; 24 | int field_44; 25 | int field_48; 26 | int field_4C; 27 | int field_50; 28 | int field_54; 29 | int field_58; 30 | int field_5C; 31 | int field_60; 32 | int field_64; 33 | int field_68; 34 | int field_6C; 35 | int field_70; 36 | int field_74; 37 | int field_78; 38 | int field_7C; 39 | }; 40 | 41 | } -------------------------------------------------------------------------------- /ReHitman/Glacier/include/Glacier/ZFactory.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | #include 6 | 7 | #include 8 | 9 | 10 | namespace Glacier 11 | { 12 | template 13 | struct ZFactory 14 | { 15 | static ZOldTypeInfo* Find(const char* psRequiredTypeName) 16 | { 17 | ZOldTypeInfo** factory = T::GetFactory(); 18 | 19 | if (!factory) { 20 | return nullptr; 21 | } 22 | 23 | for (int i = 0; i < 0xF; i++) { 24 | Glacier::ZOldTypeInfo* currentTypeInfo = factory[i]; 25 | if (!currentTypeInfo) { 26 | continue; 27 | } 28 | 29 | do { 30 | const std::string_view psName = currentTypeInfo->m_psName; 31 | 32 | if (psName == psRequiredTypeName) { 33 | return currentTypeInfo; 34 | } 35 | 36 | currentTypeInfo = currentTypeInfo->m_pNext; 37 | } while (currentTypeInfo); 38 | } 39 | 40 | return nullptr; 41 | } 42 | }; 43 | } -------------------------------------------------------------------------------- /ReHitman/BloodMoney/include/BloodMoney/Game/ZClothTracker.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | namespace Hitman::BloodMoney { 6 | class ZClothTracker : public Glacier::ZEventBase 7 | { 8 | public: 9 | //vftable (no changes) 10 | //api 11 | //static api 12 | //data (total size is 0x88, base size is 0x30) 13 | int m_field30; 14 | int m_field34; 15 | int m_field38; 16 | int m_field3C; 17 | int m_field40; 18 | int m_field44; 19 | int m_field48; 20 | int m_field4C; 21 | int m_field50; 22 | int m_field54; 23 | int m_field58; 24 | int m_field5C; 25 | int m_field60; 26 | int m_field64; 27 | float m_field68; 28 | float m_field6C; 29 | int m_field70; 30 | int m_field74; 31 | int m_field78; 32 | int m_field7C; 33 | int m_field80; 34 | int m_field84; 35 | }; 36 | } -------------------------------------------------------------------------------- /ReHitman/BloodMoney/source/Editors/CutSequencesPool.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | namespace Hitman::BloodMoney 4 | { 5 | CutSequencesPool& CutSequencesPool::GetInstance() 6 | { 7 | static CutSequencesPool instance; 8 | return instance; 9 | } 10 | 11 | void CutSequencesPool::Add(ZCutSequencePlayer* instance) 12 | { 13 | if (!instance) return; 14 | m_cutSequencePlayers.insert(instance); 15 | } 16 | 17 | void CutSequencesPool::Remove(ZCutSequencePlayer* instance) 18 | { 19 | if (!instance) return; 20 | m_cutSequencePlayers.erase(instance); 21 | } 22 | 23 | void CutSequencesPool::ForEach(std::function pred) 24 | { 25 | if (!pred) return; 26 | for (const auto& item : m_cutSequencePlayers) 27 | pred(item); 28 | } 29 | 30 | bool CutSequencesPool::IsEmpty() const 31 | { 32 | return m_cutSequencePlayers.empty(); 33 | } 34 | } -------------------------------------------------------------------------------- /ReHitman/Glacier/include/Glacier/Items/ZItemContainer.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | 6 | namespace Glacier 7 | { 8 | class ZItemContainer : public ZItem 9 | { 10 | public: 11 | // vftable 12 | virtual void InitItemContainerAction(); 13 | virtual void InsertItem(Glacier::ZREF itemRef, bool a2); 14 | virtual void RemoveItem(Glacier::ZREF itemRef); 15 | virtual REFTAB* GetContainedItems(); 16 | virtual bool CanContainItem(ZItem* item); 17 | 18 | // api 19 | void FreePos(ZItem* item); 20 | ZItem* OccupyPos(ZItem* item); 21 | bool IsContainerFull(); 22 | 23 | //data (total size is 0xC8, ZItem size is 0x84) 24 | ZAction* m_actionsHolder; 25 | ZMSGID m_MSG_REMOVEITEMFROMINVENTORY; 26 | ZMSGID field_8A; // not message, just alignment 27 | REFTAB* m_containedItems; 28 | REFTAB m_items; 29 | REFTAB m_reftabAC; 30 | }; 31 | } -------------------------------------------------------------------------------- /ReHitman/BloodMoney/include/BloodMoney/Game/UI/ZCHAROBJ.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | 10 | namespace Hitman::BloodMoney 11 | { 12 | class ZCHAROBJ : public ZWINOBJ 13 | { 14 | public: 15 | // vftable 16 | virtual void CreateGeometry(); 17 | virtual void SetFont(ZFONT*); 18 | virtual void SetText(char const*); 19 | virtual void SetText(char const*, uint32_t); 20 | virtual void SetTextId(char const*, char const*); 21 | virtual void Clear(); 22 | virtual int GetCharPosition(int); 23 | 24 | // api 25 | 26 | // data (size is 0xA0, base size is 0x88) 27 | int m_field88; 28 | int m_field8C; 29 | int m_field90; 30 | int m_field94; 31 | int m_field98; 32 | int m_field9C; 33 | }; 34 | } -------------------------------------------------------------------------------- /ReHitman/BloodMoney/include/BloodMoney/Game/UI/ZWINGROUP.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | 6 | namespace Hitman::BloodMoney 7 | { 8 | class ZWINDOWS; 9 | 10 | class ZWINGROUP : public Glacier::ZGROUP 11 | { 12 | public: 13 | //vftable 14 | virtual ZWINDOWS* GetSystem(); 15 | virtual void WndMessage(Glacier::ZWMEVENT*); 16 | virtual void GetMouseColi(Glacier::SMouseColi*, float*, float*); 17 | virtual void RecalcMaxMin(); 18 | virtual void CalcRealCenSize(float*, float*); 19 | virtual void SetText(const char*); 20 | virtual void SetAlpha(int); 21 | virtual void SetLineSpacing(int); 22 | virtual void SetField50(bool); 23 | 24 | //data (total size is 0x54, ZGROUP size is 0x4C) 25 | ZWINDOWS* m_pWinSystem; 26 | bool m_field50; 27 | bool m_field51; // ALIGN ONLY 28 | bool m_field52; // ALIGN ONLY 29 | bool m_field53; // ALIGN ONLY 30 | }; 31 | } -------------------------------------------------------------------------------- /ReHitman/Glacier/include/Glacier/ZEngineGeomControl.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | namespace Glacier 6 | { 7 | class ZEngineGeomControl 8 | { 9 | public: 10 | // vftable 11 | virtual bool GeomMoved(ZEntityLocator* pEntity); 12 | virtual void UpdateMovedGeoms(); 13 | virtual void Clear(); 14 | virtual void JonsLights(); // crash? 15 | 16 | /** 17 | * @brief Update lights for entities (must be derived from ZLIGHT) 18 | * @param ppEntities pointer to array of pointers to entities 19 | * @param iCount count of pointers in array 20 | */ 21 | virtual void UpdateChangedLights(ZEntityLocator** ppEntities, uint32_t iCount); 22 | 23 | // public api 24 | static ZEngineGeomControl* GetInstance(); 25 | 26 | // data 27 | ZEntityLocator* m_pool[128]; 28 | int field_204; 29 | int field_208; // enable custom light sources? (for weapon in inventory preview) 30 | }; 31 | } -------------------------------------------------------------------------------- /ReHitman/Glacier/include/Glacier/ZBaseConRout.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | 6 | namespace Glacier 7 | { 8 | struct ZBaseConRoutTypeInfo 9 | { 10 | char *m_psName; //0x0000 11 | uint32_t m_unk4; //0x0004 12 | uint32_t m_unk8; //0x0008 13 | uint32_t m_unkC; //0x000C 14 | uint32_t m_unk10; //0x0010 15 | uint32_t m_unk14; //0x0014 16 | uint32_t m_unk18; //0x0018 17 | uint32_t m_unk1C; //0x001C 18 | char *m_psClassName; //0x0020 19 | char *m_psParentName; //0x0024 20 | uint32_t m_unk28; //0x0028 21 | uint32_t m_unk2C; //0x002C 22 | uint32_t m_unk30; //0x0030 23 | uint32_t m_unk34; //0x0034 24 | uint32_t m_pProduce; //0x0038 25 | struct ZBaseConRoutTypeInfo *m_pNext; //0x003C 26 | uint32_t m_unk40; //0x0040 27 | uint32_t m_unk44; //0x0044 28 | uint32_t m_unk48; //0x0048 29 | uint32_t m_unk4C; //0x004C 30 | }; //Size: 0x0050 31 | 32 | class ZBaseConRout 33 | { 34 | public: 35 | // Internal API 36 | // Static 37 | static ZBaseConRoutTypeInfo** GetFactory(); 38 | }; 39 | } -------------------------------------------------------------------------------- /ReHitman/Glacier/include/Glacier/Items/ZItemState.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | 6 | namespace Glacier 7 | { 8 | class ZItemState : public ZEventBase 9 | { 10 | public: 11 | // vftable 12 | virtual void SetItemGeometry(ZItemTemplate* itemTemplate, ZItem* item); 13 | virtual void GetItemSettings(CCom* ccom); 14 | virtual ZGEOM* GetUseGeom(ZItem*); 15 | virtual bool IsMain(); 16 | virtual void EnableCamera(ZCAMERA*); 17 | 18 | // data (total size is 0x5C, ZEventBase size is 0x30) 19 | Glacier::ZMSGID m_MSG_ITEM_STATE_CREATE; 20 | Glacier::ZMSGID m_MSG_ITEM_SET_STATE; 21 | Glacier::ZMSGID m_MSG_ITEM_GET_ANIM_NAME; 22 | Glacier::ZMSGID m_field36; 23 | int m_field38; 24 | int m_isMain; 25 | int m_field40; 26 | int m_field44; 27 | int m_field48; 28 | int m_field4C; 29 | Glacier::ZREF m_useGeomREF; 30 | int m_field54; 31 | int m_field58; 32 | }; 33 | } -------------------------------------------------------------------------------- /ReHitman/Glacier/include/Glacier/ZRenderMaterialLayerD3DFX.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace Glacier 4 | { 5 | class ZRenderMaterialLayerD3DFX 6 | { 7 | public: 8 | // vftable 9 | virtual void Release(bool); 10 | virtual void Function_1(); 11 | virtual void Function_2(); 12 | virtual void Function_3(); 13 | virtual void Function_4(); 14 | virtual void Function_5(); 15 | virtual void Function_6(); 16 | virtual void Function_7(); //NULLSTUB 17 | virtual void Function_8(); 18 | virtual void Function_9(); //NULLSTUB 19 | virtual void Function_10(); //Return m_field14 if m_fieldC inited 20 | virtual void Function_11(); 21 | virtual void Function_12(); //NULLSTUB 22 | 23 | // data 24 | char* m_layerName; //0x0004 25 | char** m_pShaderName; //0x0008 26 | int m_fieldC; //0x000C 27 | char* m_techniqueName; //0x0010 28 | int m_field14; //0x0014 29 | int m_field18; //0x0018 30 | int m_field1C; //0x001C 31 | }; 32 | 33 | } -------------------------------------------------------------------------------- /ReHitman/Glacier/include/Glacier/ZScheduledUpdate.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace Glacier { 4 | class ZScheduledEvent; 5 | class ZEventBase; 6 | 7 | class ZScheduledUpdate { 8 | public: 9 | // vftable (no vftable) 10 | // data (size is 0x6C) 11 | int m_field0; 12 | int m_field4; 13 | int m_field8; 14 | int m_fieldC; 15 | int m_field10; 16 | int m_field14; 17 | int m_field18; 18 | int m_field1C; 19 | int m_field20; 20 | int m_field24; 21 | int m_field28; 22 | int m_field2C; 23 | int m_field30; 24 | int m_field34; 25 | int m_field38; 26 | int m_field3C; 27 | int m_field40; 28 | int m_array44[8]; 29 | int m_field64; 30 | int m_field68; 31 | 32 | // api 33 | ZScheduledEvent* AddEvent(ZEventBase* pHolder); 34 | void RemoveEvent(ZEventBase* pHolder); 35 | // void SetEvent(ZEventBase*, ZScheduledEvent*) was optimized on PC platform and no need to reconstruct it 36 | 37 | }; 38 | } -------------------------------------------------------------------------------- /ReHitman/BloodMoney/include/BloodMoney/Engine/ZHM3CameraBase.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | namespace Hitman::BloodMoney 6 | { 7 | class ZHM3CameraBase : public ZHM3CameraBaseFunc 8 | { 9 | public: 10 | //vftable 11 | virtual void Update(); 12 | virtual void UpdateCameraPosition(Glacier::Matrix3x3* pmMat, Glacier::Vector3* pvPos); 13 | virtual void Activate(); 14 | virtual void Deactivate(); 15 | virtual void UpdateInput(); 16 | virtual void AddPoseOffset(Glacier::Vector3* pvOffset); 17 | 18 | //data (base size is 0x10, current size is 24) 19 | int m_vtbl2; //contains self vtbl 20 | int m_field14; 21 | int m_field18; 22 | int m_field1C; 23 | int m_field20; 24 | }; 25 | 26 | /** 27 | * Size deduction scheme: 28 | * ZHM3Camera1stPerson | 0x24 29 | * ZHM3CameraBullet | 0x38 30 | * ZHM3CameraObservation | 0x64 31 | * ZHM3CameraBinocular | 0x80 32 | * ZHM3CameraScope | 0x84 33 | * ZHM3CameraDialog | 0xD4 34 | * ZHM3CameraConsole | 0x1D0 35 | * ZHM3CameraPositional | 0x1D0 36 | */ 37 | } -------------------------------------------------------------------------------- /ReHitman/Glacier/source/ZCAMERA.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | namespace Glacier 6 | { 7 | void ZCAMERA::SetFogEnabled(bool* bEnabled) 8 | { 9 | assert(G1ConfigurationService::G1API_FunctionAddress_ZCAMERA_SetFogEnabled != G1ConfigurationService::kNotConfiguredOption); 10 | 11 | if (G1ConfigurationService::G1API_FunctionAddress_ZCAMERA_SetFogEnabled != G1ConfigurationService::kNotConfiguredOption) 12 | { 13 | ((void(__thiscall*)(ZCAMERA*,bool*))G1ConfigurationService::G1API_FunctionAddress_ZCAMERA_SetFogEnabled)(this, bEnabled); 14 | } 15 | } 16 | 17 | bool ZCAMERA::IsFogEnabled() 18 | { 19 | assert(G1ConfigurationService::G1API_FunctionAddress_ZCAMERA_IsFogEnabled != G1ConfigurationService::kNotConfiguredOption); 20 | 21 | if (G1ConfigurationService::G1API_FunctionAddress_ZCAMERA_IsFogEnabled != G1ConfigurationService::kNotConfiguredOption) 22 | { 23 | return ((bool(__thiscall*)(ZCAMERA*))G1ConfigurationService::G1API_FunctionAddress_ZCAMERA_IsFogEnabled)(this); 24 | } 25 | 26 | return false; 27 | } 28 | } -------------------------------------------------------------------------------- /ReHitman/Glacier/include/Glacier/EventBase/ZLnkActionQueue.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | namespace Glacier 6 | { 7 | class ZIKLNKOBJ; 8 | class LINKREFTAB; 9 | 10 | class ZLnkActionQueue 11 | { 12 | public: 13 | // vftable 14 | virtual void Release(bool); 15 | virtual void Execute(ZLnkAction* action); 16 | virtual void Update(); 17 | virtual void CallBack(); 18 | virtual void OnMetaKey(Animation::ActiveAnimation*, Animation::ZMetaKey*, const char*); 19 | virtual void DropAction(); 20 | virtual void RemoveCurrentAction(); 21 | virtual void AnimEnd(Animation::ActiveAnimation*); 22 | virtual void LoadSave(ZPackedInput* packedInput, bool); 23 | virtual void CheckActionQueueForId(unsigned int); 24 | 25 | // api 26 | void DispatchNextAction(); 27 | void RemoveAction(ZLnkAction* action); 28 | 29 | // data (size is 0x10) 30 | ZLnkAction* m_currentAction; 31 | ZIKLNKOBJ* m_lnkObj; 32 | LINKREFTAB* m_actionsQueue; 33 | }; 34 | } -------------------------------------------------------------------------------- /ReHitman/Glacier/include/Glacier/ZSTL/ALLOCREF.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | namespace Glacier 6 | { 7 | class ALLOCREF 8 | { 9 | public: 10 | //vftable 11 | virtual void Release(bool); 12 | virtual Glacier::ZREF NewRef(); 13 | virtual int GetActiveRefs(REFTAB* out); 14 | virtual int GetNrActiveRefs(); 15 | virtual void FreeRef(Glacier::ZREF ref); 16 | virtual bool CheckRefActive(Glacier::ZREF ref); 17 | virtual void PrintRef(Glacier::ZREF ref); // Do nothing :( 18 | virtual REFTAB* GetRefStack(); 19 | virtual Glacier::ZREF* GetUsedRefs(); 20 | virtual void SetRefStack(REFTAB*); 21 | virtual void SetUsedRefs(Glacier::ZREF* refs, unsigned int count); 22 | 23 | //data 24 | int* m_usedRefs; 25 | REFTAB* m_refStack; 26 | int m_fieldC; 27 | int m_count; 28 | int m_capacity; 29 | bool m_field18; 30 | bool m_field18; 31 | bool m_field19; 32 | bool m_field1A; 33 | bool m_field1B; 34 | }; 35 | } -------------------------------------------------------------------------------- /ReHitman/Glacier/include/Glacier/ZSTL/ZLIST.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | 6 | namespace Glacier 7 | { 8 | class MeshNrs; // Unused in release? 9 | 10 | class ZLIST : public ZGEOM 11 | { 12 | public: 13 | /// === data === 14 | REFTAB* m_entries; //+0x10 15 | 16 | /// === vftable === 17 | virtual void SendCommandToList(Glacier::ZMSGID command, Glacier::ZDATA data); 18 | virtual void AddGeom(unsigned int); 19 | virtual void AddGeom(ZGEOM*); 20 | virtual void RemoveGeomById(unsigned int); 21 | virtual void RemoveGeomByPtr(ZGEOM*); 22 | virtual void AddMeshNrs(MeshNrs*); 23 | virtual int Script_GetRefNr(int); 24 | virtual int Script_GetCount(); 25 | 26 | /// === helpers === 27 | template T* At(size_t index) { 28 | if (index >= m_entries->Count()) { 29 | return nullptr; 30 | } 31 | return reinterpret_cast(m_entries->operator[](index)); 32 | } 33 | }; 34 | } -------------------------------------------------------------------------------- /ReHitman/Glacier/include/Glacier/ZBaseCamera.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | 6 | 7 | namespace Glacier 8 | { 9 | class ZBaseCamera : public ZEventBase 10 | { 11 | public: 12 | //vftable 13 | virtual bool Is1stPerson(); 14 | virtual void SetFollowGeom(Glacier::ZREF rGeom); 15 | virtual void SetFreeCam(bool bIsFree); 16 | virtual bool IsFreeCam(); 17 | virtual void GetFocalPos(Glacier::Vector3* pvFocalPos); 18 | virtual void GetFocalOffset(Glacier::Vector3* pvFocalOffset); 19 | virtual void GetCameraPosition(Glacier::Vector3* pvCameraPosition); 20 | virtual float GetQuality(); 21 | virtual void ActivateCamera(); 22 | virtual void DeactivateCamera(); 23 | virtual void EnableCamera(bool bIsEnabled); 24 | virtual void ResetCamToBestPos(); 25 | 26 | //data (base size is 0x30, current size is 0x40) 27 | bool m_bIsActive; 28 | bool m_bEnabled; 29 | bool m_field32; 30 | bool m_bIsFreeCam; 31 | float m_fFreeCamMouseSensitivity; 32 | float m_field38; 33 | uint16_t m_rFollowedGeom; 34 | uint16_t m_unk3E; 35 | }; 36 | } -------------------------------------------------------------------------------- /ReHitman/Glacier/source/ZMemory.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | #include 5 | 6 | namespace Glacier 7 | { 8 | void* UseManagedAllocator::operator new(size_t sz) 9 | { 10 | if (G1ConfigurationService::G1API_FunctionAddress_ZSysMem_Alloc != G1ConfigurationService::kNotConfiguredOption) 11 | { 12 | return ((void*(__cdecl*)(size_t, const char*, int))(G1ConfigurationService::G1API_FunctionAddress_ZSysMem_Alloc))(sz, __FILE__, __LINE__); 13 | } 14 | else 15 | { 16 | throw std::runtime_error { "UseManagedAllocator Fatal Error: The variable G1ConfigurationService::G1API_FunctionAddress_ZSysMem_Alloc not configured!" }; 17 | } 18 | } 19 | 20 | void UseManagedAllocator::operator delete(void* ptr) noexcept 21 | { 22 | if (G1ConfigurationService::G1API_FunctionAddress_ZSysMem_Free != G1ConfigurationService::kNotConfiguredOption) 23 | { 24 | ((void(*)(void*))(G1ConfigurationService::G1API_FunctionAddress_ZSysMem_Free))(ptr); 25 | } 26 | } 27 | } -------------------------------------------------------------------------------- /ReHitman/BloodMoney/source/Game/ZTie.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | namespace Hitman::BloodMoney 6 | { 7 | void ZTie::HideTie(bool value) { 8 | assert(BMConfigurationService::BMAPI_FunctionAddress_ZTie_HideTie != BMConfigurationService::kNotConfiguredOption); 9 | if (BMConfigurationService::BMAPI_FunctionAddress_ZTie_HideTie != BMConfigurationService::kNotConfiguredOption) 10 | { 11 | ((void(__thiscall*)(ZTie*, bool))(BMConfigurationService::BMAPI_FunctionAddress_ZTie_HideTie))(this, value); 12 | } 13 | } 14 | 15 | void ZTie::HideTieInMirror(bool value) { 16 | assert(BMConfigurationService::BMAPI_FunctionAddress_ZTie_HideTieInMirror != BMConfigurationService::kNotConfiguredOption); 17 | if (BMConfigurationService::BMAPI_FunctionAddress_ZTie_HideTieInMirror != BMConfigurationService::kNotConfiguredOption) 18 | { 19 | ((void(__thiscall*)(ZTie*, bool))(BMConfigurationService::BMAPI_FunctionAddress_ZTie_HideTieInMirror))(this, value); 20 | } 21 | } 22 | } -------------------------------------------------------------------------------- /ReHitman/BloodMoney/include/BloodMoney/Game/Items/ZHM3ItemWeaponCustomTemplate.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | namespace Hitman::BloodMoney 6 | { 7 | class ZHM3ItemWeaponCustomTemplate : public ZHM3ItemTemplateWeapon 8 | { 9 | public: 10 | /// vftable 11 | virtual void* GetCustomData(); 12 | virtual void SetMuzzleVelocity(float); 13 | 14 | /// data (total size is 0x1FC, base size is 0x1A0) 15 | int m_field1A0; 16 | int m_field1A4; 17 | int m_field1A8; 18 | int m_customData; 19 | int m_field1B0; 20 | int m_field1B4; 21 | int m_field1B8; 22 | int m_field1BC; 23 | int m_field1C0; 24 | int m_field1C4; 25 | int m_field1C8; 26 | int m_field1CC; 27 | int m_field1D0; 28 | int m_field1D4; 29 | int m_field1D8; 30 | int m_field1DC; 31 | int m_field1E0; 32 | int m_field1E4; 33 | int m_field1E8; 34 | int m_field1EC; 35 | int m_field1F0; 36 | int m_field1F4; 37 | int m_field1F8; 38 | }; 39 | } -------------------------------------------------------------------------------- /ReHitman/BloodMoney/include/BloodMoney/Game/UI/ZFONT.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | namespace Hitman::BloodMoney { 6 | struct SCharInfo { 7 | uint32_t charCode; 8 | uint32_t unk0; 9 | uint32_t unk1; 10 | uint32_t unk2; 11 | uint32_t unk3; 12 | }; 13 | 14 | enum EFontFilterMode { 15 | FFM_Normal, 16 | FFM_Add, 17 | FFM_Sub, 18 | FFM_Invert 19 | }; 20 | 21 | class ZFONT : public ZWINOBJ { 22 | public: 23 | // vftable 24 | // at least 5 virtual methods 25 | virtual int GetNumTextures(); // It's pure virtual for base class ZFONT 26 | virtual SCharInfo* GetCharInfo(unsigned int); // It's pure virtual for base class ZFONT 27 | virtual int GetMaxHeight(); // It's pure virtual for base class ZFONT 28 | virtual bool ContainsChar(unsigned int); // It's pure virtual for base class ZFONT 29 | virtual void* GetKerning(unsigned int, unsigned int); // It's pure virtual for base class ZFONT 30 | // data (size is 0x88, base size is 0x88) 31 | }; 32 | } -------------------------------------------------------------------------------- /ReHitman/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.16) 2 | project(ReHitman) 3 | 4 | set(CMAKE_CXX_STANDARD 20) 5 | 6 | add_definitions(-D_CRT_SECURE_NO_WARNINGS=1) #MSVS Stuff 7 | 8 | add_subdirectory(Modules/fmt) 9 | add_subdirectory(Modules/spdlog) 10 | add_subdirectory(Modules/ImGui) 11 | add_subdirectory(Modules/HF) 12 | add_subdirectory(Modules/gtest) 13 | 14 | add_subdirectory(Glacier) 15 | add_subdirectory(BloodMoney) 16 | add_subdirectory(Client) 17 | add_subdirectory(NVCPL) 18 | 19 | file(GLOB_RECURSE REHITMAN_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/DLL/source/*.cpp) 20 | 21 | set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON) 22 | 23 | add_library(ReHitman SHARED ${REHITMAN_SOURCES}) 24 | target_include_directories(ReHitman PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/DLL/include) 25 | target_link_libraries(ReHitman PUBLIC G1::Core ReHitman::IClient spdlog fmt::fmt) 26 | 27 | # For BloodMoney only (TODO: Create abstraction for this later) 28 | target_link_libraries(ReHitman PRIVATE Hitman::BloodMoney ImGui::Core ImGui::DX9) 29 | target_compile_definitions(ReHitman PRIVATE -DREHITMAN_BLOOD_MONEY_PROJECT=1) #Build for HitmanBloodMoney 30 | 31 | add_dependencies(ReHitman NVCPL) -------------------------------------------------------------------------------- /ReHitman/Glacier/source/CCom.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | namespace Glacier { 6 | const char* CCom::Ent::GetKey() { 7 | return reinterpret_cast(this) + 0xC; 8 | } 9 | 10 | std::intptr_t CCom::Ent::GetValue() { 11 | return *reinterpret_cast(reinterpret_cast(reinterpret_cast(this) + 0xC + m_iKeyLength)); 12 | } 13 | 14 | CCom::Ent* CCom::GetPVal(const char *psName, int iSize) { 15 | assert(psName != nullptr); 16 | assert(iSize > 0); 17 | assert(G1ConfigurationService::G1API_FunctionAddress_CCom_GetpVal != G1ConfigurationService::kNotConfiguredOption); 18 | 19 | if (!psName || !iSize) { 20 | return nullptr; 21 | } 22 | 23 | if (G1ConfigurationService::G1API_FunctionAddress_CCom_GetpVal != G1ConfigurationService::kNotConfiguredOption) { 24 | return ((CCom::Ent*(__thiscall*)(CCom*, const char*, int))G1ConfigurationService::G1API_FunctionAddress_CCom_GetpVal)(this, psName, iSize); 25 | } 26 | 27 | return nullptr; 28 | } 29 | } -------------------------------------------------------------------------------- /ReHitman/Glacier/include/Glacier/ZCTRLIKLNKOBJ.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | 6 | namespace Glacier 7 | { 8 | class ZCTRLIKLNKOBJ : public ZIKLNKOBJ 9 | { 10 | public: 11 | //vftable 12 | virtual void SetController(int*); 13 | virtual int GetController(); 14 | virtual void SetContactGeom(Glacier::ZREF ref); 15 | virtual Glacier::ZREF GetContactGeom(); 16 | virtual bool CanOperateObject(ZAction*, ZMat3x3*, ZVector3*, bool); 17 | virtual void OperateObject(ZAction*); 18 | virtual bool IsRunning(); 19 | virtual bool IsSneaking(); 20 | virtual bool IsDead(); 21 | virtual void SetLightReceived(float); 22 | virtual float LightReceived(); 23 | virtual void ReducesSight(unsigned int); 24 | virtual void GetSeerPosDir(ZVector3* pos, ZVector3* dir); 25 | virtual void GetVisionPos(ZVector3* pos); 26 | 27 | //data (total size is 0x1A0, base size is 0x190) 28 | int m_controller; 29 | int m_contactGeom; 30 | int m_fLightReceived; 31 | int m_field19C; 32 | }; 33 | } -------------------------------------------------------------------------------- /ReHitman/Glacier/include/Glacier/ZProjectile.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | #include 6 | 7 | #include 8 | 9 | namespace Glacier 10 | { 11 | class ZProjectile : public ZEventBase 12 | { 13 | public: 14 | // vtable 15 | virtual void SetTarget(ZVector3* pTarget); 16 | virtual void SetProjectileInfo(CProjectileActivate* pActivationInfo); 17 | virtual void ShotImpact(COLI* pColi); 18 | 19 | // size is 0x84 (base size is 0x30) 20 | int m_field30; 21 | int m_field34; 22 | int m_field38; 23 | int m_field3C; 24 | int m_field40; 25 | int m_field44; 26 | int m_field48; 27 | int m_field4C; 28 | int m_field50; 29 | int m_field54; 30 | int m_field58; 31 | int m_field5C; 32 | int m_field60; 33 | int m_field64; 34 | int m_field68; 35 | int m_field6C; 36 | int m_field70; 37 | int m_field74; 38 | int m_field78; 39 | int m_field7C; 40 | int m_field80; 41 | }; 42 | } -------------------------------------------------------------------------------- /ReHitman/Glacier/source/ZGameStats.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | namespace Glacier { 6 | void ZGameStats::IncreaseCurrentShotCount() { 7 | assert(G1ConfigurationService::G1API_FunctionAddress_ZGameStats_IncreaseCurrentShotCount != G1ConfigurationService::kNotConfiguredOption); 8 | if (G1ConfigurationService::G1API_FunctionAddress_ZGameStats_IncreaseCurrentShotCount != G1ConfigurationService::kNotConfiguredOption) { 9 | ((void(__thiscall*)(ZGameStats*))G1ConfigurationService::G1API_FunctionAddress_ZGameStats_IncreaseCurrentShotCount)(this); 10 | } 11 | } 12 | 13 | void ZGameStats::DecreaseCurrentShotCount() { 14 | assert(G1ConfigurationService::G1API_FunctionAddress_ZGameStats_DecreaseCurrentShotCount != G1ConfigurationService::kNotConfiguredOption); 15 | if (G1ConfigurationService::G1API_FunctionAddress_ZGameStats_DecreaseCurrentShotCount != G1ConfigurationService::kNotConfiguredOption) { 16 | ((void(__thiscall*)(ZGameStats*))G1ConfigurationService::G1API_FunctionAddress_ZGameStats_DecreaseCurrentShotCount)(this); 17 | } 18 | } 19 | } -------------------------------------------------------------------------------- /ReHitman/Glacier/source/Geom/ZENVIRONMENT.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | namespace Glacier { 6 | void ZENVIRONMENT::ToggleColor(bool value) { 7 | assert(G1ConfigurationService::G1API_FunctionAddress_ZENVIRONMENT_ToggleColor != G1ConfigurationService::kNotConfiguredOption); 8 | if (G1ConfigurationService::G1API_FunctionAddress_ZENVIRONMENT_ToggleColor != G1ConfigurationService::kNotConfiguredOption) { 9 | ((void(__thiscall*)(ZENVIRONMENT*,bool))G1ConfigurationService::G1API_FunctionAddress_ZENVIRONMENT_ToggleColor)(this, value); 10 | } 11 | } 12 | 13 | void ZENVIRONMENT::SetDiffuseColor(unsigned int c1, unsigned int c2) { 14 | assert(G1ConfigurationService::G1API_FunctionAddress_ZENVIRONMENT_SetDiffuseColor != G1ConfigurationService::kNotConfiguredOption); 15 | if (G1ConfigurationService::G1API_FunctionAddress_ZENVIRONMENT_SetDiffuseColor != G1ConfigurationService::kNotConfiguredOption) { 16 | ((void(__thiscall*)(ZENVIRONMENT*,unsigned int,unsigned int))G1ConfigurationService::G1API_FunctionAddress_ZENVIRONMENT_SetDiffuseColor)(this,c1,c2); 17 | } 18 | } 19 | } -------------------------------------------------------------------------------- /ReHitman/Glacier/source/ZScriptC.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | namespace Glacier 6 | { 7 | int ZScriptC::FindScript(const char* scriptName) { 8 | assert(G1ConfigurationService::G1API_FunctionAddress_ZScriptC_FindScript != G1ConfigurationService::kNotConfiguredOption); 9 | if (G1ConfigurationService::G1API_FunctionAddress_ZScriptC_FindScript != G1ConfigurationService::kNotConfiguredOption) { 10 | return ((int(__thiscall*)(ZScriptC*, const char*))(G1ConfigurationService::G1API_FunctionAddress_ZScriptC_FindScript))(this, scriptName); 11 | } 12 | return 0; 13 | } 14 | 15 | int ZScriptC::CreateScript(int pScriptCreator) { 16 | assert(G1ConfigurationService::G1API_FunctionAddress_ZScriptC_CreateScript != G1ConfigurationService::kNotConfiguredOption); 17 | if (G1ConfigurationService::G1API_FunctionAddress_ZScriptC_CreateScript != G1ConfigurationService::kNotConfiguredOption) { 18 | return ((int(__thiscall*)(ZScriptC*, int))(G1ConfigurationService::G1API_FunctionAddress_ZScriptC_CreateScript))(this, pScriptCreator); 19 | } 20 | 21 | return 0; 22 | } 23 | } -------------------------------------------------------------------------------- /ReHitman/BloodMoney/include/BloodMoney/Game/UI/ZSimpleDisplay.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | #include 6 | 7 | namespace Hitman::BloodMoney 8 | { 9 | 10 | class ZSimpleDisplay : public CWinEvent 11 | { 12 | public: 13 | //vftable 14 | virtual bool AllClear(); 15 | virtual void SetModified(bool); 16 | virtal void ChangeText(Glacier::zstring str, int, float); 17 | 18 | //data (total size is 0x80, base size is 0x30) 19 | int m_field30; 20 | int m_field34; 21 | Glacier::zstring m_text; 22 | int m_field44; 23 | float m_field48; 24 | int m_field4C; 25 | int m_field50; 26 | int m_field54; 27 | char m_field58; 28 | char field_59; 29 | char field_5A; 30 | char field_5B; 31 | Glacier::zstring m_field5C; 32 | int m_field68; 33 | int m_field6C; 34 | int m_field70; 35 | int m_field74; 36 | int m_field78; 37 | bool m_field7C; 38 | bool m_field7D; 39 | bool m_field7E; 40 | bool m_field7F; 41 | }; 42 | } -------------------------------------------------------------------------------- /ReHitman/BloodMoney/include/BloodMoney/Game/UI/ZHM3MenuElements.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace Hitman::BloodMoney 4 | { 5 | class ZGUIBase; 6 | class ZXMLGUISystem; 7 | class ZStandardMenuFactory; 8 | class ZHM3MenuFactory; 9 | class ZOnlineElements; 10 | 11 | class ZHM3MenuElements 12 | { 13 | public: 14 | /// === members === 15 | ZXMLGUISystem* m_XMLGUISystem; //0x0004 16 | char pad_0008[8196]; //0x0008 17 | ZStandardMenuFactory* m_standardMenuFactory_1; //0x200C 18 | ZHM3MenuFactory* m_hm3MenuFactory_1; //0x2010 19 | ZOnlineElements* m_onlineElementsFactory; //0x2014 20 | char pad_2018[8]; //0x2018 21 | ZStandardMenuFactory* m_standardMenuFactory; //0x2020 22 | ZHM3MenuFactory* m_hm3MenuFactory; //0x2024 23 | 24 | /// === vftable === 25 | virtual void Release(bool); 26 | virtual void Init(); 27 | virtual void ReadXML(); 28 | virtual void WindowClosed(const char* menuName); 29 | virtual void GetOptionsInterface(); 30 | virtual void GetActivatedBy(int); 31 | 32 | // === api === 33 | ZGUIBase* GetGUIElement(const char* psElementName); 34 | }; 35 | } -------------------------------------------------------------------------------- /ReHitman/BloodMoney/source/Game/OnLevel/CMetalDetector.cpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | #include 6 | 7 | namespace Hitman::BloodMoney 8 | { 9 | void CMetalDetector::DoDetectWeapon() 10 | { 11 | assert(BMConfigurationService::BMAPI_FunctionAddress_CMetalDetector_DoDetectWeapon != BMConfigurationService::kNotConfiguredOption); 12 | if (BMConfigurationService::BMAPI_FunctionAddress_CMetalDetector_DoDetectWeapon != BMConfigurationService::kNotConfiguredOption) 13 | { 14 | ((void(__thiscall*)(CMetalDetector*))(BMConfigurationService::BMAPI_FunctionAddress_CMetalDetector_DoDetectWeapon))(this); 15 | } 16 | } 17 | 18 | void CMetalDetector::DoAlarm() 19 | { 20 | assert(BMConfigurationService::BMAPI_FunctionAddress_CMetalDetector_DoAlarm != BMConfigurationService::kNotConfiguredOption); 21 | if (BMConfigurationService::BMAPI_FunctionAddress_CMetalDetector_DoAlarm != BMConfigurationService::kNotConfiguredOption) 22 | { 23 | ((void(__thiscall*)(CMetalDetector*))(BMConfigurationService::BMAPI_FunctionAddress_CMetalDetector_DoAlarm))(this); 24 | } 25 | } 26 | } -------------------------------------------------------------------------------- /ReHitman/Glacier/source/CInventory.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | namespace Glacier 6 | { 7 | Glacier::ZItem* CInventory::AddItem(Glacier::ZREF itemREF) 8 | { 9 | assert(G1ConfigurationService::G1API_FunctionAddress_CInventory_AddItem != G1ConfigurationService::kNotConfiguredOption); 10 | if (G1ConfigurationService::G1API_FunctionAddress_CInventory_AddItem != G1ConfigurationService::kNotConfiguredOption) { 11 | return ((Glacier::ZItem*(__thiscall*)(Glacier::CInventory*, Glacier::ZREF))(G1ConfigurationService::G1API_FunctionAddress_CInventory_AddItem))(this, itemREF); 12 | } 13 | 14 | return 0; 15 | } 16 | 17 | void CInventory::RemoveItem(Glacier::ZREF itemREF) 18 | { 19 | assert(G1ConfigurationService::G1API_FunctionAddress_CInventory_RemoveItem != G1ConfigurationService::kNotConfiguredOption); 20 | if (G1ConfigurationService::G1API_FunctionAddress_CInventory_RemoveItem != G1ConfigurationService::kNotConfiguredOption) { 21 | ((void(__thiscall*)(Glacier::CInventory*, Glacier::ZREF))(G1ConfigurationService::G1API_FunctionAddress_CInventory_RemoveItem))(this, itemREF); 22 | } 23 | } 24 | } -------------------------------------------------------------------------------- /ReHitman/BloodMoney/include/BloodMoney/Game/ZHM3WeaponUpgradeControl.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | 6 | namespace Hitman::BloodMoney { 7 | class ZHM3ItemWeaponCustom; 8 | 9 | enum class EWeaponType { 10 | EW_PISTOL = 1, 11 | EW_ASSAULT_RIFLE = 2, 12 | EW_SUB_MACHINE_GUN = 3, 13 | EW_SHOTGUN = 4, 14 | EW_UNKNOWN = 0 15 | }; 16 | 17 | class ZHM3WeaponUpgradeControl : public Glacier::ZGROUP 18 | { 19 | public: 20 | // vtbl (no ext methods) 21 | 22 | // api 23 | void InitWeaponReferences(); 24 | void ApplyDefaultUpgrades(EWeaponType weaponType, ZHM3ItemWeaponCustom* pCustomGun); 25 | 26 | // static methods 27 | static EWeaponType GetWeaponType(const char* psWeaponName); 28 | 29 | // data (total size is 0x60, base size is 0x4C) 30 | int m_field4C; //Pointer to array of possible weapon upgrade groups (as I understand) 31 | Glacier::ZGEOM* m_pCustomGunHardballerUpgradeWeapon; 32 | Glacier::ZGEOM* m_pCustomRifleAssaultUpgradeWeapon; 33 | Glacier::ZGEOM* m_pCusomSmgUpgradeWeapon; 34 | Glacier::ZGEOM* m_pCustomRifleShotgunUpgradeWeapon; 35 | }; 36 | } -------------------------------------------------------------------------------- /ReHitman/BloodMoney/source/Game/OnLevel/ZVCR.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | namespace Hitman::BloodMoney 6 | { 7 | void ZVCR::SetTapeStolen(bool value) { 8 | assert(BMConfigurationService::BMAPI_GlobalVariableAddress_ZVCR_m_msgStealTape != BMConfigurationService::kNotConfiguredOption); 9 | if (BMConfigurationService::BMAPI_GlobalVariableAddress_ZVCR_m_msgStealTape != BMConfigurationService::kNotConfiguredOption) 10 | { 11 | auto pVariable = reinterpret_cast(BMConfigurationService::BMAPI_GlobalVariableAddress_ZVCR_m_msgStealTape); 12 | *pVariable = value; 13 | } 14 | } 15 | 16 | bool ZVCR::TapeWasStolen() { 17 | assert(BMConfigurationService::BMAPI_GlobalVariableAddress_ZVCR_m_msgStealTape != BMConfigurationService::kNotConfiguredOption); 18 | if (BMConfigurationService::BMAPI_GlobalVariableAddress_ZVCR_m_msgStealTape != BMConfigurationService::kNotConfiguredOption) 19 | { 20 | auto pVariable = reinterpret_cast(BMConfigurationService::BMAPI_GlobalVariableAddress_ZVCR_m_msgStealTape); 21 | return *pVariable; 22 | } 23 | 24 | return false; 25 | } 26 | } -------------------------------------------------------------------------------- /ReHitman/Glacier/source/EventBase/ZLnkActionQueue.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | namespace Glacier 6 | { 7 | void ZLnkActionQueue::DispatchNextAction() 8 | { 9 | assert(G1ConfigurationService::G1API_FunctionAddress_ZLnkActionQueue_DispatchNextAction != G1ConfigurationService::kNotConfiguredOption); 10 | if (G1ConfigurationService::G1API_FunctionAddress_ZLnkActionQueue_DispatchNextAction != G1ConfigurationService::kNotConfiguredOption) 11 | { 12 | ((void(__thiscall*)(ZLnkActionQueue*))(G1ConfigurationService::G1API_FunctionAddress_ZLnkActionQueue_DispatchNextAction))(this); 13 | } 14 | } 15 | 16 | void ZLnkActionQueue::RemoveAction(ZLnkAction* action) 17 | { 18 | assert(G1ConfigurationService::G1API_FunctionAddress_ZLnkActionQueue_RemoveAction != G1ConfigurationService::kNotConfiguredOption); 19 | if (G1ConfigurationService::G1API_FunctionAddress_ZLnkActionQueue_RemoveAction != G1ConfigurationService::kNotConfiguredOption) 20 | { 21 | ((void(__thiscall*)(ZLnkActionQueue*, ZLnkAction*))(G1ConfigurationService::G1API_FunctionAddress_ZLnkActionQueue_RemoveAction))(this, action); 22 | } 23 | } 24 | } -------------------------------------------------------------------------------- /ReHitman/BloodMoney/include/BloodMoney/Game/SDifficultySettings.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace Hitman::BloodMoney { 4 | struct SDifficultySettings { 5 | //total size is 0xA4 6 | int m_field0; 7 | int m_field4; 8 | int m_field8; 9 | int m_fieldC; 10 | int m_field10; 11 | int m_field14; 12 | int m_field18; 13 | int m_field1C; 14 | int m_field20; 15 | int m_field24; 16 | int m_field28; 17 | int m_field2C; 18 | int m_field30; 19 | int m_field34; 20 | int m_field38; 21 | int m_field3C; 22 | int m_field40; 23 | int m_field44; 24 | int m_field48; 25 | int m_field4C; 26 | int m_field50; 27 | int m_field54; 28 | int m_field58; 29 | int m_field5C; 30 | int m_field60; 31 | int m_field64; 32 | int m_field68; 33 | int m_field6C; 34 | int m_field70; 35 | int m_field74; 36 | int m_field78; 37 | int m_field7C; 38 | int m_field80; 39 | int m_field84; 40 | int m_field88; 41 | int m_field8C; 42 | int m_field90; 43 | int m_field94; 44 | int m_field98; 45 | int m_field9C; 46 | int m_fieldA0; 47 | }; 48 | } -------------------------------------------------------------------------------- /ReHitman/BloodMoney/include/BloodMoney/Patches/CommonPatches.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | #include 6 | #include 7 | 8 | namespace Hitman::BloodMoney 9 | { 10 | class CommonPatches 11 | { 12 | private: 13 | HF::Win32::ProcessRef m_process; 14 | HF::Win32::ModuleRef m_selfMod; 15 | HF::Win32::ModuleRef m_d3d9Mod; 16 | bool m_isInited { false }; 17 | std::vector m_patches; 18 | public: 19 | using Ptr = std::shared_ptr; 20 | 21 | CommonPatches( 22 | const HF::Win32::ProcessPtr& process, 23 | const HF::Win32::ModulePtr& selfModule, 24 | const HF::Win32::ModulePtr& d3d9 25 | ); 26 | 27 | bool Setup(); 28 | void Release(); 29 | 30 | template 31 | void RegisterPatch(Args&&... args) requires (std::is_constructible_v && std::is_base_of_v) 32 | { 33 | //TODO: May be emplace_back? 34 | auto patch = std::make_shared(std::forward(args)...); 35 | m_patches.push_back(patch); 36 | } 37 | }; 38 | 39 | } -------------------------------------------------------------------------------- /ReHitman/DLL/source/Logger.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | #include 5 | 6 | namespace ReHitman 7 | { 8 | void Logger::Setup() 9 | { 10 | } 11 | 12 | void Logger::Shutdown() 13 | { 14 | spdlog::shutdown(); 15 | } 16 | 17 | void Logger::Assert(bool condition, 18 | std::string_view function, 19 | std::string_view file, 20 | unsigned int line, 21 | std::string_view message, 22 | std::string_view condition_str) 23 | { 24 | if (!condition) 25 | { 26 | const auto msg = fmt::format( 27 | "ASSERTION FAILED!\n\n" 28 | "Message : {}\n" 29 | "Condition: {}\n" 30 | "Function : {}\n" 31 | "Line: {}\n" 32 | "File: {}\n", 33 | message.data(), 34 | condition_str.data(), 35 | function.data(), 36 | line, 37 | file.data() 38 | ); 39 | 40 | MessageBox(nullptr, msg.data(), "ASSERTION FAILED!", MB_ICONEXCLAMATION | MB_OK); 41 | ExitProcess(EXIT_FAILURE); 42 | } 43 | } 44 | } -------------------------------------------------------------------------------- /ReHitman/BloodMoney/source/Delegates/ImGuiInputDelegate.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | #include 5 | #include 6 | 7 | // Win32 message handler 8 | extern LRESULT ImGui_ImplWin32_WndProcHandler(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam); 9 | 10 | namespace Hitman::BloodMoney 11 | { 12 | namespace Globals 13 | { 14 | extern std::unique_ptr g_pDebugTools; 15 | } 16 | 17 | void ImGuiInputDelegate::setKeyState(int keyCode, int state) 18 | { 19 | if (keyCode == VK_F3 && !state && Globals::g_pDebugTools) 20 | { 21 | Globals::g_pDebugTools->toggleVisibility(); 22 | } 23 | } 24 | 25 | void ImGuiInputDelegate::setMouseKeyState(int keyId, bool state) 26 | { 27 | ImGuiIO& io = ImGui::GetIO(); 28 | if (keyId >= 0 && keyId <= 1) 29 | { 30 | io.MouseDown[keyId] = state; 31 | } 32 | } 33 | 34 | void ImGuiInputDelegate::setMouseWheelState(float dt) 35 | { 36 | ImGuiIO& io = ImGui::GetIO(); 37 | io.MouseWheel += dt; 38 | } 39 | 40 | void ImGuiInputDelegate::onWindowsEvent(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) 41 | { 42 | ImGui_ImplWin32_WndProcHandler(hWnd, msg, wParam, lParam); 43 | } 44 | } -------------------------------------------------------------------------------- /ReHitman/Glacier/include/Glacier/CInventory.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include 8 | 9 | namespace Glacier 10 | { 11 | class ZItem; 12 | 13 | class CInventory : public ZEventBase 14 | { 15 | public: 16 | // const 17 | static constexpr const char* Name = "Inventory"; 18 | 19 | // vftable 20 | virtual void GiveItem(const char*); 21 | virtual void GiveItemInGroup(ZGROUP* group, const char* item); 22 | virtual void GiveAllItemsInGroup(ZGROUP* group); 23 | virtual void GiveAllItems(); 24 | virtual void CreateTakeActions(); 25 | virtual int GetItemFromItemTemplate(ZItemTemplate* itemTemplate, bool); 26 | virtual REFTAB32* GetInventoryList(); 27 | virtual void TransferInventoryTo(ZGEOM* target); 28 | 29 | // api 30 | ZItem* AddItem(Glacier::ZREF itemREF); 31 | void RemoveItem(Glacier::ZREF itemREF); 32 | 33 | // data 34 | int field_30; 35 | REFTAB m_reftab; 36 | REFTAB32 m_inventoryList; 37 | REFTAB32 m_reftab32_2; 38 | }; 39 | 40 | static_assert(offsetof(CInventory, field_30) == 0x30, "CInventory| Bad offset of field_30"); 41 | } -------------------------------------------------------------------------------- /ReHitman/Glacier/include/Glacier/ZDrawBuffer.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | #include 6 | 7 | namespace Glacier { 8 | class ZRenderDrawD3D; 9 | class ZRenderEntryCameraD3D; 10 | class ZRenderEntry; 11 | 12 | class ZDrawBuffer 13 | { 14 | public: 15 | // data 16 | int32_t m_unk4; //0x0004 17 | ZRenderEntry** m_pVSpritesArray; //0x0008 18 | int32_t m_iViewportWidth; //0x000C 19 | int32_t m_iViewportHeight; //0x0010 20 | char pad_0014[4]; //0x0014 21 | ZRenderEntry** m_pVGeomsArray; //0x0018 22 | ZRenderDrawD3D* m_pRenderDraw; //0x001C 23 | char pad_0020[4]; //0x0020 24 | ZRenderWintelD3D* m_pRenderWintel; //0x0024 25 | char pad_0028[16]; //0x0028 26 | ZCAMERA* m_pCamera; //0x0038 27 | ZRenderEntryCameraD3D* m_pRenderEntryCamera; //0x003C 28 | char pad_0040[4]; //0x0040 29 | ZVector4* m_pV2Viewport; //0x0044 30 | // vftable 31 | 32 | virtual int32_t GetSizeX(); // return [0xC] 33 | virtual int32_t GetSizeY(); // return [0x10] 34 | virtual double GetPixelAspectXY(); 35 | // possible DrawBonesArray 36 | // possible DrawSpritesArray 37 | 38 | }; //Size: 0x02C0 39 | 40 | using ZDrawBufferSimple = ZDrawBuffer; // Alias for HBM 41 | } -------------------------------------------------------------------------------- /ReHitman/Glacier/include/Glacier/ZRenderDrawD3D.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace Glacier { 4 | class IView; 5 | class ZRenderWintelD3D; 6 | 7 | enum EViewTarget { 8 | DEFAULT_TARGET = 1 9 | }; 10 | 11 | class ZRenderDrawD3D { 12 | public: 13 | // vftable 14 | virtual bool IsValid(); 15 | virtual bool ShouldFlush(); 16 | virtual void InitAllocation(); 17 | virtual int GetLargestFreeBlock(); // always 0 18 | virtual void* Alloc(int size, const char* source, unsigned int line); // source and line are unused 19 | virtual void Free(void* ptr, int); 20 | virtual void* AllocSprites(int count); 21 | virtual void FreeSprites(void* ptr, int); 22 | virtual IView* CreateView(ZRenderWintelD3D* pRender, unsigned int, EViewTarget target); 23 | virtual IView* FindView(unsigned int); 24 | virtual IView* GetViewByIndex(int); 25 | virtual void RemoveView(IView* pView); 26 | virtual void RemoveViewsUsingRender(ZRenderWintelD3D* pRender); 27 | virtual void Init(); 28 | virtual void End(); 29 | virtual void Unknown_0(); //? 30 | virtual void Unknown_1(); //? 31 | virtual void Unknown_2(); //? 32 | virtual void NullStub_0(); //? 33 | virtual void Flush(); 34 | /// ... Unknown entities ... 35 | 36 | // size (0x58864) 37 | }; 38 | } -------------------------------------------------------------------------------- /ReHitman/Glacier/source/Geom/ZGROUP.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | #include 5 | 6 | #include 7 | 8 | namespace Glacier 9 | { 10 | ZGEOM* ZGROUP::CreateGeom(const char* name, int typeId, bool unk3) 11 | { 12 | assert(G1ConfigurationService::G1API_FunctionAddress_ZGROUP_CreateGeom != G1ConfigurationService::kNotConfiguredOption); 13 | if (G1ConfigurationService::G1API_FunctionAddress_ZGROUP_CreateGeom != G1ConfigurationService::kNotConfiguredOption) 14 | { 15 | using ZGROUP_CreateGeomFn = ZGEOM*(__thiscall*)(ZGROUP*, const char*, int, bool); 16 | auto ZGROUP_CreateGeomImpl = (ZGROUP_CreateGeomFn)G1ConfigurationService::G1API_FunctionAddress_ZGROUP_CreateGeom; 17 | return ZGROUP_CreateGeomImpl(this, name, typeId, unk3); 18 | } 19 | 20 | return nullptr; 21 | } 22 | 23 | bool ZGROUP::IsRoot() 24 | { 25 | assert(G1ConfigurationService::G1API_FunctionAddress_ZGROUP_IsRoot != G1ConfigurationService::kNotConfiguredOption); 26 | if (G1ConfigurationService::G1API_FunctionAddress_ZGROUP_IsRoot != G1ConfigurationService::kNotConfiguredOption) 27 | { 28 | return ((bool(__thiscall*)(ZGROUP*))(G1ConfigurationService::G1API_FunctionAddress_ZGROUP_IsRoot))(this); 29 | } 30 | 31 | return true; 32 | } 33 | } -------------------------------------------------------------------------------- /ReHitman/Glacier/include/Glacier/Geom/ZEntityLocator.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | #include 6 | 7 | namespace Glacier 8 | { 9 | class ZEntityLocator 10 | { 11 | public: 12 | // Data 13 | ZMat3x3 m_transform; 14 | ZVector3 position; 15 | ZVector3 m_vCenter; 16 | int field_3C; 17 | int field_40; 18 | Glacier::ZVector3 field_44; 19 | ZEntityLocator *parent; //+0x50 20 | int field_54; //+0x54 21 | uint16_t field_58; //+0x58 22 | uint16_t m_id; //+0x5A 23 | uint32_t m_Instance; //+0x5C 24 | uint32_t m_assignedTo; //+0x60 25 | int field_64; //+0x64 26 | int m_primitive; //+0x68 27 | const char *entityName; //+0x6C 28 | int field_70; 29 | int field_74; 30 | int field_78; 31 | int field_7C; 32 | 33 | // API 34 | void DoInit(); 35 | ZGROUP* ParentGroup(); 36 | void SetName(const char* name); 37 | bool SetPrim(int primId); 38 | void GetMatPos(Glacier::ZMat3x3* mat, Glacier::ZVector3* pos); 39 | ZEntityLocator* Next(); 40 | void SetNext(ZEntityLocator* next); 41 | ZEntityLocator* GetPrev(); 42 | void SetPrev(ZEntityLocator* prev); 43 | }; //Size: 0x0080 44 | } -------------------------------------------------------------------------------- /ReHitman/BloodMoney/source/UI/Widgets/CutSequencePlayerWidget.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include 4 | #include 5 | 6 | #include 7 | #include 8 | 9 | namespace Hitman::BloodMoney 10 | { 11 | void CutSequencePlayerWidget::draw() { 12 | DebugWidget::draw(); 13 | 14 | if (!g_bIsShowed) return; 15 | 16 | if (!CutSequencesPool::GetInstance().IsEmpty()) 17 | { 18 | ImGui::SetNextWindowSize(ImVec2(200, 300), ImGuiCond_FirstUseEver); 19 | 20 | ImGui::Begin("Cut Sequence Player", &CutSequencePlayerWidget::g_bIsShowed); 21 | 22 | int index = 1; 23 | CutSequencesPool::GetInstance().ForEach([&index](Hitman::BloodMoney::ZCutSequencePlayer* player) { 24 | if (ImGui::Button(fmt::format("Play cutscene #{}", index).data())) 25 | { 26 | player->Command(player->m_MSG_CutSequence_StartScene, nullptr); 27 | } 28 | ++index; 29 | }); 30 | 31 | if (index == 1) 32 | { 33 | ImGui::TextColored(ImVec4 { 1.f, 1.f, 0.f, 1.f }, "No cut sequences here"); 34 | } 35 | 36 | ImGui::End(); 37 | } 38 | } 39 | 40 | bool CutSequencePlayerWidget::g_bIsShowed = false; 41 | } -------------------------------------------------------------------------------- /ReHitman/Glacier/include/Glacier/EventBase/ZEventBuffer.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | #include 6 | 7 | namespace Glacier 8 | { 9 | class ZEventBuffer 10 | { 11 | public: 12 | // members 13 | char pad_0004[4]; //0x0004 14 | ZEventBase* m_events; //0x0008 15 | char pad_000C[4]; //0x000C 16 | ZOffsetAlloc* m_offsetAlloc; //0x0010 17 | char pad_0014[44]; //0x0014 18 | 19 | /// === vftable === 20 | virtual void Release(bool); 21 | virtual void PreSave(ZPackedInput*); 22 | virtual void PostSave(ZPackedInput*); 23 | virtual void PreLoad(ZPackedInput*); 24 | virtual void PostLoad(ZPackedInput*); 25 | virtual void PostProcess(int, int); 26 | virtual void LoadSave(ZPackedInput*, bool); 27 | virtual void LoadObject(IInputSerializerStream*); 28 | virtual void SaveObject(IOutputSerializerStream*); 29 | virtual void ExchangeObject(ZPackedInput*); 30 | virtual void SetToDefault(); 31 | virtual int GetTypeID(); 32 | 33 | public: 34 | // Custom API 35 | static std::intptr_t GetGQC(Glacier::ZREF ref); 36 | 37 | template 38 | static TEntity* EventRefToInstance(Glacier::ZREF ref) { 39 | return reinterpret_cast(ZEventBuffer::GetGQC(ref)); 40 | } 41 | }; 42 | 43 | } -------------------------------------------------------------------------------- /ReHitman/BloodMoney/include/BloodMoney/Game/Items/ZHM3ItemWeaponCustom.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | 6 | namespace Hitman::BloodMoney 7 | { 8 | class ZHM3ItemWeaponCustom : public ZHM3ItemWeapon 9 | { 10 | public: 11 | // vftable 12 | virtual void GetAnims(); //Load anims inside 13 | virtual void* GetMuzzleVelocity(float); 14 | 15 | // api 16 | void ApplyUpgrades(char a1); 17 | void UpdateWeaponPartDrawStatus(); 18 | void ClearUpgrades(); 19 | void SetSilencerType(ESilencerType type); 20 | 21 | // data (new size is 0x1C0) 22 | int m_field15C; 23 | int m_field160; 24 | int m_field164; 25 | int m_field168; 26 | int m_field16C; 27 | int m_field170; 28 | int m_field174; 29 | int m_field178; 30 | int m_field17C; 31 | int m_field180; 32 | int m_field184; 33 | int m_field188; 34 | int m_field18C; 35 | int m_field190; 36 | int m_field194; 37 | int m_field198; 38 | int m_field19C; 39 | int m_field1A0; 40 | int m_field1A4; 41 | int m_field1A8; 42 | ESilencerType m_eSilencerType; 43 | int m_anim_Reload_Bolt; 44 | int m_anim_Reload_DoubleClip; 45 | int m_anim_Reload_100shot; 46 | int m_field1BC; 47 | }; 48 | } -------------------------------------------------------------------------------- /ReHitman/Glacier/include/Glacier/ZInputStream.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | namespace Glacier 6 | { 7 | class ZIOInputStream; 8 | 9 | class ZInputStream 10 | { 11 | public: 12 | // data 13 | int field_4; 14 | ZIOInputStream* m_IOInputStream; 15 | int field_C; 16 | int field_10; 17 | int field_14; 18 | int field_18; 19 | int field_1C; 20 | int field_20; 21 | int field_24; 22 | int field_28; 23 | int field_2C; 24 | int field_30; 25 | int field_34; 26 | int field_38; 27 | int field_3C; 28 | int field_40; 29 | int field_44; 30 | int field_48; 31 | int field_4C; 32 | int field_50; 33 | 34 | // vftable 35 | virtual ~ZInputStream(); 36 | 37 | /** 38 | * @fn ReadRaw 39 | * @param buffer destination buffer 40 | * @param size size of destination buffer or how much bytes should be stored inside from original buffer 41 | * @return count of read bytes 42 | */ 43 | virtual unsigned int ReadRaw(char* buffer, unsigned int size); 44 | 45 | /** 46 | * @fn ReadChangeEndianness 47 | * @param buffer 48 | * @param size 49 | * @param a3 50 | */ 51 | virtual void ReadChangeEndianness(char* buffer, unsigned int size, unsigned int a3); 52 | }; 53 | } -------------------------------------------------------------------------------- /ReHitman/Glacier/include/Glacier/Items/ZItemTemplateAmmo.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | #include 6 | 7 | namespace Glacier 8 | { 9 | class ZItemTemplateAmmo : public ZItemTemplate 10 | { 11 | public: 12 | // vftable 13 | virtual int GetDefaultProjectilesPerMagazine(); 14 | virtual int GetProjectilesPerShot(); 15 | virtual float GetNearDamage(); 16 | virtual float GetFarDamage(); 17 | virtual void GetMaterialEnumId(int* pRes); 18 | virtual float GetSplashDamage(); 19 | virtual bool GetCanPenetrate(); //always false :( 20 | virtual ZGEOM* GetProjectile(); 21 | virtual ZGEOM* GetCartridge(); 22 | virtual ZGEOM* GetProjectileInstance(); 23 | virtual EDamageType GetDamageType(); 24 | 25 | // data (total size is 0xA4, ZItemTemplate size is 0x74) 26 | int m_defaultProjectilesPerMagazine; 27 | int m_projectilesPerShot; 28 | float m_nearDamage; 29 | int m_field80; 30 | bool m_bCanSplashDamage; 31 | char m_field_85; 32 | char m_field_86; 33 | char m_field_87; 34 | int m_materialEnumID; 35 | Glacier::ZREF m_projectileRef; 36 | Glacier::ZREF m_cartridgeRef; 37 | EDamageType m_damageType; 38 | int m_field98; 39 | int m_field9C; 40 | int m_fieldA0; 41 | }; 42 | } -------------------------------------------------------------------------------- /ReHitman/BloodMoney/include/BloodMoney/Game/ZCloth.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | namespace Hitman::BloodMoney 6 | { 7 | class ZCloth : public Glacier::ZSTDOBJ 8 | { 9 | public: 10 | // vftable 11 | virtual void HandleTensions(float *); 12 | virtual void ClothInitialize(bool); 13 | 14 | // Data (total size is 0xB0, ZSTDOBJ ends at 0xC) 15 | int field_10; 16 | int field_14; 17 | int field_18; 18 | int field_1C; 19 | int field_20; 20 | int field_24; 21 | int field_28; 22 | int field_2C; 23 | int field_30; 24 | int field_34; 25 | int field_38; 26 | int field_3C; 27 | int field_40; 28 | int field_44; 29 | int field_48; 30 | int field_4C; 31 | int field_50; 32 | int field_54; 33 | int field_58; 34 | int field_5C; 35 | int field_60; 36 | int field_64; 37 | int field_68; 38 | int field_6C; 39 | int field_70; 40 | int field_74; 41 | int field_78; 42 | int field_7C; 43 | int field_80; 44 | int field_84; 45 | int field_88; 46 | int field_8C; 47 | int field_90; 48 | int field_94; 49 | int field_98; 50 | int field_9C; 51 | int field_A0; 52 | int field_A4; 53 | int field_A8; 54 | int field_AC; 55 | }; 56 | } -------------------------------------------------------------------------------- /ReHitman/Modules/ImGui/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.16) 2 | project(ImGui) 3 | set(CMAKE_CXX_STANDARD 20) 4 | 5 | # ImGui library 6 | 7 | add_library(ImGui STATIC ${CMAKE_CURRENT_SOURCE_DIR}/imgui/imgui.h 8 | ${CMAKE_CURRENT_SOURCE_DIR}/imgui/imgui.cpp 9 | ${CMAKE_CURRENT_SOURCE_DIR}/imgui/imgui_draw.cpp 10 | ${CMAKE_CURRENT_SOURCE_DIR}/imgui/imstb_truetype.h 11 | ${CMAKE_CURRENT_SOURCE_DIR}/imgui/imstb_textedit.h 12 | ${CMAKE_CURRENT_SOURCE_DIR}/imgui/imgui_widgets.cpp 13 | ${CMAKE_CURRENT_SOURCE_DIR}/imgui/imstb_rectpack.h) 14 | add_library(ImGui::Core ALIAS ImGui) 15 | target_include_directories(ImGui PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/imgui) 16 | target_compile_definitions(ImGui PRIVATE -DIMGUI_IMPL_WIN32_DISABLE_LINKING_XINPUT=1 -DIMGUI_IMPL_WIN32_DISABLE_GAMEPAD=1) 17 | 18 | # Extensions (DirectX 9 support) 19 | add_library(ImGuiDx9 STATIC ${CMAKE_CURRENT_SOURCE_DIR}/imgui/examples/imgui_impl_dx9.cpp 20 | ${CMAKE_CURRENT_SOURCE_DIR}/imgui/examples/imgui_impl_win32.cpp) 21 | add_library(ImGui::DX9 ALIAS ImGuiDx9) 22 | target_include_directories(ImGuiDx9 PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/imgui/examples) 23 | target_link_libraries(ImGuiDx9 PUBLIC ImGui kernel32.lib d3d9.lib) 24 | target_compile_definitions(ImGuiDx9 PRIVATE -DIMGUI_IMPL_WIN32_DISABLE_LINKING_XINPUT=1 -DIMGUI_IMPL_WIN32_DISABLE_GAMEPAD=1) -------------------------------------------------------------------------------- /ReHitman/BloodMoney/include/BloodMoney/Game/PF/ZPathFollower.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | #include 6 | 7 | namespace Hitman::BloodMoney 8 | { 9 | class ZEventBase; 10 | 11 | enum EScriptPathType : int {}; //TODO: Reverse all possible values of enum 12 | 13 | class ZPathFollower : public Glacier::ZEventBase 14 | { 15 | public: 16 | /// === consts === 17 | static constexpr const char* Name = "PathFollower"; 18 | 19 | /// === api === 20 | int GetClosestWaypoint(); 21 | int GetRndUsePoint(); 22 | void SetExternalWaypointList(unsigned int REF); 23 | void SetWaypointIndex(int index); 24 | 25 | /// === members === 26 | // --> ZPathFollower 27 | Glacier::REFTAB m_listsOfWaypoints; //0x30 28 | int m_currentWaypointList; 29 | int m_countOfWaypoints; 30 | int m_totalWaypoints; 31 | EScriptPathType m_pathType; 32 | bool m_useWalk; 33 | bool m_useClosestOnStart; 34 | bool m_playAnimsWhileWalking; 35 | bool m_field5F; 36 | int field_60; 37 | int m_waypointIndex; 38 | bool m_isPathFollowerValid; 39 | char field_69; 40 | char field_6A; 41 | char field_6B; 42 | }; 43 | 44 | // Stack checks 45 | static_assert(offsetof(ZPathFollower, m_listsOfWaypoints) == 0x30, "ZPathFollower| Bad class entry point"); 46 | } -------------------------------------------------------------------------------- /ReHitman/BloodMoney/source/Game/ZHM3Actor.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | #include 5 | 6 | namespace Hitman::BloodMoney 7 | { 8 | void ZHM3Actor::PreparePath() 9 | { 10 | assert(BMConfigurationService::BMAPI_FunctionAddress_ZHM3Actor_PreparePath != BMConfigurationService::kNotConfiguredOption); 11 | if (BMConfigurationService::BMAPI_FunctionAddress_ZHM3Actor_PreparePath != BMConfigurationService::kNotConfiguredOption) 12 | { 13 | ((void(__thiscall*)(Hitman::BloodMoney::ZHM3Actor*))(BMConfigurationService::BMAPI_FunctionAddress_ZHM3Actor_PreparePath))(this); 14 | } 15 | } 16 | 17 | void ZHM3Actor::ActivateBloodSpurt(const Glacier::Vector3* pInvDir, 18 | const Glacier::Vector3* pCollisionPos, 19 | EBloodSpurtType type) 20 | { 21 | assert(BMConfigurationService::BMAPI_FunctionAddress_ZHM3Actor_ActivateBloodSpurt != BMConfigurationService::kNotConfiguredOption); 22 | if (BMConfigurationService::BMAPI_FunctionAddress_ZHM3Actor_ActivateBloodSpurt != BMConfigurationService::kNotConfiguredOption) { 23 | ((void(__thiscall*)(Hitman::BloodMoney::ZHM3Actor*, const Glacier::ZVector3*, const Glacier::ZVector3*, Hitman::BloodMoney::EBloodSpurtType)) 24 | (BMConfigurationService::BMAPI_FunctionAddress_ZHM3Actor_ActivateBloodSpurt))(this, pInvDir, pCollisionPos, type); 25 | } 26 | } 27 | } -------------------------------------------------------------------------------- /ReHitman/Glacier/include/Glacier/Serializer/IPackedInputVisitor.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace Glacier 4 | { 5 | class IPackedInputVisitor 6 | { 7 | public: 8 | virtual void Visit_String(unsigned int token, const char* str); 9 | virtual void Visit_Float64(unsigned int token, double); 10 | virtual void Visit_Float32(unsigned int token, float); //+0x8 11 | virtual void Visit_I32(unsigned int token, void* pData); //+0xC 12 | virtual void Visit_Unknown1(); //+0x10 13 | virtual void Visit_U16(unsigned int token, unsigned short value); //+0x14 14 | virtual void Visit_Unknown2(); //+0x18 15 | virtual void Visit_U8(unsigned int token, char** buffer); //+0x1C 16 | virtual void Visit_Bool(unsigned int token, bool value); //+0x20 17 | virtual void Visit_RawData(unsigned int token, void* buffer, unsigned int size); //+0x24 18 | virtual void Visit_Unknown3(unsigned int token, void* pData); //+0x28 19 | virtual void Visit_Reference(unsigned int token, unsigned int reference); //+0x2C 20 | virtual void Visit_Container(unsigned int token, unsigned int a2); //+0x30 21 | virtual void Visit_BeginObject(unsigned int token); //+0x34 22 | virtual void Visit_EndObject(); //+0x38 23 | virtual void Visit_Array(unsigned int token, void* data); //+0x3C 24 | virtual void Visit_EndArray(); //+0x40 25 | virtual void Visit_SkipMark(); //+0x44 26 | virtual void Visit_EndOfStream(); //+0x48 27 | }; 28 | } -------------------------------------------------------------------------------- /ReHitman/Glacier/include/Glacier/ZRenderEntryGeomD3D.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | 6 | namespace Glacier { 7 | class ZRenderEntryGeomD3D { 8 | public: 9 | // vftable 10 | virtual void Release(bool); 11 | 12 | // data (size 0x9C) 13 | int m_field4; //0x0004 14 | int m_field8; //0x0008 15 | int m_fieldC; //0x000C 16 | int m_field10; //0x0010 17 | int m_field14; //0x0014 18 | int m_field18; //0x0018 19 | int m_field1C; //0x001C 20 | int m_field20; //0x0020 21 | int m_field24; //0x0024 22 | int m_field28; //0x0028 (possible flag) 23 | unsigned int m_field2C; //0x002C (possible mask) 24 | int m_unkFlag30; //0x0030 (possible mask) 25 | int m_field34; //0x0034 26 | int m_field38; //0x0038 27 | int m_field3C; //0x003C 28 | int m_field40; //0x0040 29 | int m_field44; //0x0044 30 | Glacier::ZMat3x3 m_transform; //0x0048 31 | Glacier::ZVector3 m_position; //0x006C 32 | Glacier::ZEntityLocator* m_pEntityLocator0; //0x0078 33 | int m_field7C; //0x007C 34 | int m_field80; //0x0080 35 | int m_field84; //0x0084 36 | int m_field88; //0x0088 37 | Glacier::ZEntityLocator* m_pEntityLocator; //0x008C 38 | int m_ref; //0x0090 39 | int m_field94; //0x0094 40 | Glacier::ZEntityLocator* m_pPlayerEntity; //0x0098 (I'm not sure that this is player entity because sometimes this field is null) 41 | }; 42 | } -------------------------------------------------------------------------------- /ReHitman/BloodMoney/include/BloodMoney/Game/Items/ZHM3ItemBomb.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | 6 | namespace Hitman::BloodMoney 7 | { 8 | class ZHM3ItemBomb : public ZHM3ItemWeapon 9 | { 10 | public: 11 | // api 12 | void Explode(); 13 | 14 | // data (total size is 0x2A0, base size is 0x15C) 15 | bool m_field15C; 16 | bool field_15D; 17 | bool field_15E; 18 | bool field_15F; 19 | int m_field160; 20 | int m_field164; 21 | int m_field168; 22 | int m_field16C; 23 | int m_field170; 24 | int m_field174; 25 | int m_field178; 26 | int m_field17C; 27 | int m_field180; 28 | int m_field184; 29 | int m_field188; 30 | int m_field18C; 31 | int m_field190; 32 | int m_field194; 33 | int m_field198; 34 | int m_field19C; 35 | int m_field1A0; 36 | int m_field1A4; 37 | int m_field1A8; 38 | int m_field1AC; 39 | int m_field1B0; 40 | int m_field1B4; 41 | int m_field1B8; 42 | int m_field1BC; 43 | int m_field1C0; 44 | int m_field1C4; 45 | int m_field1C8; 46 | int m_field1CC; 47 | int m_field1D0; 48 | int m_field1D4; 49 | int m_field1D8; 50 | int m_field1DC; 51 | int m_field1E0; 52 | int m_field1E4; 53 | Glacier::REFTAB32 m_reftab32; 54 | int m_field294; 55 | int m_field298; 56 | int m_field29C; 57 | }; 58 | } -------------------------------------------------------------------------------- /ReHitman/Glacier/include/Glacier/IK/ZIKHAND.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | namespace Glacier 6 | { 7 | class ZItem; 8 | class ZItemTemplate; 9 | class ZIKLNKOBJ; 10 | 11 | enum class HandType { 12 | LeftHand = 32, 13 | RightHand = 31, 14 | RatUnk0 = 20, 15 | RatUnk1 = 25 16 | }; 17 | 18 | class ZIKHAND 19 | { 20 | public: 21 | virtual void LoadSave(ZPackedInput*, bool); 22 | virtual void AttachItem(ZIKLNKOBJ* owner, Glacier::ZREF itemID); 23 | virtual void SlipItem(ZIKLNKOBJ* owner); 24 | virtual ZItem* GetItem(); 25 | virtual ZItemTemplate* GetItemType(); 26 | virtual void Reset(); 27 | virtual void SetTarget(ZIKLNKOBJ* owner, const Matrix4x4* transform, const Vector3* point, float veliocity, void* callback); 28 | 29 | // data 30 | int field_4; 31 | char m_bEnabled; 32 | char field_9; 33 | char field_A; 34 | char field_B; 35 | Glacier::ZMat3x3 m_mTarget; 36 | Glacier::ZVector3 m_vTarget; 37 | float m_fTime; 38 | float m_fStartTime; 39 | Glacier::ZREF m_rGeom; 40 | int m_lBoneId; 41 | int field_4C; 42 | int field_50; 43 | int field_54; 44 | int field_58; 45 | int field_5C; 46 | int m_itemId; 47 | bool m_hasItem; 48 | char field_65; 49 | char field_66; 50 | char field_67; 51 | HandType m_handType; 52 | Glacier::ZVector3 m_vItemOffset; 53 | int MSG_INVERTORYSETACTIVELEFT; 54 | int field_7C; 55 | }; 56 | } -------------------------------------------------------------------------------- /ReHitman/Glacier/source/ZScheduledUpdate.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include 6 | 7 | namespace Glacier { 8 | ZScheduledEvent* ZScheduledUpdate::AddEvent(ZEventBase *pHolder) { 9 | assert(G1ConfigurationService::G1API_FunctionAddress_ZScheduledUpdate_AddEvent != G1ConfigurationService::kNotConfiguredOption); 10 | assert(pHolder != nullptr); 11 | 12 | if (!pHolder) return nullptr; 13 | if (pHolder->m_pScheduledScript) return nullptr; 14 | 15 | if (G1ConfigurationService::G1API_FunctionAddress_ZScheduledUpdate_AddEvent != G1ConfigurationService::kNotConfiguredOption) { 16 | return ((ZScheduledEvent*(__thiscall*)(ZScheduledUpdate*, ZEventBase*))G1ConfigurationService::G1API_FunctionAddress_ZScheduledUpdate_AddEvent)(this, pHolder); 17 | } 18 | 19 | return nullptr; 20 | } 21 | 22 | void ZScheduledUpdate::RemoveEvent(ZEventBase* pHolder) { 23 | assert(G1ConfigurationService::G1API_FunctionAddress_ZScheduledUpdate_AddEvent != G1ConfigurationService::kNotConfiguredOption); 24 | assert(pHolder != nullptr); 25 | 26 | if (!pHolder) return; 27 | if (!pHolder->m_pScheduledScript) return; 28 | 29 | if (G1ConfigurationService::G1API_FunctionAddress_ZScheduledUpdate_AddEvent != G1ConfigurationService::kNotConfiguredOption) { 30 | ((void(__thiscall*)(ZScheduledUpdate*, ZEventBase*))G1ConfigurationService::G1API_FunctionAddress_ZScheduledUpdate_RemoveEvent)(this, pHolder); 31 | } 32 | } 33 | } -------------------------------------------------------------------------------- /appveyor.yml: -------------------------------------------------------------------------------- 1 | #---------------------------------# 2 | # build configuration # 3 | #---------------------------------# 4 | 5 | # build platform, i.e. x86, x64, Any CPU. This setting is optional. 6 | platform: x86 7 | 8 | branches: 9 | only: 10 | - main 11 | 12 | clone_folder: c:\projects\ReHitman 13 | 14 | configuration: Release 15 | 16 | image: 17 | - Visual Studio 2019 18 | 19 | install: 20 | - git submodule update --init --recursive 21 | 22 | before_build: 23 | - cmd: | 24 | mkdir build 25 | cd build 26 | cmake --version 27 | cmake -A Win32 -G "Visual Studio 16 2019" .. 28 | 29 | build: 30 | parallel: true 31 | verbosity: normal 32 | 33 | build_script: | 34 | cmake --build . --config Release 35 | 36 | after_build: 37 | - cmd: cd c:\projects\ReHitman\build 38 | - cmd: 7z a ReHitman.zip ReHitman\Release\ReHitman.dll ReHitman\NVCPL\Release\NVCPL.dll 39 | - cmd: mv ReHitman.zip ../ReHitman.zip 40 | 41 | #---------------------------------# 42 | # artifacts configuration # 43 | #---------------------------------# 44 | 45 | artifacts: 46 | - path: ReHitman.zip 47 | name: ReHitman 48 | 49 | #---------------------------------# 50 | # Discord WebHook # 51 | #---------------------------------# 52 | 53 | on_success: 54 | - ps: Invoke-RestMethod https://raw.githubusercontent.com/DiscordHooks/appveyor-discord-webhook/master/send.ps1 -o send.ps1 55 | - ps: ./send.ps1 success $env:WEBHOOK_URL 56 | on_failure: 57 | - ps: Invoke-RestMethod https://raw.githubusercontent.com/DiscordHooks/appveyor-discord-webhook/master/send.ps1 -o send.ps1 58 | - ps: ./send.ps1 failure $env:WEBHOOK_URL -------------------------------------------------------------------------------- /ReHitman/BloodMoney/source/Game/PF/ZPathFollower.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | #include 5 | 6 | namespace Hitman::BloodMoney 7 | { 8 | int ZPathFollower::GetClosestWaypoint() { 9 | assert(BMConfigurationService::BMAPI_FunctionAddress_ZPathFollower_GetClosestWaypoint != BMConfigurationService::kNotConfiguredOption); 10 | return ((int(__thiscall*)(ZPathFollower*))(BMConfigurationService::BMAPI_FunctionAddress_ZPathFollower_GetClosestWaypoint))(this); 11 | } 12 | 13 | int ZPathFollower::GetRndUsePoint() { 14 | assert(BMConfigurationService::BMAPI_FunctionAddress_ZPathFollower_GetRndUsePoint != BMConfigurationService::kNotConfiguredOption); 15 | return ((int(__thiscall*)(ZPathFollower*))(BMConfigurationService::BMAPI_FunctionAddress_ZPathFollower_GetRndUsePoint))(this); 16 | } 17 | 18 | void ZPathFollower::SetExternalWaypointList(unsigned int REF) { 19 | assert(BMConfigurationService::BMAPI_FunctionAddress_ZPathFollower_SetExternalWaypointList != BMConfigurationService::kNotConfiguredOption); 20 | ((void(__thiscall*)(ZPathFollower*, unsigned int))(BMConfigurationService::BMAPI_FunctionAddress_ZPathFollower_SetExternalWaypointList))(this, REF); 21 | } 22 | 23 | void ZPathFollower::SetWaypointIndex(int index) { 24 | assert(BMConfigurationService::BMAPI_FunctionAddress_ZPathFollower_SetWaypointIndex != BMConfigurationService::kNotConfiguredOption); 25 | ((void(__thiscall*)(ZPathFollower*, int))(BMConfigurationService::BMAPI_FunctionAddress_ZPathFollower_SetWaypointIndex))(this, index); 26 | } 27 | } -------------------------------------------------------------------------------- /ReHitman/BloodMoney/include/BloodMoney/Engine/ZHM3OverlayCameraClass.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | namespace Hitman::BloodMoney 6 | { 7 | class ZSaveGame; 8 | class ZLoadGame; 9 | 10 | class ZHM3OverlayCameraClass : public Glacier::ZCAMERA 11 | { 12 | public: 13 | //vftable 14 | virtual void Save(ZSaveGame*); //nullstub 15 | virtual void Load(ZLoadGame*); //nullstub 16 | 17 | //data (total size is 0x228, ZCAMERA size is 0x18C) 18 | Glacier::ZMSGID m_MSG_GetMatPosFrameNr; 19 | Glacier::ZMSGID m_MSG_Activate; 20 | int m_field190; 21 | int m_field194; 22 | int m_field198; 23 | int m_field19C; 24 | int m_field1A0; 25 | int m_field1A4; 26 | int m_field1A8; 27 | int m_field1AC; 28 | int m_field1B0; 29 | int m_field1B4; 30 | int m_field1B8; 31 | int m_field1BC; 32 | int m_field1C0; 33 | int m_field1C4; 34 | int m_field1C8; 35 | int m_field1CC; 36 | int m_field1D0; 37 | int m_field1D4; 38 | int m_field1D8; 39 | int m_field1DC; 40 | int m_field1E0; 41 | int m_field1E4; 42 | int m_field1E8; 43 | int m_field1EC; 44 | int m_field1F0; 45 | int m_field1F4; 46 | int m_field1F8; 47 | int m_field1FC; 48 | int m_field200; 49 | int m_field204; 50 | int m_field208; 51 | int m_field20C; 52 | int m_field210; 53 | int m_field214; 54 | int m_field218; 55 | int m_field21C; 56 | int m_field220; 57 | int m_field224; 58 | }; 59 | } -------------------------------------------------------------------------------- /ReHitman/BloodMoney/include/BloodMoney/Engine/ZLoaderSequenceD3D.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | namespace Hitman::BloodMoney 6 | { 7 | // Created with ReClass.NET 1.2 by KN4CK3R 8 | class ZEntryGeom 9 | { 10 | public: 11 | int m_field0; 12 | int m_field4; 13 | int m_field8; 14 | int m_fieldC; 15 | int m_field10; 16 | int m_field14; 17 | int m_field18; 18 | int m_field1C; 19 | int m_field20; 20 | int m_field24; 21 | int m_field28; 22 | int m_field2C; 23 | int m_field30; 24 | int m_field34; 25 | int m_field38; 26 | int m_field3C; 27 | int m_field40; 28 | int m_field44; 29 | int m_field48; 30 | IDirect3DVertexBuffer9* m_pGeomVertexBuffer; //0x004C 31 | 32 | void foo() { 33 | m_pGeomVertexBuffer->Release(); 34 | } 35 | }; //Size: 0x0050 36 | 37 | class ZEntryGeomInfo 38 | { 39 | public: 40 | D3DFVF_DIFFUSE 41 | D3DUSAGE_AUTOGENMIPMAP 42 | ZEntryGeom* m_pGeom; //0x0000 43 | int32_t m_iVariants; //0x0004 44 | }; //Size: 0x0008 45 | 46 | class ZLoader_Sequence_Wintel_D3D 47 | { 48 | public: 49 | int m_field4; 50 | int m_field8; 51 | int m_fieldC; 52 | int m_field10; 53 | int m_field14; 54 | int m_field18; 55 | int m_field1C; 56 | ZEntryGeomInfo** m_ppEntries; //0x0020 57 | int32_t m_iEntriesCount; //0x0024 58 | char pad_0028[280]; //0x0028 (Holder) 59 | 60 | virtual void Function0(); // Just a holder 61 | }; //Size: 0x0140 62 | 63 | 64 | 65 | 66 | } -------------------------------------------------------------------------------- /ReHitman/Glacier/include/Glacier/ZActionManager.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace Glacier 4 | { 5 | class ZActionMapTree 6 | { 7 | public: 8 | // vftable 9 | virtual void Release(); 10 | 11 | // data 12 | class ZActionMapTree* m_parent; //+0x4 13 | class ZActionMapTree* m_left; //+0x8 14 | class ZActionMapTree* m_right; //+0xC 15 | int field_10; //+0x10 16 | int field_14; //+0x14 17 | int field_18; //+0x18 18 | char m_name[0x24]; //+0x1C 19 | }; 20 | 21 | class ZActionManager 22 | { 23 | public: 24 | // vftable 25 | virtual void Release(bool); 26 | virtual void SetJoinControllers(bool, int); 27 | virtual void* GetJoinControllers(); 28 | virtual void AddBindings(const char* bindingsStr); 29 | virtual void LoadBindings(const char* bindingsStr); 30 | virtual const char* GetKeyName(const char* key); 31 | virtual const char* GetSystemKey(const char* key, bool a2); 32 | virtual int* GetDisableInputTimers(int*); 33 | virtual void DisableInputTimer(float); 34 | virtual void RevertToDefault(); 35 | virtual void SetDebugKeys(bool); 36 | virtual bool GetDebugKeys(); 37 | virtual void Enable(); 38 | virtual void Disable(); 39 | virtual bool IsEnabled(); 40 | 41 | // data 42 | ZActionMapTree m_root; 43 | ZActionMapTree* m_lastNode; 44 | int field_48; 45 | bool m_debugKeys; 46 | bool m_isEnabled; 47 | char field_4E; 48 | char field_4F; 49 | int field_50; 50 | }; 51 | } -------------------------------------------------------------------------------- /ReHitman/BloodMoney/include/BloodMoney/Game/ZGuardQuarterController.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | namespace Hitman::BloodMoney { 6 | class ZGuardQuarterController : public Glacier::ZEventBase { 7 | public: 8 | // vftable (no changes) 9 | // api 10 | void RegisterActor(Glacier::ZREF rActorREF); 11 | 12 | // data (total size is 0xE8, base size is 0x30) 13 | int m_field30; 14 | int m_field34; 15 | int m_field38; 16 | int m_field3C; 17 | int m_field40; 18 | int m_field44; 19 | int m_field48; 20 | int m_field4C; 21 | int m_field50; 22 | int m_field54; 23 | int m_field58; 24 | int m_field5C; 25 | int m_field60; 26 | int m_field64; 27 | int m_field68; 28 | int m_field6C; 29 | int m_field70; 30 | int m_field74; 31 | int m_field78; 32 | int m_field7C; 33 | int m_field80; 34 | int m_field84; 35 | int m_field88; 36 | int m_field8C; 37 | int m_field90; 38 | int m_field94; 39 | int m_field98; 40 | int m_field9C; 41 | int m_fieldA0; 42 | int m_fieldA4; 43 | int m_fieldA8; 44 | int m_fieldAC; 45 | int m_fieldB0; 46 | int m_fieldB4; 47 | int m_fieldB8; 48 | int m_fieldBC; 49 | int m_fieldC0; 50 | int m_fieldC4; 51 | int m_fieldC8; 52 | int m_fieldCC; 53 | int m_fieldE0; 54 | int m_fieldE4; 55 | 56 | // public instance controlled by internal patch 57 | static ZGuardQuarterController* g_pCurrentLevelGuardControl; 58 | }; 59 | } -------------------------------------------------------------------------------- /ReHitman/Glacier/include/Glacier/ZProjectileBallistic.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | 6 | namespace Glacier { 7 | class ZProjectileBallistic : public ZEventBase { 8 | // vtable 9 | virtual void SetTarget(ZVector3* pTarget); 10 | virtual void SetProjectileInfo(CProjectileActivate* pActivationInfo); 11 | virtual void ShotImpact(COLI* pColi); 12 | 13 | // size (total size is 0xE0, base size is 0x30) 14 | int m_field30; 15 | int m_field34; 16 | int m_field38; 17 | int m_field3C; 18 | int m_field40; 19 | int m_field44; 20 | int m_field48; 21 | int m_field4C; 22 | int m_field50; 23 | int m_field54; 24 | int m_field58; 25 | int m_field5C; 26 | int m_field60; 27 | int m_field64; 28 | int m_field68; 29 | int m_field6C; 30 | int m_field70; 31 | int m_field74; 32 | int m_field78; 33 | int m_field7C; 34 | int m_field80; 35 | int m_field84; 36 | int m_field88; 37 | int m_field8C; 38 | int m_field90; 39 | int m_field94; 40 | int m_field98; 41 | int m_field9C; 42 | int m_fieldA0; 43 | int m_fieldA4; 44 | int m_fieldA8; 45 | int m_fieldAC; 46 | int m_fieldB0; 47 | int m_fieldB4; 48 | int m_fieldB8; 49 | int m_fieldBC; 50 | int m_fieldC0; 51 | int m_fieldC4; 52 | int m_fieldC8; 53 | int m_fieldCC; 54 | int m_fieldD0; 55 | int m_fieldD4; 56 | int m_fieldD8; 57 | int m_fieldDC; 58 | }; 59 | } -------------------------------------------------------------------------------- /ReHitman/Glacier/source/ZSTL/ZHashBase.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | namespace Glacier 6 | { 7 | void ZHash::Put(SMatPos value, bool a2) 8 | { 9 | assert(G1ConfigurationService::G1API_FunctionAddress_ZHash_int_SMatPos_Put != G1ConfigurationService::kNotConfiguredOption); 10 | if (G1ConfigurationService::G1API_FunctionAddress_ZHash_int_SMatPos_Put != G1ConfigurationService::kNotConfiguredOption) 11 | { 12 | ((void(__thiscall*)(ZHashBase*, SMatPos, bool))(G1ConfigurationService::G1API_FunctionAddress_ZHash_int_SMatPos_Put))(this, value, a2); 13 | } 14 | } 15 | 16 | void ZHash::Clear() { 17 | assert(G1ConfigurationService::G1API_FunctionAddress_ZHash_int_SMatPos_Clear != G1ConfigurationService::kNotConfiguredOption); 18 | if (G1ConfigurationService::G1API_FunctionAddress_ZHash_int_SMatPos_Clear != G1ConfigurationService::kNotConfiguredOption) 19 | { 20 | ((void(__thiscall*)(ZHashBase*))(G1ConfigurationService::G1API_FunctionAddress_ZHash_int_SMatPos_Clear))(this); 21 | } 22 | } 23 | 24 | SMatPos* ZHash::Find(const int& val) const { 25 | assert(G1ConfigurationService::G1API_FunctionAddress_ZHash_int_SMatPos_Find != G1ConfigurationService::kNotConfiguredOption); 26 | if (G1ConfigurationService::G1API_FunctionAddress_ZHash_int_SMatPos_Find != G1ConfigurationService::kNotConfiguredOption) 27 | { 28 | return ((SMatPos*(__thiscall*)(const ZHashBase*, const int&))(G1ConfigurationService::G1API_FunctionAddress_ZHash_int_SMatPos_Find))(this, val); 29 | } 30 | return nullptr; 31 | } 32 | } -------------------------------------------------------------------------------- /ReHitman/BloodMoney/include/BloodMoney/Game/ZCheatMenu.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | #include 6 | 7 | namespace Hitman::BloodMoney 8 | { 9 | class ZCheatMenu : public Glacier::ZEventBase 10 | { 11 | public: 12 | //custom entries 13 | enum ECheatMenuEntryType : int 14 | { 15 | MENU_GENERIC_INTVAL_TOGGLE = 0x0, // Int value, 0 or 1 (toggle mode) 16 | MENU_GENERIC_FLOAT_TOGGLE = 0x1, // Float value 0.0f or 1.0f (toggle mode) 17 | MENU_GENERIC_FLOAT_EDITABLE = 0x2, // Float value, inc 0.1f 18 | MENU_GENERIC_FLOAT_READ_ONLY = 0x3, // Float value, read only 19 | MENU_TOGGLE_CALLABLE_OPTION = 0x4, // pDataPtr should be a pointer to the function 20 | MENU_TOGGLE_OPTION_2 = 0x5, // I'm not sure that this option works 21 | MENU_ENGINE_DATABASE_FLOAT_B28 = 0x8, // Always ptr to ZEngineDatabase::m_fTimeMultiplier value! 22 | MENU_TOGGLE_BOOL = 0x7, // Bool value 23 | }; 24 | 25 | union UEntryOption { 26 | void(__cdecl *pFunction)(void); 27 | int* pInt; 28 | float* pFloat; 29 | bool* pBool; 30 | }; 31 | 32 | struct SEntry 33 | { 34 | ECheatMenuEntryType eType; 35 | const char* pName; 36 | UEntryOption uOption; 37 | }; 38 | 39 | //vftable (no changes) 40 | 41 | //data (total size is 0x78, base size is 0x30) 42 | int m_field30; 43 | int m_field34; 44 | int m_field38; 45 | int m_field3C; 46 | char field_40; 47 | char field_41; 48 | char field_42; 49 | char field_43; 50 | ZCHAROBJ* m_pTextObj; 51 | void *field_48; 52 | void *field_4C; 53 | void *field_50; 54 | __int16 m_MSG_ShowCheatsMenu; 55 | __int16 field_56; 56 | void *field_58; 57 | Glacier::REFTAB m_options; 58 | }; 59 | } -------------------------------------------------------------------------------- /ReHitman/Glacier/include/Glacier/ZTextureType.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace Glacier 4 | { 5 | enum ZTextureType : unsigned int { 6 | BITMAP_PAL = 0x50414C4E, 7 | BITMAP_PAL_OPAC = 0x50414C4F, 8 | BITMAP_32 = 0x52474241, 9 | BITMAP_U8V8 = 0x55385638, 10 | BITMAP_DXT1 = 0x44585431 11 | 12 | //Declared but values not recognized yet 13 | //BITMAP_DXT3, 14 | //BITMAP_I8, 15 | 16 | }; 17 | 18 | 19 | /** 20 | * @note Conditions for DX3 and I8 formats in loader code 21 | 22 | v16 = type - 0x44585431; 23 | if ( !v16 ) 24 | { 25 | v21 = ZSysMem::allocate(0x30, "engine\\drawing\\_wintel\\renderd3d\\renderwinteld3dtex.cpp", 778); 26 | LOBYTE(v54) = 12; 27 | if ( !v21 ) 28 | goto LABEL_46; 29 | v19 = ZBitmapDXT1::Ctor((int)v21); 30 | goto LABEL_47; 31 | } 32 | v17 = v16 - 2; 33 | if ( !v17 ) 34 | { 35 | v20 = ZSysMem::allocate(0x30, "engine\\drawing\\_wintel\\renderd3d\\renderwinteld3dtex.cpp", 781); 36 | LOBYTE(v54) = 13; 37 | if ( !v20 ) 38 | goto LABEL_46; 39 | v19 = ZBitmapDXT3::Ctor((int)v20); 40 | goto LABEL_47; 41 | } 42 | if ( v17 == 0x4DFCBED ) 43 | { 44 | v18 = ZSysMem::allocate(0x30, "engine\\drawing\\_wintel\\renderd3d\\renderwinteld3dtex.cpp", 769); 45 | LOBYTE(v54) = 9; 46 | if ( !v18 ) 47 | goto LABEL_46; 48 | v19 = ZBitmapI8::Ctor((int)v18); 49 | LABEL_47: 50 | LOBYTE(v54) = 6; 51 | v45[v12] = v19; 52 | goto LABEL_48; 53 | } 54 | */ 55 | } -------------------------------------------------------------------------------- /ReHitman/Glacier/include/Glacier/ZGameData.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | namespace Glacier 6 | { 7 | class ZGameData 8 | { 9 | public: 10 | virtual void Release(bool); 11 | virtual void LoadSave(ISerializerStream &,bool); 12 | virtual void Init(); 13 | virtual void Init2(); 14 | virtual void RemapRefs(uint*, uint); 15 | virtual void OnLevelChangeBegin(); 16 | virtual void OnLevelChangeLoadDone(); 17 | virtual void OnLevelChangeFinish(); 18 | virtual void PreFrameUpdate(); 19 | virtual void PostFrameUpdate(); 20 | virtual void AddGeomToCheckPoint(ZGEOM*); 21 | virtual void AddEventToCheckPoint(ZEventBase*); 22 | virtual void AddItemOnGround(ZItem*); 23 | virtual void RemoveItemOnGround(ZItem*); 24 | virtual void CheckPointSave(ZCheckPointBuffer &); 25 | virtual void CheckPointLoad(ZCheckPointBuffer &); 26 | virtual void __PURE_UNKNOWN_FUNC__(); 27 | virtual bool IsFrontEnd(); 28 | virtual ZGameStats* GetStats(); 29 | virtual void InitExcludedAnimNames(uint *); 30 | virtual void* GetAnimExclude(); 31 | virtual void InitWeaponHandles(uint *); 32 | virtual int32_t GetTotalWeaponPrimsCount(); 33 | virtual int32_t GetTotalWeaponPrims(); 34 | virtual int32_t GetUsedWeaponPrims(); 35 | virtual int32_t GetBigWeaponPrimsCount(); 36 | virtual void* GetBigWeaponPrims(); 37 | virtual void OnDecalRemoval(uint); 38 | virtual void GetSuitcaseWeaponPrims(int&, uint*); 39 | virtual bool IsInCutsequence(); 40 | virtual void LoadGameFailureScene(); 41 | virtual void AddIconToText(const zstring& str, const char*, bool); 42 | }; 43 | } -------------------------------------------------------------------------------- /ReHitman/BloodMoney/include/BloodMoney/Game/OnLevel/CKeycardReader.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | #include 6 | 7 | #include 8 | 9 | namespace Hitman::BloodMoney 10 | { 11 | /** 12 | * @msg MSG_DETERMINELNKOBJLOC 13 | */ 14 | struct sQueryLnkObjLocation { 15 | Glacier::ZREF m_geomToDetermineREF; //in 16 | bool m_bLocatedNearToKeycardReader; //out 17 | }; 18 | 19 | class CKeycardReader : public Glacier::ZEventBase 20 | { 21 | public: 22 | //vftable (no changes) 23 | // custom API 24 | Glacier::ZEntityLocator* GetNearestDoor(unsigned int iDoorsCount, Glacier::ZEntityLocator** ppDoorsList); 25 | void ValidateKeyCard(Glacier::ZREF cardREF); 26 | void InvalidateKeyCard(Glacier::ZREF cardREF); 27 | void DetermineLnkObjLocation(sQueryLnkObjLocation* pQuery); 28 | Glacier::ZREF GetKeyCard(Glacier::ZREF playerREF, bool* hasCard); 29 | Glacier::ZREF GetItemTemplateFromName(const char* itemName); 30 | bool IsKeyCardValid(BloodMoney::ZHM3Item* pItem); 31 | 32 | // data (total size is 0x8C, base size is 0x30) 33 | Glacier::ZREF m_useKeycardActionREF; // REF to Event (use ZEventBuffer to locate instance) 34 | int m_nearestDoor; 35 | int m_field38; 36 | int m_field3C; 37 | unsigned short m_field40; 38 | unsigned short m_field42; 39 | int m_field44; 40 | int m_field48; 41 | Glacier::REFTAB m_reftab4C; 42 | Glacier::REFTAB m_reftab68; 43 | char m_field84; 44 | char m_field85; 45 | char m_field86; 46 | char m_field87; 47 | int m_bIsElevatorButton; 48 | }; 49 | } --------------------------------------------------------------------------------