Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
DronCode committed Oct 25, 2020
0 parents commit a44b457
Show file tree
Hide file tree
Showing 12 changed files with 536 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
.idea
.vscode
build
cmake-build-*
venv
9 changes: 9 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
[submodule "Modules/fmt"]
path = Modules/fmt
url = https://github.com/fmtlib/fmt
[submodule "Modules/nlohmann"]
path = Modules/nlohmann
url = https://github.com/nlohmann/json
[submodule "Modules/zlib"]
path = Modules/zlib
url = https://github.com/madler/zlib
18 changes: 18 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
cmake_minimum_required(VERSION 3.16)
project(ReHitmanTools)

set(CMAKE_CXX_STANDARD 20)

if(
NOT EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/Modules/fmt/CMakeLists.txt" OR
NOT EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/Modules/nlohmann/CMakeLists.txt" OR
NOT EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/Modules/zlib/CMakeLists.txt"
)
message(FATAL_ERROR "The submodules were not downloaded!\nPlease, init submodules via git submodule update --init --recursive")
endif()

add_subdirectory(Modules/fmt)
add_subdirectory(Modules/zlib)
add_subdirectory(Modules/nlohmann)

add_subdirectory(Tools/GMSInfo)
1 change: 1 addition & 0 deletions Modules/fmt
Submodule fmt added at df4bd6
1 change: 1 addition & 0 deletions Modules/nlohmann
Submodule nlohmann added at fd7a9f
1 change: 1 addition & 0 deletions Modules/zlib
Submodule zlib added at cacf7f
22 changes: 22 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
ReHitman Tools
--------------

This repository contains utilities for work with files of games who was built on Glacier Engine

License: **GNU GPLv2**

Build
-----

```
git clone https://github.com/ReGlacier/ReHitmanTools.git
cd ReHitmanTools
git submodule update --init --recursive
```

For build all projects:
```
mkdir build && cd build
cmake -A Win32 ..
cmake --build . --config Release
```
30 changes: 30 additions & 0 deletions Tools/GMSInfo/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
cmake_minimum_required(VERSION 3.16)
project(HBM_GMSTool)

set(CMAKE_CXX_STANDARD 20)

if (NOT CMAKE_SIZEOF_VOID_P EQUAL 4) # TODO: Think about how to do it better
message(FATAL_ERROR "Supported only x86 arch!")
endif()

add_executable(HBM_GMSTool ${CMAKE_CURRENT_SOURCE_DIR}/source/main.cpp)
target_link_libraries(HBM_GMSTool PRIVATE fmt::fmt nlohmann_json zlibstatic)
target_compile_definitions(HBM_GMSTool PRIVATE -D_CRT_SECURE_NO_WARNINGS=1)
target_include_directories(HBM_GMSTool PRIVATE
${CMAKE_CURRENT_SOURCE_DIR}/../../Modules/zlib # hotfix for zlib
${CMAKE_CURRENT_BINARY_DIR}
$<TARGET_FILE_DIR:zlibstatic>/.. # hotfix for zlib (final path contains type of build)
$<TARGET_FILE_DIR:zlibstatic>)

add_custom_command(
TARGET HBM_GMSTool POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy
${CMAKE_CURRENT_SOURCE_DIR}/data/typeids.json $<TARGET_FILE_DIR:HBM_GMSTool>)

# Type definitions generator tool
add_custom_target(
GenerateGlacierTypeDefs
COMMAND python ${CMAKE_CURRENT_SOURCE_DIR}/utils/decompose.py ${CMAKE_CURRENT_SOURCE_DIR}/data/typeids.json ${CMAKE_CURRENT_BINARY_DIR}/GlacierTypeDefs.h
COMMENT "Generate CPP definitions by data/typeids.json"
)
add_dependencies(HBM_GMSTool GenerateGlacierTypeDefs)
32 changes: 32 additions & 0 deletions Tools/GMSInfo/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
GMSInfo
-------

This tool was created to parse GMS file format

Build
-----
```
mkdir build && cd build
cmake -A Win32 ..
cmake --build . --config Release --target HBM_GMSTool
```

Usage
-----
`./HBM_GMSTool.exe [path to GMS file] [path to PRM file] >> report.txt`

all information about the GMS file will be written into `report.txt` file

Supported games
---------------

* Hitman Blood Money (primary support)
* Hitman Contracts (in theory with possible bugs)
* Hitman 2 Silent Assassin (not tested)
* Hitman Agent 47 (not tested)

FAQ
----

* **Q:** My report contains `NOT FOUND` strings, what's wrong?
* **A:** Your type not declared inside `typeids.json` file or you forgot to copy this file to the folder with HBM_GMSTool.exe
87 changes: 87 additions & 0 deletions Tools/GMSInfo/data/typeids.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
{
"0x10003F": ["ZBackdrop","ZROOM"],
"0x20011B": ["ZLoader_Sequence_Setup","ZSTDOBJ"],
"0x100001": ["ZGROUP","ZGEOM"],
"0x10042A": ["ZHM3Item","ZItem"],
"0x2003E": ["ZHM3Actor","ZActor"],
"0x2003E9": ["ZHM3Actor","ZActor"],
"0x100446": ["ZHM3HmAs","ZGROUP"],
"0x200046": ["ZWINPIC","ZWINOBJ"],
"0x20004F": ["ZCUSTOMFRAME","ZFRAME"],
"0x1000CA": ["ZAllocMany","ZGROUP"],
"0x200012": ["ZSNDOBJ","ZSTDOBJ"],
"0x2000CF": ["ZEditorSpline","ZSTDOBJ"],
"0x2000E1": ["ZBoxPrimitive","ZSTDOBJ"],
"0x800001A": ["ZLIST","ZGEOM"],
"0x2000EF": ["ZBloodStains","ZSTDOBJ"],
"0x200456": ["ZBloodTrail","ZSTDOBJ"],
"0x200111": ["ZBloodTrails","ZSTDOBJ"],
"0x2000F1": ["ZBloodSplatters","ZSTDOBJ"],
"0x2000E4": ["ZParticleController","ZSTDOBJ"],
"0x2000FF": ["ZParticleEmitter","ZSTDOBJ"],
"0x200002": ["ZSTDOBJ","ZGEOM"],
"0x10044E": ["ZHM3ClipParticleControl","ZAllocMany"],
"0x800024": ["ZOMNILIGHT","ZLIGHT"],
"0x100456": ["ZCigs","ZAllocMany"],
"0x2000E5": ["ZParticleTemplate","ZSTDOBJ"],
"0x10002E": ["ZWINGROUP","ZGROUP"],
"0x100021": ["ZROOM","ZTreeGroup"],
"0x200427": ["ZOSD","ZSTDOBJ"],
"0x400003": ["ZCAMERA","ZGEOM"],
"0x200430": ["ZGui","ZSTDOBJ"],
"0x80000D": ["ZENVIRONMENT","ZLIGHT"],
"0x20002D": ["ZCHAROBJ","ZWINOBJ"],
"0x200441": ["CMapIconDraw","ZSTDOBJ"],
"0x100033": ["ZBUTTON","ZCONTROL"],
"0x800023": ["ZSPOTLIGHT","ZLIGHT"],
"0x800020": ["ZSPOTLIGHTSQUARE","ZLIGHT"],
"0x100431": ["ZHM3ItemTemplateContainer","ZItemTemplateContainer"],
"0x200447": ["ZHM3ClothBundle","ZSTDOBJ"],
"0x200006": ["ZLNKOBJ","ZSTDOBJ"],
"0x100432": ["ZHM3ItemContainer","ZItemContainer"],
"0x8000F2": ["ZGateLightSpotSquare","ZSPOTLIGHTSQUARE"],
"0x8000F5": ["ZGateLightOmni","ZOMNILIGHT"],
"0x20001C": ["ZBOUND","ZSTDOBJ"],
"0x200110": ["ZSHADOWMESHOBJ","ZSTDOBJ"],
"0x20045D": ["ZWantedPoster","ZSTDOBJ"],
"0x200435": ["ZHM3HitmanMovementGuide","ZSTDOBJ"],
"0x2000D2": ["ZWaterBox","ZBoxPrimitive"],
"0x20010F": ["ZEnvSampler","ZSTDOBJ"],
"0x2000F6": ["ZCloth","ZSTDOBJ"],
"0x2000CE": ["ZScatterObj","ZSTDOBJ"],
"0x100461": ["ZHM3ScopeNumberDisplay","ZGROUP"],
"0x100442": ["ZHM3CombineItems","ZGROUP"],
"0x100429": ["ZHM3ItemTemplateWeapon","ZItemTemplateWeapon"],
"0x100451": ["ZHM3ItemTemplateBomb","ZHM3ItemTemplateWeapon"],
"0x100462": ["ZLaserAim","ZSTDOBJ"],
"0x100433": ["ZHM3ItemTemplateAmmo","ZItemTemplateAmmo"],
"0x10042E": ["ZHM3ItemTemplateAmmoCustom","ZHM3ItemTemplateAmmo"],
"0x10042C": ["ZHM3ItemWeaponCustomTemplate","ZHM3ItemTemplateWeapon"],
"0x20041D": ["ZFiberWire","ZSTDOBJ"],
"0x2000EE": ["ZBulletMarks","ZSTDOBJ"],
"0x100437": ["ZHM3WeaponUpgradeControl","ZGROUP"],
"0x100440": ["ZHM3WeaponUpgradeWeapon","ZGROUP"],
"0x200436": ["ZHM3WeaponUpgrade","ZSTDOBJ"],
"0x100428": ["ZHM3ItemTemplate","ZItemTemplate"],
"0x200455": ["ZHM3AccessoryGeom","ZLNKOBJ"],
"0x20011C": ["ZTie","ZCloth"],
"0x2003E8": ["ZHitman3","ZPlayer"],
"0x200027": ["ZIKLNKOBJ","ZLNKOBJ"],
"0x20043F": ["ZHM3ActorProperties","ZSTDOBJ"],
"0x200448": ["ZHitmanAnim","ZSTDOBJ"],
"0x200452": ["ZBodyBagBox","ZSTDOBJ"],
"0x200445": ["ZUsePoint","ZSTDOBJ"],
"0x200444": ["ZFriskBox","ZSTDOBJ"],
"0x400460": ["ZHM3CameraClassBase","ZCAMERA"],
"0x400443": ["ZHM3CameraEventCameraClass","ZHM3CameraClass"],
"0x400424": ["ZHM3CameraClass","ZCAMERA"],
"0x40041B": ["ZHM3OverlayCameraClass","ZCAMERA"],
"0x100031": ["ZWINDOW","ZWINGROUP"],
"0x200038": ["ZLINEOBJ","ZCHAROBJ"],
"0x101770": ["ZSkipSaveGroup","ZGROUP"],
"0x100030": ["ZWINDOWS","ZWINGROUP"],
"0x100034": ["ZSlider","ZCONTROL"],
"0x8000049": ["ZWINOBJSPRITEHOLDER","ZLIST"],
"0x20004C": ["ZKerningFont","ZTTFONT"],
"0x80100032": ["ZCONTROL","ZWINGROUP"]
}
Loading

0 comments on commit a44b457

Please sign in to comment.