Skip to content

Commit 7d5a12a

Browse files
authored
Merge pull request #41 from sourcehold/feature/builds-polyfill-and-constants
Prepare main branch for building using the exports
2 parents e70f9cd + 196ea38 commit 7d5a12a

22 files changed

Lines changed: 95551 additions & 21 deletions

.gitignore

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,20 @@
11
### OpenSHC
2+
# Ignore build artifacts
23
build-*/
34
build/
45
_build/
56
build.bat
67
build.ps1
78
build.py
89
dist/
10+
# Ignore scratch files
11+
tmp/
12+
# Ignore binary files and export files created from reverse engineering programs
13+
/*.7z
14+
/*.sarif
15+
/*.bin
16+
# Ignore the reccmp results overview
17+
/reccmp/**/*.json
918

1019
# Softlink to game installation
1120
_original

CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,7 @@ target_file_copy_if_different(OpenSHC.exe "${CRUSADER_DIR}/shfolder.dll" "$<TARG
144144

145145

146146

147+
# Place the dll and its pdb in the OpenSHC module folder for live testing
147148
set(OPEN_SHC_DLL_DEST "${CRUSADER_DIR}/ucp/modules/${OPEN_SHC_NAME}-${OPEN_SHC_VERSION}" CACHE PATH "Path for OpenSHC.dll and OpenSHC.pdb")
148149

149150
add_library(OpenSHC.dll SHARED src/entry.cpp ${CORE_SOURCES} ${OPENSHC_SOURCES})

README.md

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,12 +50,15 @@ Because the original game was compiled using an old compiler, you have to compil
5050
### Setup
5151

5252
1. Clone the repository. Make sure to also pull the submodules to have the compiler included:
53+
5354
```sh
5455
git clone --recursive https://github.com/sourcehold/OpenSHC.git
5556
```
57+
5658
- Should NET Framework 3.5 be required, it can be easily installed on Windows 11 by running `mt.exe` (from the MSVC1400 repo), Windows 11 will ask to install the right version.
59+
5760
2. Create a softlink to the original game executable with the name `_original` by running [softlink.bat](softlink.bat). It will request the full path to the game folder.
58-
3. Setup the needed Python environment to run `reccmp` for binary comparison by running [setup.bat](reccmp/setup.bat) in the reccmp folder.
61+
3. Setup the needed Python environment to run `reccmp` for binary comparison by running [setup.bat](reccmp/dll/setup.bat) in the reccmp/dll folder (or the `setup.bat` in the reccmp/exe folder if binary comparison on the reimplemented .exe file is preferred)
5962

6063
### Development
6164

@@ -72,9 +75,9 @@ If the scripts are preferred, the following triggers a build using the scripts:
7275
```sh
7376
build.bat RelWithDebInfo
7477
```
75-
4. Compare a function byte by byte to check compilation:
78+
4. Compare a function byte by byte to the OpenSHC.dll to check compilation:
7679
```sh
77-
reccmp/run reccmp-reccmp --target STRONGHOLDCRUSADER --verbose 0x401000
80+
reccmp/dll/run reccmp-reccmp --target STRONGHOLDCRUSADER --verbose 0x401000
7881
```
7982

8083
If CMake is installed and not in PATH, for example if installed via Visual Studio, `cmakew.bat` can be used instead. It tries to detect a CMake installation and uses it.

reccmp/dll/reccmp-build.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
project: .
2+
targets:
3+
STRONGHOLDCRUSADER:
4+
path: ../../_original/ucp/modules/OpenSHC-1.41.0/OpenSHC.dll
5+
pdb: ../../_original/ucp/modules/OpenSHC-1.41.0/OpenSHC.pdb
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
targets:
22
STRONGHOLDCRUSADER:
33
filename: Stronghold Crusader.exe
4-
source_root: ../src
4+
source_root: ../../src
55
hash:
66
sha256: 3bb0a8c1e72331b3a30a5aa93ed94beca0081b476b04c1960e26d5b45387ac5a
77
data_sources: []

reccmp/dll/reccmp-user.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
targets:
2+
STRONGHOLDCRUSADER:
3+
path: ../../_original/Stronghold Crusader.exe
File renamed without changes.
File renamed without changes.

reccmp/exe/reccmp-build.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
project: .
2+
targets:
3+
STRONGHOLDCRUSADER:
4+
path: ../../build-RelWithDebInfo/OpenSHC.exe
5+
pdb: ../../build-RelWithDebInfo/OpenSHC.pdb

0 commit comments

Comments
 (0)