From ada9f0c268a081f5e3511623beb6f4705c37d5c5 Mon Sep 17 00:00:00 2001 From: DronCode Date: Thu, 6 Feb 2020 21:01:22 +0300 Subject: [PATCH] Added more things in debug menu & reversed few components Reversed ZHM3GameData (more members known for now) Added more information in debug menu refs #9 and #7 --- HM3CoreKill/HM3CoreKill/HM3CoreKill.vcxproj | 1 + .../HM3CoreKill/HM3CoreKill.vcxproj.filters | 3 + HM3CoreKill/HM3CoreKill/ck/HM3Game.cpp | 4 ++ HM3CoreKill/HM3CoreKill/ck/HM3InGameTools.cpp | 47 +++++++++++++++- HM3CoreKill/HM3CoreKill/ck/HM3InGameTools.h | 3 + .../HM3CoreKill/sdk/ZHM3BriefingControl.h | 7 +++ HM3CoreKill/HM3CoreKill/sdk/ZHM3GameData.h | 21 +++++-- .../HM3CoreKill/sdk/ZHM3LevelControl.h | 3 +- HM3CoreKill/HM3CoreKill/sdk/input/ZKeyboard.h | 17 ------ .../HM3CoreKill/sdk/input/ZKeyboardStorage.h | 28 --------- HM3CoreKill/HM3CoreKill/sdk/input/ZSysInput.h | 53 ------------------ ReClassNotes/ZHM3GameData.rcnet | Bin 0 -> 20184 bytes 12 files changed, 79 insertions(+), 108 deletions(-) create mode 100644 HM3CoreKill/HM3CoreKill/sdk/ZHM3BriefingControl.h delete mode 100644 HM3CoreKill/HM3CoreKill/sdk/input/ZKeyboard.h delete mode 100644 HM3CoreKill/HM3CoreKill/sdk/input/ZKeyboardStorage.h delete mode 100644 HM3CoreKill/HM3CoreKill/sdk/input/ZSysInput.h create mode 100644 ReClassNotes/ZHM3GameData.rcnet diff --git a/HM3CoreKill/HM3CoreKill/HM3CoreKill.vcxproj b/HM3CoreKill/HM3CoreKill/HM3CoreKill.vcxproj index a2fcaaa..2f9a14d 100644 --- a/HM3CoreKill/HM3CoreKill/HM3CoreKill.vcxproj +++ b/HM3CoreKill/HM3CoreKill/HM3CoreKill.vcxproj @@ -163,6 +163,7 @@ + diff --git a/HM3CoreKill/HM3CoreKill/HM3CoreKill.vcxproj.filters b/HM3CoreKill/HM3CoreKill/HM3CoreKill.vcxproj.filters index b1c324a..ac45081 100644 --- a/HM3CoreKill/HM3CoreKill/HM3CoreKill.vcxproj.filters +++ b/HM3CoreKill/HM3CoreKill/HM3CoreKill.vcxproj.filters @@ -219,6 +219,9 @@ sdk + + sdk + diff --git a/HM3CoreKill/HM3CoreKill/ck/HM3Game.cpp b/HM3CoreKill/HM3CoreKill/ck/HM3Game.cpp index 2a969cf..c2a3ef5 100644 --- a/HM3CoreKill/HM3CoreKill/ck/HM3Game.cpp +++ b/HM3CoreKill/HM3CoreKill/ck/HM3Game.cpp @@ -205,6 +205,10 @@ void HM3Game::onD3DEndScene(IDirect3DDevice9* device) void HM3Game::OnNewGameSession(ioi::hm3::ZHM3Hitman3_t gameSession) { HM3_DEBUG("[HM3Game::OnNewGameSession] New session instance detected at 0x%.8X\n", gameSession); + { + auto gd = GetGameDataInstancePtr(); + //HM3_DEBUG(" [BriefControl at 0x%.8X Camera at 0x%.8X ]\n", gd->m_BriefingControl, gd->m_Camera); + } printActorsPoolInfos(); } diff --git a/HM3CoreKill/HM3CoreKill/ck/HM3InGameTools.cpp b/HM3CoreKill/HM3CoreKill/ck/HM3InGameTools.cpp index f1b3598..4219855 100644 --- a/HM3CoreKill/HM3CoreKill/ck/HM3InGameTools.cpp +++ b/HM3CoreKill/HM3CoreKill/ck/HM3InGameTools.cpp @@ -12,6 +12,7 @@ #include #include #include +#include #include // Win32 message handler @@ -105,6 +106,17 @@ namespace ck } void HM3InGameTools::drawDebugMenu() + { + ImGui::Begin("ReHitman | Debugger"); + + drawPlayerInfo(); + drawSystemsInfo(); + drawLevelInfo(); + + ImGui::End(); + } + + void HM3InGameTools::drawPlayerInfo() { auto gameData = ioi::hm3::getGlacierInterface(ioi::hm3::GameData); auto sysInterface = ioi::hm3::getGlacierInterface(ioi::hm3::SysInterface); @@ -112,8 +124,7 @@ namespace ck auto engineDB = sysInterface->m_engineDataBase; auto osd = gameData->m_OSD; - ImGui::Begin("ReHitman | Debugger"); - + if (ImGui::CollapsingHeader("Player info", ImGuiTreeNodeFlags_None)) { { // Common game & profile data ImGui::Text("Profile: "); ImGui::SameLine(0.f, 10.f); ImGui::TextColored(ImVec4(0.f, 1.f, 0.f, 1.f), gameData->m_ProfileName); @@ -129,6 +140,8 @@ namespace ck ImGui::Text("Noise level: "); ImGui::SameLine(0.f, 15.f); ImVec4 noiseLevelColor = ImVec4(0.f, 1.f, 0.f, 1.f); + ImGui::ProgressBar(osd->m_realNosieLevel / 100.f, ImVec2(0.0f, 0.0f)); ImGui::SameLine(0.f, 8.5f); + if (osd->m_realNosieLevel >= 0.f && osd->m_realNosieLevel <= 40.f) noiseLevelColor = ImVec4(0.f, 1.f, 0.f, 1.f); else if (osd->m_realNosieLevel > 40.f && osd->m_realNosieLevel <= 70.f) @@ -138,7 +151,15 @@ namespace ck ImGui::TextColored(noiseLevelColor, "%.3f", osd->m_realNosieLevel); } } + } + void HM3InGameTools::drawSystemsInfo() + { + auto gameData = ioi::hm3::getGlacierInterface(ioi::hm3::GameData); + auto sysInterface = ioi::hm3::getGlacierInterface(ioi::hm3::SysInterface); + auto inputInterface = ioi::hm3::getGlacierInterface(ioi::hm3::WintelInput); + auto engineDB = sysInterface->m_engineDataBase; + auto osd = gameData->m_OSD; if (ImGui::CollapsingHeader("Glacier | Systems")) { @@ -146,7 +167,27 @@ namespace ck ImGui::Text("ZSysInputWintel: "); ImGui::SameLine(0.f, 10.f); ImGui::TextColored(ImVec4(1.f, 1.f, 0.f, 1.f), "0x%.8X", inputInterface); ImGui::Text("ZEngineDatabase: "); ImGui::SameLine(0.f, 10.f); ImGui::TextColored(ImVec4(1.f, 1.f, 0.f, 1.f), "0x%.8X", engineDB); } + } - ImGui::End(); + void HM3InGameTools::drawLevelInfo() + { + auto gameData = ioi::hm3::getGlacierInterface(ioi::hm3::GameData); + auto sysInterface = ioi::hm3::getGlacierInterface(ioi::hm3::SysInterface); + auto inputInterface = ioi::hm3::getGlacierInterface(ioi::hm3::WintelInput); + auto engineDB = sysInterface->m_engineDataBase; + auto osd = gameData->m_OSD; + auto levelControl = gameData->m_LevelControl; + + if (ImGui::CollapsingHeader("Glacier | Level info")) + { + if (!levelControl) + { + ImGui::Text("No active level"); + return; + } + else { + ImGui::Text("Level control: "); ImGui::SameLine(0.f, 10.f); ImGui::TextColored(ImVec4(1.f, 1.f, 0.f, 1.f), "0x%.8X", levelControl); + } + } } } \ No newline at end of file diff --git a/HM3CoreKill/HM3CoreKill/ck/HM3InGameTools.h b/HM3CoreKill/HM3CoreKill/ck/HM3InGameTools.h index 831db57..ee940cc 100644 --- a/HM3CoreKill/HM3CoreKill/ck/HM3InGameTools.h +++ b/HM3CoreKill/HM3CoreKill/ck/HM3InGameTools.h @@ -26,6 +26,9 @@ namespace ck private: void drawDebugMenu(); + void drawPlayerInfo(); + void drawSystemsInfo(); + void drawLevelInfo(); }; } \ No newline at end of file diff --git a/HM3CoreKill/HM3CoreKill/sdk/ZHM3BriefingControl.h b/HM3CoreKill/HM3CoreKill/sdk/ZHM3BriefingControl.h new file mode 100644 index 0000000..6bdffb5 --- /dev/null +++ b/HM3CoreKill/HM3CoreKill/sdk/ZHM3BriefingControl.h @@ -0,0 +1,7 @@ +#pragma once + +namespace ioi { namespace hm3 { + + class ZHM3BriefingControl {}; + +}} \ No newline at end of file diff --git a/HM3CoreKill/HM3CoreKill/sdk/ZHM3GameData.h b/HM3CoreKill/HM3CoreKill/sdk/ZHM3GameData.h index 9a50dba..b69b5f6 100644 --- a/HM3CoreKill/HM3CoreKill/sdk/ZHM3GameData.h +++ b/HM3CoreKill/HM3CoreKill/sdk/ZHM3GameData.h @@ -7,6 +7,7 @@ #include #include #include +#include #define DECLARE_UNKNOWN_TYPE_PTR(name) using name = std::uintptr_t; @@ -22,6 +23,10 @@ namespace hm3 { DECLARE_UNKNOWN_TYPE_PTR(m_Gui); DECLARE_UNKNOWN_TYPE_PTR(CIngameMap); DECLARE_UNKNOWN_TYPE_PTR(CGlobalCom); + DECLARE_UNKNOWN_TYPE_PTR(ZHM3WeaponUpgradeControl); + DECLARE_UNKNOWN_TYPE_PTR(ZHM3CameraEventCameraClass); + DECLARE_UNKNOWN_TYPE_PTR(ZClothTracker); + DECLARE_UNKNOWN_TYPE_PTR(ZHM3DialogControl); class ZHM3GameData { @@ -86,11 +91,15 @@ namespace hm3 { char m_ProfileName[16]; //0xFC5888 char pad_0x0A70[0x64]; //0x0A70 int32_t m_PlayerMoney; //0x0AD4 - char pad_0x0AD8[0x5EA0]; //0x0AD8 - ZHM3Camera* m_Camera; //0x6978 - char pad_0x697C[0x95C]; //0x697C - - - //+68F8 - ZHM3BriefingControl + char pad_0AD8[24096]; //0x0AD8 + ZHM3BriefingControl* m_BriefingControl; //0x68F8 + char pad_68FC[116]; //0x68FC + ZHM3WeaponUpgradeControl* m_WeaponUpgradeControl; //0x6970 + ZHM3CameraEventCameraClass* m_CameraEventCameraClass; //0x6974 + ZHM3Camera* m_CameraClass; //0x6978 + char pad_697C[32]; //0x697C + ZClothTracker* m_ClothTracker; //0x699C + char pad_69A0[8]; //0x69A0 + ZHM3DialogControl* m_DialogControl; //0x69A8 }; //Size=0x72D8 }} \ No newline at end of file diff --git a/HM3CoreKill/HM3CoreKill/sdk/ZHM3LevelControl.h b/HM3CoreKill/HM3CoreKill/sdk/ZHM3LevelControl.h index a295aa9..1d7c07e 100644 --- a/HM3CoreKill/HM3CoreKill/sdk/ZHM3LevelControl.h +++ b/HM3CoreKill/HM3CoreKill/sdk/ZHM3LevelControl.h @@ -1,6 +1,7 @@ #pragma once #include +#include namespace ioi { namespace hm3 { @@ -77,7 +78,7 @@ namespace ioi { namespace hm3 { virtual void completeLevelRequest(); //63 virtual void Function64(); virtual void Function65(); - virtual void Function66(); + virtual ZHM3BriefingControl* getBriefingControl(int a2); //66 virtual void Function67(); virtual void Function68(); virtual void Function69(); diff --git a/HM3CoreKill/HM3CoreKill/sdk/input/ZKeyboard.h b/HM3CoreKill/HM3CoreKill/sdk/input/ZKeyboard.h deleted file mode 100644 index 8045035..0000000 --- a/HM3CoreKill/HM3CoreKill/sdk/input/ZKeyboard.h +++ /dev/null @@ -1,17 +0,0 @@ -#pragma once - -#include -#include - -namespace ioi { namespace hm3 { namespace sysinput { - - class ZKeyboard - { - public: - char pad_0000[40]; //0x0000 - uint32_t unknown_inlined_stuff; //0x0028 - ZKeyboardStorage* activeKeys; //0x002C - char pad_0030[24]; //0x0030 - }; //Size: 0x0048 - -}}} \ No newline at end of file diff --git a/HM3CoreKill/HM3CoreKill/sdk/input/ZKeyboardStorage.h b/HM3CoreKill/HM3CoreKill/sdk/input/ZKeyboardStorage.h deleted file mode 100644 index d3fc008..0000000 --- a/HM3CoreKill/HM3CoreKill/sdk/input/ZKeyboardStorage.h +++ /dev/null @@ -1,28 +0,0 @@ -#pragma once - -#include - -namespace ioi { namespace hm3 { namespace sysinput { - - // Created with ReClass.NET 1.2 by KN4CK3R - - class ZKeyboardStorage - { - public: - char pad_0000[12]; //0x0000 - int32_t isBackspacePressed; //0x000C - char pad_0010[12]; //0x0010 - int32_t isCtrlPressed; //0x001C - char pad_0020[8]; //0x0020 - int32_t isShiftPressed; //0x0028 - char pad_002C[8]; //0x002C - int32_t isRightShiftPressed; //0x0034 - int32_t isAltPressed; //0x0038 - char pad_003C[96]; //0x003C - int32_t isRightCtrlPressed; //0x009C - char pad_00A0[24]; //0x00A0 - int32_t isRightAltPressed; //0x00B8 - char pad_00BC[68]; //0x00BC - }; //Size: 0x0100 - -}}} \ No newline at end of file diff --git a/HM3CoreKill/HM3CoreKill/sdk/input/ZSysInput.h b/HM3CoreKill/HM3CoreKill/sdk/input/ZSysInput.h deleted file mode 100644 index 53caa0d..0000000 --- a/HM3CoreKill/HM3CoreKill/sdk/input/ZSysInput.h +++ /dev/null @@ -1,53 +0,0 @@ -#pragma once - -#include -#include - -namespace ioi { -namespace hm3 { -namespace sysinput { - - - // Created with ReClass.NET 1.2 by KN4CK3R - - class ZWintelInput - { - public: - char pad_0004[12]; //0x0004 - uint32_t mouse; //0x0010 - ZKeyboard* keyboard; //0x0014 - - virtual void Function0(); - virtual void Function1(); - virtual void Function2(); - virtual void Function3(); - virtual void Function4(); - virtual void Function5(); - virtual void Function6(); - virtual void Function7(); - virtual void Function8(); - virtual void Function9(); - virtual void Function10(); - virtual void Function11(); - virtual void Function12(); - virtual void Function13(); - virtual void Function14(); - virtual void Function15(); - virtual void Function16(); - virtual void Function17(); - virtual void Function18(); - virtual void Function19(); - virtual void Function20(); - virtual void Function21(); - virtual void Function22(); - virtual void Function23(); - virtual void Function24(); - virtual void Function25(); - virtual void Function26(); - virtual void Function27(); - virtual void Function28(); - virtual void Function29(); - virtual void Function30(); - }; //Size: 0x0018 - -}}} \ No newline at end of file diff --git a/ReClassNotes/ZHM3GameData.rcnet b/ReClassNotes/ZHM3GameData.rcnet new file mode 100644 index 0000000000000000000000000000000000000000..de9fabe824c707b7d41ee006960133765ee66388 GIT binary patch literal 20184 zcmeI44^SIb9>@996e$HxD@C!8nL8~fwZ>|(*V1O&L$40~LvL)2mMaTZ#VJaVmO>k{ zOKB~0Q%`g%hgZPBp;C?Qrecq_kSu>h%5ezTVn8I@KPH4G5Fr0|v-@tt*%_UqBjMU6 zdP_d@czJJ`_xSGb?Y`gc`@Jn20_WWA=jV5aU(wb-Y;o$%F)wZQ^9xK0VoUt|o=D%5 z{&4=Qubdtl`ZPu@9k!ddYGdw+S^VMx1D<+Ll5}yaegB`g#U#WHF3Qk7!F&6y&!g_z z@>I{;Ihng3DSId7{NJDIc>l?>_g{=%?Wf=`NA$`(dmeQB8`o-JLIEElOK_*F&dzB2 zB4LEoS&L1zI5NRVuvFBgJDLoG$yPhQpE`oCB0vem$UrTh7NAxU82=cxO?C>#t&}0!n9=Nhc>qJMBV; zt{Mw>4h#!W+93S`m%ISklBrX}UFF?~%S^YH2pz5EgmYBZh)5X61-i9cgY0fH#W)!M zkEGHkb`dLIfGqURoC4{_H%*J`_$0IJ1e;$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