Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

.NET Scripting support #8

Open
wants to merge 34 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
b925acc
Too many things ...
DronCode Feb 17, 2021
a66411b
Fix ZLIST, Clone actor prototype (need to find a way to make it 'alive')
DronCode Feb 18, 2021
20ba8e5
ZActor & ZHM3Actor was disassembled and partial tested.
DronCode Feb 22, 2021
5f8d823
Reversed CTelePortList, ZEventBuffer
DronCode Apr 17, 2021
9f25682
ZRenderWintelD3D reversed partially (only data, vftable is not ready)
DronCode Apr 17, 2021
794f044
FreeFS patch & small refactoring
DronCode Apr 18, 2021
64cfd41
Oh, too many things again.
DronCode Apr 24, 2021
53cfbba
1) Reversed class CElevatorHouse
DronCode May 12, 2021
4018626
1) Reversed ZVCR class
DronCode May 16, 2021
595a651
1) Reversed few methods from ZOSD class
DronCode May 16, 2021
8376411
1) Reversed CKeycardReader class with most useful API methods
DronCode May 16, 2021
692e713
Fix return type of the function
DronCode May 16, 2021
318083e
Reversed few things like COLI, loader sequence and added bugfix for F…
DronCode Jun 26, 2021
60876a9
Try to fix fmt bug
DronCode Jun 26, 2021
75c297d
Reversed ZCameraSpace class
DronCode Jul 25, 2021
5c9d70d
Try to fix build (1)
DronCode Jul 25, 2021
82b594e
Try to build (2): update fmt submodule
DronCode Jul 25, 2021
4d4f416
Try to fix build (3): use C++17 instead of C++20
DronCode Jul 25, 2021
482e882
Try to build (4): restore C++20
DronCode Jul 25, 2021
85b898e
Try to fix build (5): check theory
DronCode Jul 25, 2021
3655afe
Try to fix build (6): check theory again
DronCode Jul 25, 2021
615b5bb
Reversed ZDrawBuffer class
DronCode Jul 25, 2021
3874ad5
Fixed ZCameraSpace on-stack size. Added check for ZCAMERA pointer in …
DronCode Jul 26, 2021
b80a765
Fixed few problems from ZCHAROBJ & ZWINOBJ. Added IRenderDelegate to …
DronCode Jul 31, 2021
47e049b
Reversed ZFONT, ZTTFONT, ZKerningFont classes. Fixed scene patch (mor…
DronCode Aug 1, 2021
a4f3d3e
HackingFramework:
DronCode Aug 29, 2021
377fbd0
BloodMoney:
DronCode Aug 29, 2021
b1ae2b2
Added ZWheelChairLock class, ZClothTracker and ZHM3BriefingControl. A…
DronCode Aug 31, 2021
3eabf32
Trying to understand how UI rendering works in the main menu (and in …
DronCode Sep 4, 2021
fb49eec
Added enums and some fields are reconstructed
DronCode Sep 4, 2021
86e1cd8
Reversed few core classes (ZLIGHT as base)
DronCode Sep 5, 2021
0e8193a
Reversed few things in ZCameraSpace
DronCode Sep 5, 2021
968600e
First implementation of scripting subsystem
DronCode Sep 12, 2021
317e6f4
Refactored API in MonoBindings
DronCode Oct 16, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion ReHitman/BloodMoney/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ file(GLOB_RECURSE HITMAN_BM_SOURCES
add_library(BloodMoney STATIC ${HITMAN_BM_SOURCES})
add_library(Hitman::BloodMoney ALIAS BloodMoney)
target_include_directories(BloodMoney PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/include)
target_link_libraries(BloodMoney G1::Core HF::Core ReHitman::IClient ImGui::Core ImGui::DX9 spdlog)
target_link_libraries(BloodMoney G1::Core HF::Core ReHitman::IClient ImGui::Core ImGui::DX9 spdlog ScriptingRuntime)
49 changes: 49 additions & 0 deletions ReHitman/BloodMoney/include/BloodMoney/BMConfigurationService.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,54 @@ namespace Hitman::BloodMoney
static std::intptr_t BMAPI_FunctionAddress_ZHM3ItemBomb_Explode;
static std::intptr_t BMAPI_FunctionAddress_CMetalDetector_DoDetectWeapon;
static std::intptr_t BMAPI_FunctionAddress_CMetalDetector_DoAlarm;
static std::intptr_t BMAPI_FunctionAddress_ZHM3Actor_PreparePath;
static std::intptr_t BMAPI_FunctionAddress_ZHM3Actor_ActivateBloodSpurt;
static std::intptr_t BMAPI_FunctionAddress_ZTie_HideTie;
static std::intptr_t BMAPI_FunctionAddress_ZTie_HideTieInMirror;
static std::intptr_t BMAPI_FunctionAddress_ZXMLGUISystem_GetTopWindow;
static std::intptr_t BMAPI_FunctionAddress_CTelePortList_TeleportToPointAtIndex;
static std::intptr_t BMAPI_FunctionAddress_ZHM3DialogControl_StartDialog;
static std::intptr_t BMAPI_FunctionAddress_ZHM3DialogControl_SetDialogSkipable;
static std::intptr_t BMAPI_FunctionAddress_CElevatorHouse_GetElevatorDoorStatus;
static std::intptr_t BMAPI_FunctionAddress_ZOSD_AddInfo;
static std::intptr_t BMAPI_FunctionAddress_ZOSD_AddWarning;
static std::intptr_t BMAPI_FunctionAddress_ZOSD_AddHint;
static std::intptr_t BMAPI_FunctionAddress_CKeycardReader_GetNearestDoor;
static std::intptr_t BMAPI_FunctionAddress_CKeycardReader_ValidateKeyCard;
static std::intptr_t BMAPI_FunctionAddress_CKeycardReader_InvalidateKeyCard;
static std::intptr_t BMAPI_FunctionAddress_CKeycardReader_DetermineLnkObjLocation;
static std::intptr_t BMAPI_FunctionAddress_CKeycardReader_GetKeyCard;
static std::intptr_t BMAPI_FunctionAddress_CKeycardReader_GetItemTemplateFromName;
static std::intptr_t BMAPI_FunctionAddress_CKeycardReader_IsKeyCardValid;
static std::intptr_t BMAPI_FunctionAddress_ZLINEOBJ_FactoryConstructor;
static std::intptr_t BMAPI_FunctionAddress_ZTTFONT_FactoryConstructor;
static std::intptr_t BMAPI_FunctionAddress_ZKerningFont_FactoryConstructor;
static std::intptr_t BMAPI_FunctionAddress_ZHM3WeaponUpgradeControl_InitWeaponReferences;
static std::intptr_t BMAPI_FunctionAddress_ZHM3WeaponUpgradeControl_ApplyDefaultUpgrades;
static std::intptr_t BMAPI_FunctionAddress_ZHM3WeaponUpgradeControl_GetWeaponType;
static std::intptr_t BMAPI_FunctionAddress_ZHM3ItemWeaponCustom_ApplyUpgrades;
static std::intptr_t BMAPI_FunctionAddress_ZHM3ItemWeaponCustom_UpdateWeaponPartDrawStatus;
static std::intptr_t BMAPI_FunctionAddress_ZHM3ItemWeaponCustom_ClearUpgrades;
static std::intptr_t BMAPI_FunctionAddress_ZHM3BriefingControl_CompleteObjective;
static std::intptr_t BMAPI_FunctionAddress_ZHM3BriefingControl_PlaySpeech;
static std::intptr_t BMAPI_FunctionAddress_ZHM3BriefingControl_StopSpeech;
static std::intptr_t BMAPI_FunctionAddress_ZWINOBJ_GetTexture;
static std::intptr_t BMAPI_FunctionAddress_ZGUIBase_GetSize;
static std::intptr_t BMAPI_FunctionAddress_PF4_CreatePathFinder;
static std::intptr_t BMAPI_FunctionAddress_ZHM3InventoryMenu_InitInventoryList;
static std::intptr_t BMAPI_FunctionAddress_ZHM3InventoryMenu_CloseItemView;
static std::intptr_t BMAPI_FunctionAddress_ZHM3InventoryMenu_CloseInventoryMenu;
static std::intptr_t BMAPI_FunctionAddress_ZHM3InventoryMenu_UpdateItemView;
static std::intptr_t BMAPI_FunctionAddress_ZHM3InventoryMenu_UpdateItemInfo;
static std::intptr_t BMAPI_FunctionAddress_ZHM3InventoryMenu_SpinCircle;
static std::intptr_t BMAPI_FunctionAddress_ZHM3InventoryMenu_TurnLeft;
static std::intptr_t BMAPI_FunctionAddress_ZHM3InventoryMenu_TurnRight;
static std::intptr_t BMAPI_FunctionAddress_IGUIElement_ChangeColorSet;
static std::intptr_t BMAPI_FunctionAddress_IGUIElement_ChangeColor;
static std::intptr_t BMAPI_FunctionAddress_IGUIElement_SetColor;
static std::intptr_t BMAPI_FunctionAddress_IGUIElement_GetRightPosOfTextGroup;
static std::intptr_t BMAPI_FunctionAddress_ZHM3MenuElements_GetGUIElement;
static std::intptr_t BMAPI_FunctionAddress_ZHM3ItemTool_GetHM3ItemName;
static std::intptr_t BMAPI_GlobalVariableAddress_ZVCR_m_msgStealTape;
};
}
4 changes: 4 additions & 0 deletions ReHitman/BloodMoney/include/BloodMoney/Client.h
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
#pragma once

#include <memory>
#include <ScriptingRuntime.h>
#include <Client/IClient.h>
#include <BloodMoney/Patches/CommonPatches.h>
#include <HF/HackingFrameworkFWD.h>


namespace Hitman::BloodMoney
{
class Client : public ReHitman::Client::IClient
Expand All @@ -13,6 +15,8 @@ namespace Hitman::BloodMoney
bool OnAttach() override;
void OnDestroy() override;

static Scripting::ScriptingRuntime* GetScriptingRuntime();

private:
static bool RegisterGameConfigurationForGlacier();

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#pragma once

#include <d3d9.h>
#include <cstdint>

namespace Hitman::BloodMoney::Engine
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ namespace Hitman::BloodMoney
class ZHM3CameraClassBase : public Glacier::ZCAMERA
{
public:

//vftable (no changes)
//data (total size is 0x1A8, ZCAMERA size is 0x18C)
int m_field18C;
int m_field190;
Expand Down
18 changes: 18 additions & 0 deletions ReHitman/BloodMoney/include/BloodMoney/FreeFS/HBMFreeFsProxy.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#pragma once

#include <string>

namespace Hitman::BloodMoney::FreeFS {
class HBMFreeFsProxy {
public:
char pad_0000[16]; //0x0000
char* m_missionZipFilePath; //0x0010
char pad_0014[100]; //0x0014
char* m_zipFilePath; //0x0078

static std::string findFileInFolderRecursively(const std::string& folder, const std::string& file);

int readFileProvider(const char* name, void* dest, int fileSize, int unk1);
int getFileSizeProvider(const char* name);
};
}
15 changes: 15 additions & 0 deletions ReHitman/BloodMoney/include/BloodMoney/Game/CCheat.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#pragma once

#include <Glacier/GlacierFWD.h>

#include <string_view>

namespace Hitman::BloodMoney {
class CCheat
{
public:
static void GiveItem(Glacier::ZREF rItem);
static void GiveItem(Glacier::ZGROUP* pWeaponsGroup, std::string_view sItemName);
static void GiveSome();
};
}
2 changes: 1 addition & 1 deletion ReHitman/BloodMoney/include/BloodMoney/Game/CIngameMap.h
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ namespace Hitman::BloodMoney
char field_2A3;
int field_02A4;
int field_02A8;
SMapGroup *m_currentMapGroup;
SMapGroup* m_currentMapGroup;
int field_02B0;
int field_02B4;
int field_02B8;
Expand Down
17 changes: 17 additions & 0 deletions ReHitman/BloodMoney/include/BloodMoney/Game/CTelePortList.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#pragma once

#include <Glacier/Glacier.h>
#include <Glacier/EventBase/ZEventBase.h>

namespace Hitman::BloodMoney {
class CTelePortList : public Glacier::ZEventBase {
public:
// size is 0x3C
int m_field30;
int m_field34;
Glacier::ZREF m_targetREF; // REF to entity who will be teleported to position

// public API
void TeleportToPointAtIndex(int index);
};
}
Loading