Compare commits

..

74 Commits
v1.2.8 ... main

Author SHA1 Message Date
fed
1061c08829
Merge pull request #92 from fedddddd/dependabot/submodules/deps/GSL-b39e7e4
Bump deps/GSL from `f1a494c` to `b39e7e4`
2024-03-07 21:40:03 +01:00
dependabot[bot]
c75cf561f7
Bump deps/GSL from f1a494c to b39e7e4
Bumps [deps/GSL](https://github.com/microsoft/GSL) from `f1a494c` to `b39e7e4`.
- [Release notes](https://github.com/microsoft/GSL/releases)
- [Commits](f1a494cfd2...b39e7e4b09)

---
updated-dependencies:
- dependency-name: deps/GSL
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-02-27 14:30:40 +00:00
fed
3ea6050498
Merge pull request #89 from fedddddd/dependabot/submodules/deps/zlib-5c42a23
Bump deps/zlib from `e342bb3` to `5c42a23`
2024-02-12 17:19:02 +01:00
dependabot[bot]
1551d7f1fd
Bump deps/zlib from e342bb3 to 5c42a23
Bumps [deps/zlib](https://github.com/madler/zlib) from `e342bb3` to `5c42a23`.
- [Release notes](https://github.com/madler/zlib/releases)
- [Commits](e342bb3dae...5c42a230b7)

---
updated-dependencies:
- dependency-name: deps/zlib
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-02-12 14:10:29 +00:00
fed
bf1d649bc1
Merge pull request #83 from fedddddd/dependabot/submodules/deps/GSL-f1a494c
Bump deps/GSL from `e64c97f` to `f1a494c`
2024-02-07 18:55:06 +01:00
fed
71727a5197
Merge pull request #82 from fedddddd/dependabot/submodules/deps/json-0457de2
Bump deps/json from `3780b41` to `0457de2`
2024-02-07 18:54:58 +01:00
fed
530cd10466
Merge pull request #85 from fedddddd/dependabot/submodules/deps/zlib-e342bb3
Bump deps/zlib from `643e17b` to `e342bb3`
2024-02-07 18:54:52 +01:00
fed
978e251df8
Fixes for update 2024-02-07 18:52:23 +01:00
dependabot[bot]
cb96052638
Bump deps/zlib from 643e17b to e342bb3
Bumps [deps/zlib](https://github.com/madler/zlib) from `643e17b` to `e342bb3`.
- [Release notes](https://github.com/madler/zlib/releases)
- [Commits](643e17b749...e342bb3dae)

---
updated-dependencies:
- dependency-name: deps/zlib
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-02-07 14:11:12 +00:00
dependabot[bot]
9b217b20e3
Bump deps/GSL from e64c97f to f1a494c
Bumps [deps/GSL](https://github.com/microsoft/GSL) from `e64c97f` to `f1a494c`.
- [Release notes](https://github.com/microsoft/GSL/releases)
- [Commits](e64c97fc2c...f1a494cfd2)

---
updated-dependencies:
- dependency-name: deps/GSL
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-01-30 15:02:59 +00:00
dependabot[bot]
136a723187
Bump deps/json from 3780b41 to 0457de2
Bumps [deps/json](https://github.com/nlohmann/json) from `3780b41` to `0457de2`.
- [Release notes](https://github.com/nlohmann/json/releases)
- [Commits](3780b41dd0...0457de21cf)

---
updated-dependencies:
- dependency-name: deps/json
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-01-30 15:02:56 +00:00
fed
ad27dcb098
Merge pull request #73 from fedddddd/dependabot/submodules/deps/zlib-643e17b
Bump deps/zlib from `79a0e44` to `643e17b`
2024-01-29 19:33:48 +01:00
fed
96acf0718e
Merge pull request #79 from fedddddd/dependabot/submodules/deps/json-3780b41
Bump deps/json from `da92c0e` to `3780b41`
2024-01-29 19:33:42 +01:00
fed
72f936e82a
Merge pull request #74 from fedddddd/dependabot/submodules/deps/minhook-f5485b8
Bump deps/minhook from `0f25a24` to `f5485b8`
2024-01-29 19:33:35 +01:00
fed
9a11ac82b3
Merge pull request #67 from fedddddd/dependabot/submodules/deps/GSL-e64c97f
Bump deps/GSL from `52212c2` to `e64c97f`
2024-01-29 19:33:30 +01:00
fed
8f36c271fd Fix for update 2024-01-29 19:33:03 +01:00
dependabot[bot]
e952b8a0f7
Bump deps/json from da92c0e to 3780b41
Bumps [deps/json](https://github.com/nlohmann/json) from `da92c0e` to `3780b41`.
- [Release notes](https://github.com/nlohmann/json/releases)
- [Commits](da92c0e3e7...3780b41dd0)

---
updated-dependencies:
- dependency-name: deps/json
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-12-07 14:58:09 +00:00
dependabot[bot]
f6d78fd815
Bump deps/minhook from 0f25a24 to f5485b8
Bumps [deps/minhook](https://github.com/TsudaKageyu/minhook) from `0f25a24` to `f5485b8`.
- [Release notes](https://github.com/TsudaKageyu/minhook/releases)
- [Commits](0f25a2449b...f5485b8454)

---
updated-dependencies:
- dependency-name: deps/minhook
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-11-27 15:05:13 +00:00
dependabot[bot]
cadcca22f9
Bump deps/zlib from 79a0e44 to 643e17b
Bumps [deps/zlib](https://github.com/madler/zlib) from `79a0e44` to `643e17b`.
- [Release notes](https://github.com/madler/zlib/releases)
- [Commits](79a0e447a0...643e17b749)

---
updated-dependencies:
- dependency-name: deps/zlib
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-11-15 14:14:08 +00:00
dependabot[bot]
c04a0a0d8c
Bump deps/GSL from 52212c2 to e64c97f
Bumps [deps/GSL](https://github.com/microsoft/GSL) from `52212c2` to `e64c97f`.
- [Release notes](https://github.com/microsoft/GSL/releases)
- [Commits](52212c2d76...e64c97fc2c)

---
updated-dependencies:
- dependency-name: deps/GSL
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-10-19 14:37:17 +00:00
fed
61706336ce
Merge pull request #50 from fedddddd/dependabot/submodules/deps/zlib-79a0e44
Bump deps/zlib from `04f42ce` to `79a0e44`
2023-09-13 17:44:09 +02:00
fed
eb08109392
Merge pull request #57 from fedddddd/dependabot/submodules/deps/json-da92c0e
Bump deps/json from `5d27543` to `da92c0e`
2023-09-13 17:43:49 +02:00
fed
b23cb2014b
Merge pull request #58 from fedddddd/dependabot/submodules/deps/GSL-52212c2
Bump deps/GSL from `4300304` to `52212c2`
2023-09-13 17:43:40 +02:00
fed
4d979bf659 Fix for update 2023-09-13 17:43:18 +02:00
dependabot[bot]
206d06dc7d
Bump deps/GSL from 4300304 to 52212c2
Bumps [deps/GSL](https://github.com/microsoft/GSL) from `4300304` to `52212c2`.
- [Release notes](https://github.com/microsoft/GSL/releases)
- [Commits](4300304ef2...52212c2d76)

---
updated-dependencies:
- dependency-name: deps/GSL
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-09-12 14:12:10 +00:00
dependabot[bot]
4d8af4bd45
Bump deps/json from 5d27543 to da92c0e
Bumps [deps/json](https://github.com/nlohmann/json) from `5d27543` to `da92c0e`.
- [Release notes](https://github.com/nlohmann/json/releases)
- [Commits](5d2754306d...da92c0e3e7)

---
updated-dependencies:
- dependency-name: deps/json
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-09-11 14:56:53 +00:00
dependabot[bot]
46ab288488
Bump deps/zlib from 04f42ce to 79a0e44
Bumps [deps/zlib](https://github.com/madler/zlib) from `04f42ce` to `79a0e44`.
- [Release notes](https://github.com/madler/zlib/releases)
- [Commits](04f42ceca4...79a0e447a0)

---
updated-dependencies:
- dependency-name: deps/zlib
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-08-21 14:47:09 +00:00
fed
dd8c1ff71e Update signatures.cpp 2023-08-10 01:55:12 +02:00
fed
ed1ac62153
Merge pull request #36 from fedddddd/dependabot/submodules/deps/json-5d27543
Bump deps/json from `c71ecde` to `5d27543`
2023-08-08 16:23:45 +02:00
fed
7f7fd016cf
Merge pull request #44 from fedddddd/dependabot/submodules/deps/GSL-4300304
Bump deps/GSL from `303d964` to `4300304`
2023-08-08 16:23:38 +02:00
fed
6c093888b5
Merge pull request #45 from fedddddd/dependabot/submodules/deps/gsc-tool-d7365e4
Bump deps/gsc-tool from `f026487` to `d7365e4`
2023-08-08 16:23:31 +02:00
dependabot[bot]
1440760aa5
Bump deps/gsc-tool from f026487 to d7365e4
Bumps [deps/gsc-tool](https://github.com/xensik/gsc-tool) from `f026487` to `d7365e4`.
- [Release notes](https://github.com/xensik/gsc-tool/releases)
- [Commits](f0264876df...d7365e471a)

---
updated-dependencies:
- dependency-name: deps/gsc-tool
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-07-28 14:35:53 +00:00
dependabot[bot]
105c11a8b2
Bump deps/GSL from 303d964 to 4300304
Bumps [deps/GSL](https://github.com/microsoft/GSL) from `303d964` to `4300304`.
- [Release notes](https://github.com/microsoft/GSL/releases)
- [Commits](303d964a24...4300304ef2)

---
updated-dependencies:
- dependency-name: deps/GSL
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-07-27 14:35:38 +00:00
dependabot[bot]
795f8ac162
Bump deps/json from c71ecde to 5d27543
Bumps [deps/json](https://github.com/nlohmann/json) from `c71ecde` to `5d27543`.
- [Release notes](https://github.com/nlohmann/json/releases)
- [Commits](c71ecde505...5d2754306d)

---
updated-dependencies:
- dependency-name: deps/json
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-06-14 15:06:14 +00:00
fed
6dd4d2651a
Merge pull request #34 from fedddddd/dependabot/submodules/deps/json-c71ecde
Bump deps/json from `a0c1318` to `c71ecde`
2023-06-13 04:33:01 +02:00
dependabot[bot]
b2f030f349
Bump deps/json from a0c1318 to c71ecde
Bumps [deps/json](https://github.com/nlohmann/json) from `a0c1318` to `c71ecde`.
- [Release notes](https://github.com/nlohmann/json/releases)
- [Commits](a0c1318830...c71ecde505)

---
updated-dependencies:
- dependency-name: deps/json
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-06-12 14:14:45 +00:00
fed
2690eeeece
Merge pull request #28 from fedddddd/dependabot/submodules/deps/gsc-tool-f026487
Bump deps/gsc-tool from `a8a62c2` to `f026487`
2023-05-24 00:28:18 +02:00
fed
098bd21008
Merge pull request #29 from fedddddd/dependabot/submodules/deps/json-a0c1318
Bump deps/json from `6af826d` to `a0c1318`
2023-05-24 00:28:11 +02:00
fed
2f474e979f
Merge pull request #30 from fedddddd/dependabot/submodules/deps/GSL-303d964
Bump deps/GSL from `afaaa71` to `303d964`
2023-05-24 00:28:05 +02:00
dependabot[bot]
2ab4da0ad9
Bump deps/GSL from afaaa71 to 303d964
Bumps [deps/GSL](https://github.com/microsoft/GSL) from `afaaa71` to `303d964`.
- [Release notes](https://github.com/microsoft/GSL/releases)
- [Commits](afaaa71bce...303d964a24)

---
updated-dependencies:
- dependency-name: deps/GSL
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-05-23 15:04:36 +00:00
dependabot[bot]
28c5594094
Bump deps/json from 6af826d to a0c1318
Bumps [deps/json](https://github.com/nlohmann/json) from `6af826d` to `a0c1318`.
- [Release notes](https://github.com/nlohmann/json/releases)
- [Commits](6af826d0bd...a0c1318830)

---
updated-dependencies:
- dependency-name: deps/json
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-05-22 15:10:24 +00:00
dependabot[bot]
6525bbb8bf
Bump deps/gsc-tool from a8a62c2 to f026487
Bumps [deps/gsc-tool](https://github.com/xensik/gsc-tool) from `a8a62c2` to `f026487`.
- [Release notes](https://github.com/xensik/gsc-tool/releases)
- [Commits](a8a62c2667...f0264876df)

---
updated-dependencies:
- dependency-name: deps/gsc-tool
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-05-19 15:04:33 +00:00
fed
1a9e3dfb15
Merge pull request #24 from fedddddd/dependabot/submodules/deps/minhook-0f25a24
Bump deps/minhook from `98b74f1` to `0f25a24`
2023-05-19 11:00:56 +02:00
fed
c62f1995e7 Update generate.bat 2023-05-19 10:49:37 +02:00
dependabot[bot]
883e38ae58
Bump deps/minhook from 98b74f1 to 0f25a24
Bumps [deps/minhook](https://github.com/TsudaKageyu/minhook) from `98b74f1` to `0f25a24`.
- [Release notes](https://github.com/TsudaKageyu/minhook/releases)
- [Commits](98b74f1fc1...0f25a2449b)

---
updated-dependencies:
- dependency-name: deps/minhook
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-05-15 15:08:38 +00:00
dependabot[bot]
1b2d4dbc46
Merge pull request #20 from fedddddd/dependabot/submodules/deps/json-6af826d 2023-05-13 18:05:49 +00:00
dependabot[bot]
7dfb35233e
Merge pull request #22 from fedddddd/dependabot/submodules/deps/minhook-98b74f1 2023-05-13 18:04:33 +00:00
dependabot[bot]
d842022056
Merge pull request #21 from fedddddd/dependabot/submodules/deps/GSL-afaaa71 2023-05-13 18:03:36 +00:00
dependabot[bot]
0a8ebc3058
Bump deps/json from e4643d1 to 6af826d
Bumps [deps/json](https://github.com/nlohmann/json) from `e4643d1` to `6af826d`.
- [Release notes](https://github.com/nlohmann/json/releases)
- [Commits](e4643d1f1b...6af826d0bd)

---
updated-dependencies:
- dependency-name: deps/json
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-05-13 17:58:53 +00:00
dependabot[bot]
8ccae5ddec
Bump deps/GSL from c31a9ad to afaaa71
Bumps [deps/GSL](https://github.com/microsoft/GSL) from `c31a9ad` to `afaaa71`.
- [Release notes](https://github.com/microsoft/GSL/releases)
- [Commits](c31a9ad5e8...afaaa71bce)

---
updated-dependencies:
- dependency-name: deps/GSL
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-05-13 17:58:43 +00:00
dependabot[bot]
cfb143f0fd
Bump deps/minhook from 423d1e4 to 98b74f1
Bumps [deps/minhook](https://github.com/TsudaKageyu/minhook) from `423d1e4` to `98b74f1`.
- [Release notes](https://github.com/TsudaKageyu/minhook/releases)
- [Commits](423d1e45af...98b74f1fc1)

---
updated-dependencies:
- dependency-name: deps/minhook
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-05-13 17:58:38 +00:00
fed
0281b5bef6 Update premake5 2023-05-13 19:53:55 +02:00
fed
70a91b271d Add workflows 2023-05-13 19:51:36 +02:00
fed
a7576ea765 Fix for pluto update 2023-05-13 19:50:00 +02:00
fed
3a492f51d9 Update functions.cpp 2023-02-27 01:24:02 +01:00
fed
d4ba37cde5 Remove this 2023-02-27 01:20:58 +01:00
fed
2ded4c6a2a Small fix 2023-02-27 01:20:08 +01:00
fed
24b3a9369e Fixes for pluto update 2023-02-27 01:18:50 +01:00
fed
1d94fdd88d Small fix 2022-12-28 01:07:53 +01:00
Federico Cecchetto
0af6b1cb13 Fix for update 2022-07-12 22:12:53 +02:00
Federico Cecchetto
d72c6f7057 Fix #16 2022-03-27 23:42:47 +02:00
Federico Cecchetto
39b9e7e352 Small change 2022-03-26 20:03:42 +01:00
Federico Cecchetto
36fefa6bb5 Remove this 2022-03-26 20:01:21 +01:00
Federico Cecchetto
4ffdb331b4 Use signature utils 2022-03-26 19:51:51 +01:00
Federico Cecchetto
7b995b3348 Add some string functions 2022-03-26 00:05:02 +01:00
Federico Cecchetto
14d0f401fb vs2022 build 2022-03-18 01:17:28 +01:00
Federico Cecchetto
df23604b1e Update pointers 2022-03-17 19:23:52 +01:00
fed
e2960bc895
Merge pull request #14 from diamante0018/main
Update Premake5, fix git modules.
2022-02-26 12:13:25 +01:00
db90d361a9
tabs 2022-02-26 11:12:55 +00:00
6ec0c5e23c
.git 2022-02-26 11:00:11 +00:00
c84d681a3a
Re add unfricked json 2022-02-26 10:58:51 +00:00
62d1c8671b
Re add unfricked json 2022-02-26 10:58:41 +00:00
877adfa4b6
Fix json 2022-02-26 10:54:43 +00:00
12fd44d0da
New gsc func + premake5 update 2022-02-26 10:51:20 +00:00
36 changed files with 535 additions and 7616 deletions

7
.github/dependabot.yml vendored Normal file
View File

@ -0,0 +1,7 @@
version: 2
updates:
- package-ecosystem: gitsubmodule
directory: "/"
schedule:
interval: daily
open-pull-requests-limit: 10

45
.github/workflows/build.yml vendored Normal file
View File

@ -0,0 +1,45 @@
name: Build
on:
push:
branches:
- "*"
pull_request:
branches:
- "*"
types: [opened, synchronize, reopened]
jobs:
build:
name: Build binaries
runs-on: windows-2022
strategy:
matrix:
configuration:
- Debug
- Release
steps:
- name: Check out files
uses: actions/checkout@v3
with:
submodules: true
fetch-depth: 0
lfs: false
- name: Add msbuild to PATH
uses: microsoft/setup-msbuild@v1.1.3
- name: Generate project files
run: tools/premake5 vs2022
- name: Set up problem matching
uses: ammaraskar/msvc-problem-matcher@master
- name: Build ${{matrix.configuration}} binaries
run: msbuild /m /v:minimal /p:Configuration=${{matrix.configuration}} /p:PlatformTarget=x86 build/iw5-gsc-utils.sln
- name: Upload ${{matrix.configuration}} binaries
uses: actions/upload-artifact@v3.1.0
with:
name: ${{matrix.configuration}} binaries
path: |
build/bin/${{matrix.configuration}}/iw5-gsc-utils.dll

13
.gitmodules vendored
View File

@ -4,12 +4,13 @@
[submodule "deps/GSL"]
path = deps/GSL
url = https://github.com/microsoft/GSL.git
[submodule "deps/sol2"]
path = deps/sol2
url = https://github.com/ThePhD/sol2.git
[submodule "deps/lua"]
path = deps/lua
url = https://github.com/lua/lua.git
[submodule "deps/json"]
path = deps/json
url = https://github.com/nlohmann/json.git
branch = develop
[submodule "deps/gsc-tool"]
path = deps/gsc-tool
url = https://github.com/xensik/gsc-tool.git
[submodule "deps/zlib"]
path = deps/zlib
url = https://github.com/madler/zlib.git

2
deps/GSL vendored

@ -1 +1 @@
Subproject commit c31a9ad5e8e99da8567237a7ba51a7d8f419e5bf
Subproject commit b39e7e4b0987859f5b19ff7686b149c916588658

1
deps/gsc-tool vendored Submodule

@ -0,0 +1 @@
Subproject commit 0e6238a6ab8643df6404f7c0280242df2812f6c8

2
deps/json vendored

@ -1 +1 @@
Subproject commit e10a3fac8a255433146e3f06a703dc110fc3c3da
Subproject commit 0457de21cffb298c22b629e538036bfeb96130b7

2
deps/minhook vendored

@ -1 +1 @@
Subproject commit 423d1e45af2ed2719a5c31e990e935ef301ed9c3
Subproject commit f5485b8454544c2f034c78f8f127c1d03dea3636

62
deps/premake/gsc-tool.lua vendored Normal file
View File

@ -0,0 +1,62 @@
gsc_tool = {
source = path.join(dependencies.basePath, "gsc-tool"),
}
function gsc_tool.import()
links { "xsk-gsc-iw5-pc", "xsk-gsc-utils" }
gsc_tool.includes()
end
function gsc_tool.includes()
includedirs {
path.join(gsc_tool.source, "include"),
}
end
function gsc_tool.project()
project "xsk-gsc-utils"
kind "StaticLib"
language "C++"
files {
path.join(gsc_tool.source, "include/xsk/utils/*.hpp"),
path.join(gsc_tool.source, "src/utils/*.cpp"),
}
includedirs {
path.join(gsc_tool.source, "include"),
}
zlib.includes()
project "xsk-gsc-iw5-pc"
kind "StaticLib"
language "C++"
filter "action:vs*"
buildoptions "/Zc:__cplusplus"
filter {}
files {
path.join(gsc_tool.source, "include/xsk/stdinc.hpp"),
path.join(gsc_tool.source, "include/xsk/gsc/engine/iw5_pc.hpp"),
path.join(gsc_tool.source, "src/gsc/engine/iw5_pc.cpp"),
path.join(gsc_tool.source, "src/gsc/engine/iw5_pc_code.cpp"),
path.join(gsc_tool.source, "src/gsc/engine/iw5_pc_func.cpp"),
path.join(gsc_tool.source, "src/gsc/engine/iw5_pc_meth.cpp"),
path.join(gsc_tool.source, "src/gsc/engine/iw5_pc_token.cpp"),
path.join(gsc_tool.source, "src/gsc/*.cpp"),
path.join(gsc_tool.source, "src/gsc/common/*.cpp"),
path.join(gsc_tool.source, "include/xsk/gsc/common/*.hpp"),
}
includedirs {
path.join(gsc_tool.source, "include"),
}
end
table.insert(dependencies, gsc_tool)

39
deps/premake/zlib.lua vendored Normal file
View File

@ -0,0 +1,39 @@
zlib = {
source = path.join(dependencies.basePath, "zlib"),
}
function zlib.import()
links { "zlib" }
zlib.includes()
end
function zlib.includes()
includedirs {
zlib.source
}
defines {
"ZLIB_CONST",
}
end
function zlib.project()
project "zlib"
language "C"
zlib.includes()
files {
path.join(zlib.source, "*.h"),
path.join(zlib.source, "*.c"),
}
defines {
"_CRT_SECURE_NO_DEPRECATE",
}
warnings "Off"
kind "StaticLib"
end
table.insert(dependencies, zlib)

1
deps/zlib vendored Submodule

@ -0,0 +1 @@
Subproject commit 5c42a230b7b468dff011f444161c0145b5efae59

View File

@ -1,2 +1,3 @@
@echo off
tools\windows\premake5.exe vs2019
call git submodule update --init --recursive
tools\premake5.exe vs2022

View File

@ -36,12 +36,19 @@ workspace "iw5-gsc-utils"
targetdir "%{wks.location}/bin/%{cfg.buildcfg}"
targetname "%{prj.name}"
configurations { "Debug", "Release", }
language "C++"
cppdialect "C++20"
architecture "x86"
buildoptions "/std:c++latest"
systemversion "latest"
symbols "On"
staticruntime "On"
editandcontinue "Off"
warnings "Extra"
characterset "ASCII"
flags
{
@ -49,19 +56,15 @@ workspace "iw5-gsc-utils"
"MultiProcessorCompile",
}
configurations { "Debug", "Release", }
symbols "On"
configuration "Release"
filter "configurations:Release"
optimize "Full"
defines { "NDEBUG" }
configuration{}
filter {}
configuration "Debug"
filter "configurations:Debug"
optimize "Debug"
defines { "DEBUG", "_DEBUG" }
configuration {}
filter {}
startproject "iw5-gsc-utils"

View File

@ -21,13 +21,13 @@ namespace gsc
{
std::string method_name(unsigned int id)
{
const auto map = *game::plutonium::method_map_rev;
const auto& map = (*game::plutonium::gsc_ctx)->meth_map();
for (const auto& function : map)
{
if (function.second == id)
{
return function.first;
return function.first.data();
}
}
@ -36,13 +36,13 @@ namespace gsc
std::string function_name(unsigned int id)
{
const auto map = *game::plutonium::function_map_rev;
const auto& map = (*game::plutonium::gsc_ctx)->func_map();
for (const auto& function : map)
{
if (function.second == id)
{
return function.first;
return function.first.data();
}
}
@ -53,8 +53,6 @@ namespace gsc
{
std::vector<scripting::script_value> args;
const auto top = game::scr_VmPub->top;
for (auto i = 0; i < game::scr_VmPub->outparamcount; i++)
{
const auto value = game::scr_VmPub->top[-i];
@ -194,7 +192,7 @@ namespace gsc
return scr_get_object_field_hook.invoke<void>(classnum, entnum, offset);
}
const auto field = custom_fields[classnum][offset];
const auto& field = custom_fields[classnum][offset];
try
{
@ -219,7 +217,7 @@ namespace gsc
}
const auto args = get_arguments();
const auto field = custom_fields[classnum][offset];
const auto& field = custom_fields[classnum][offset];
try
{
@ -250,10 +248,21 @@ namespace gsc
{
void add(const std::string& name, const script_function& func)
{
const auto index = function_map_start++;
auto index = 0u;
auto& ctx = (*game::plutonium::gsc_ctx);
functions[index] = func;
(*game::plutonium::function_map_rev)[name] = index;
if (ctx->func_exists(name))
{
printf("[iw5-gsc-utils] Warning: function '%s' already defined\n", name.data());
index = ctx->func_id(name);
}
else
{
index = function_map_start++;
ctx->func_add(name, index);
}
functions.insert(std::make_pair(index, func));
}
}
@ -261,10 +270,21 @@ namespace gsc
{
void add(const std::string& name, const script_method& func)
{
const auto index = method_map_start++;
auto index = 0u;
auto& ctx = (*game::plutonium::gsc_ctx);
methods[index] = func;
(*game::plutonium::method_map_rev)[name] = index;
if (ctx->meth_exists(name))
{
printf("[iw5-gsc-utils] Warning: method '%s' already defined\n", name.data());
index = ctx->meth_id(name);
}
else
{
index = method_map_start++;
ctx->meth_add(name, index);
}
methods.insert(std::make_pair(index, func));
}
}
@ -274,16 +294,13 @@ namespace gsc
const std::function<scripting::script_value(unsigned int entnum)>& getter,
const std::function<void(unsigned int entnum, const scripting::script_value&)>& setter)
{
const auto token_id = token_map_start++;
const auto offset = field_offset_start++;
custom_fields[classnum][offset] = {name, getter, setter};
(*game::plutonium::token_map_rev)[name] = token_id;
post_load_callbacks.push_back([classnum, name, token_id, offset]()
post_load_callbacks.push_back([=]()
{
const auto name_str = game::SL_GetString(name.data(), 0);
game::Scr_AddClassField(classnum, name_str, token_id, offset);
game::Scr_AddClassField(classnum, name_str, game::SL_GetCanonicalString(name.data()), offset);
});
}
}
@ -322,7 +339,7 @@ namespace gsc
scr_set_object_field_hook.create(0x52BCC0, scr_set_object_field_stub);
scr_post_load_scripts_hook.create(0x628B50, scr_post_load_scripts_stub);
field::add(classid::entity, "flags",
field::add(classid::entity, "entityflags",
[](unsigned int entnum) -> scripting::script_value
{
const auto entity = &game::g_entities[entnum];
@ -380,7 +397,7 @@ namespace gsc
return {};
});
function::add("dropallbots", [](const function_args& args) -> scripting::script_value
function::add("dropallbots", [](const function_args&) -> scripting::script_value
{
for (auto i = 0; i < *game::svs_clientCount; i++)
{
@ -437,7 +454,7 @@ namespace gsc
return {};
});
method::add("isbot", [](const game::scr_entref_t ent, const function_args& args) -> scripting::script_value
method::add("isbot", [](const game::scr_entref_t ent, const function_args&) -> scripting::script_value
{
if (ent.classnum != 0)
{
@ -454,8 +471,29 @@ namespace gsc
return game::svs_clients[client].bIsTestClient;
});
utils::hook::jump(0x56C8EB, call_builtin_stub);
utils::hook::jump(0x56CBDC, call_builtin_method_stub);
method::add("arecontrolsfrozen", [](const game::scr_entref_t ent, const function_args&) -> scripting::script_value
{
if (ent.classnum != 0)
{
throw std::runtime_error("Invalid entity");
}
const auto client = ent.entnum;
if (game::g_entities[client].client == nullptr)
{
throw std::runtime_error("Not a player entity");
}
return {(game::g_entities[client].client->flags & 4) != 0};
});
// let other plugins read the pointers
post_load_callbacks.push_back([]()
{
utils::hook::jump(0x56C8EB, call_builtin_stub);
utils::hook::jump(0x56CBDC, call_builtin_method_stub);
});
}
};
}

View File

@ -95,7 +95,7 @@ namespace scripting
const auto file_id = atoi(filename);
if (file_id)
{
current_file = scripting::file_list[file_id];
current_file = scripting::find_file(file_id);
}
process_script_hook.invoke<void>(filename);

View File

@ -0,0 +1,106 @@
#include <stdinc.hpp>
#include "signatures.hpp"
#include <utils/hook.hpp>
namespace signatures
{
size_t load_image_size()
{
MODULEINFO info{};
GetModuleInformation(GetCurrentProcess(),
GetModuleHandle("plutonium-bootstrapper-win32.exe"), &info, sizeof(MODULEINFO));
return info.SizeOfImage;
}
size_t get_image_size()
{
static const auto image_size = load_image_size();
return image_size;
}
void load_function_tables()
{
static const auto ptr = *reinterpret_cast<size_t*>(0x56CBDC + 0x1) + 0x56CBDC + 0x5;
static const auto function_table = *reinterpret_cast<size_t*>(0x56C8EB + 0x3);
static const auto method_table = *reinterpret_cast<size_t*>(ptr + 0xA);
game::plutonium::function_table.set(function_table);
game::plutonium::method_table.set(method_table);
}
size_t find_string_ptr(const std::string& string)
{
const char* string_ptr = nullptr;
std::string mask(string.size(), 'x');
const auto base = reinterpret_cast<size_t>(GetModuleHandle("plutonium-bootstrapper-win32.exe"));
utils::hook::signature signature(base, get_image_size() - base);
auto found = false;
signature.add({
string,
mask,
[&](char* address)
{
if (found)
{
return;
}
found = true;
string_ptr = address;
}
});
signature.process();
return reinterpret_cast<size_t>(string_ptr);
}
size_t find_string_ref(const std::string& string)
{
char bytes[4] = {0};
const auto string_ptr = find_string_ptr(string);
if (!string_ptr)
{
return 0;
}
std::memcpy(bytes, &string_ptr, sizeof(bytes));
return find_string_ptr({bytes, 4});
}
bool process_gsc_ctx()
{
const auto string_ref = find_string_ref("in call to builtin %s \"%s\"");
if (!string_ref)
{
return false;
}
const auto gsc_ctx_ptr = *reinterpret_cast<size_t*>(string_ref - 0xAD);
OutputDebugString(utils::string::va("gsc_ctx_ptr: %p\n", gsc_ctx_ptr));
game::plutonium::gsc_ctx.set(gsc_ctx_ptr);
return true;
}
bool process_printf()
{
const auto string_ref = find_string_ref("A critical exception occured!\n");
if (!string_ref)
{
return false;
}
const auto offset = *reinterpret_cast<size_t*>(string_ref + 5);
const auto printf_ptr = string_ref + 4 + 5 + offset;
OutputDebugString(utils::string::va("printf_ptr: %p\n", printf_ptr));
game::plutonium::printf.set(printf_ptr);
return true;
}
bool process()
{
load_function_tables();
return process_printf() && process_gsc_ctx();
}
}

View File

@ -0,0 +1,6 @@
#pragma once
namespace signatures
{
bool process();
}

46
src/component/string.cpp Normal file
View File

@ -0,0 +1,46 @@
#include <stdinc.hpp>
#include "loader/component_loader.hpp"
#include "gsc.hpp"
#include <utils/string.hpp>
namespace string
{
class component final : public component_interface
{
public:
void post_unpack() override
{
gsc::function::add("toupper", [](const gsc::function_args& args)
{
return utils::string::to_upper(args[0].as<std::string>());
});
gsc::function::add("getchar", [](const gsc::function_args& args)
{
auto index = 0;
if (args.size() > 1)
{
index = args[1].as<int>();
}
const auto string = args[0].as<std::string>();
if (index >= static_cast<int>(string.size()))
{
throw std::runtime_error("Char index out of bounds");
}
return static_cast<int>(string[index]);
});
gsc::function::add("chartostring", [](const gsc::function_args& args)
{
const auto char_ = static_cast<char>(args[0].as<int>());
return std::string(1, char_);
});
}
};
}
REGISTER_COMPONENT(string::component)

View File

@ -110,7 +110,7 @@ namespace userinfo
return {};
});
gsc::method::add("resetname", [](const game::scr_entref_t ent, const gsc::function_args& args) -> scripting::script_value
gsc::method::add("resetname", [](const game::scr_entref_t ent, const gsc::function_args&) -> scripting::script_value
{
if (ent.classnum != 0)
{
@ -150,7 +150,7 @@ namespace userinfo
return {};
});
gsc::method::add("resetclantag", [](const game::scr_entref_t ent, const gsc::function_args& args) -> scripting::script_value
gsc::method::add("resetclantag", [](const game::scr_entref_t ent, const gsc::function_args&) -> scripting::script_value
{
if (ent.classnum != 0)
{
@ -170,7 +170,7 @@ namespace userinfo
return {};
});
gsc::method::add("removeclantag", [](const game::scr_entref_t ent, const gsc::function_args& args) -> scripting::script_value
gsc::method::add("removeclantag", [](const game::scr_entref_t ent, const gsc::function_args&) -> scripting::script_value
{
if (ent.classnum != 0)
{

View File

@ -1,12 +1,13 @@
#include <stdinc.hpp>
#include "loader/component_loader.hpp"
BOOL APIENTRY DllMain(HMODULE hModule, DWORD ul_reason_for_call, LPVOID lpReserved)
#include "component/signatures.hpp"
BOOL APIENTRY DllMain(HMODULE /*hModule*/, DWORD ul_reason_for_call, LPVOID /*lpReserved*/)
{
if (ul_reason_for_call == DLL_PROCESS_ATTACH)
{
const auto value = *reinterpret_cast<DWORD*>(0x21600000);
if (value != 0x8A94852)
if (!signatures::process())
{
MessageBoxA(NULL,
"This version of iw5-gsc-utils is outdated.\n" \
@ -16,7 +17,11 @@ BOOL APIENTRY DllMain(HMODULE hModule, DWORD ul_reason_for_call, LPVOID lpReserv
return FALSE;
}
utils::hook::jump(reinterpret_cast<uintptr_t>(&printf), game::plutonium::printf);
if (game::plutonium::printf.get() != nullptr)
{
utils::hook::jump(reinterpret_cast<uintptr_t>(&printf), game::plutonium::printf);
}
component_loader::post_unpack();
}

View File

@ -16,6 +16,11 @@ namespace game
return dedi_;
}
void set(const size_t dedi)
{
this->dedi_ = reinterpret_cast<T*>(dedi);
}
operator T* () const
{
return this->get();

View File

@ -263,11 +263,9 @@ namespace scripting
}
}
void array::set(const std::string& key, const script_value& _value) const
void array::set(const std::string& key, const script_value& value_) const
{
const auto value = _value.get_raw();
const auto string_value = game::SL_GetString(key.data(), 0);
const auto value = value_.get_raw();
const auto variable_id = this->get_value_id(key);
if (!variable_id)
@ -284,9 +282,9 @@ namespace scripting
variable->u.u = value.u;
}
void array::set(const unsigned int index, const script_value& _value) const
void array::set(const unsigned int index, const script_value& value_) const
{
const auto value = _value.get_raw();
const auto value = value_.get_raw();
const auto variable_id = this->get_value_id(index);
if (!variable_id)

View File

@ -269,8 +269,6 @@ namespace scripting
{
return get_custom_field(entity, field);
}
return {};
}
unsigned int make_array()

File diff suppressed because it is too large Load Diff

View File

@ -7,51 +7,20 @@ namespace scripting
{
namespace
{
std::unordered_map<std::string, unsigned> lowercase_map(
const std::unordered_map<std::string, unsigned>& old_map)
{
std::unordered_map<std::string, unsigned> new_map{};
for (auto& entry : old_map)
{
new_map[utils::string::to_lower(entry.first)] = entry.second;
}
return new_map;
}
const std::unordered_map<std::string, unsigned>& get_methods()
{
static auto methods = lowercase_map(method_map);
return methods;
}
const std::unordered_map<std::string, unsigned>& get_functions()
{
static auto function = lowercase_map(function_map);
return function;
}
int find_function_index(const std::string& name, const bool prefer_global)
int find_function_index(const std::string& name, [[maybe_unused]] const bool prefer_global)
{
const auto target = utils::string::to_lower(name);
auto const& first = (*game::plutonium::gsc_ctx)->func_map();
auto const& second = (*game::plutonium::gsc_ctx)->meth_map();
const auto& primary_map = prefer_global
? get_functions()
: get_methods();
const auto& secondary_map = !prefer_global
? get_functions()
: get_methods();
auto function_entry = primary_map.find(target);
if (function_entry != primary_map.end())
if (const auto itr = first.find(name); itr != first.end())
{
return function_entry->second;
return static_cast<int>(itr->second);
}
function_entry = secondary_map.find(target);
if (function_entry != secondary_map.end())
if (const auto itr = second.find(name); itr != second.end())
{
return function_entry->second;
return static_cast<int>(itr->second);
}
return -1;
@ -73,33 +42,26 @@ namespace scripting
std::string find_token(unsigned int id)
{
for (const auto& token : token_map)
{
if (token.second == id)
{
return token.first;
}
}
return (*game::plutonium::gsc_ctx)->token_name(id);
}
return {};
std::string find_file(unsigned int id)
{
return find_token(id);
}
int find_token_id(const std::string& name)
{
const auto result = token_map.find(name);
if (result != token_map.end())
{
return result->second;
}
return -1;
return (*game::plutonium::gsc_ctx)->token_id(name);
}
script_function find_function(const std::string& name, const bool prefer_global)
{
const auto index = find_function_index(name, prefer_global);
if (index < 0) return nullptr;
if (index < 0)
{
return nullptr;
}
return get_function_by_index(index);
}

View File

@ -3,14 +3,10 @@
namespace scripting
{
extern std::unordered_map<std::string, unsigned> method_map;
extern std::unordered_map<std::string, unsigned> function_map;
extern std::unordered_map<std::string, unsigned> token_map;
extern std::unordered_map<unsigned, std::string> file_list;
using script_function = void(*)(game::scr_entref_t);
script_function find_function(const std::string& name, const bool prefer_global);
int find_token_id(const std::string& name);
std::string find_token(unsigned int id);
std::string find_file(unsigned int id);
}

View File

@ -86,11 +86,9 @@ namespace game
namespace plutonium
{
WEAK symbol<std::unordered_map<std::string, std::uint16_t>> function_map_rev{0x2074C520};
WEAK symbol<std::unordered_map<std::string, std::uint16_t>> method_map_rev{0x2074C540};
WEAK symbol<std::unordered_map<std::string, std::uint16_t>> token_map_rev{0x2074C580};
WEAK symbol<int(const char* fmt, ...)> printf{0x2093E120};
WEAK symbol<void*> function_table{0x206FAA70};
WEAK symbol<void*> method_table{0x206FB240};
WEAK symbol<std::unique_ptr<xsk::gsc::iw5_pc::context>> gsc_ctx{0};
WEAK symbol<int(const char* fmt, ...)> printf{0};
WEAK symbol<void*> function_table{0};
WEAK symbol<void*> method_table{0};
}
}

View File

@ -8,6 +8,8 @@
#pragma warning(disable: 4996)
#pragma warning(disable: 26812)
#include <xsk/gsc/engine/iw5_pc.hpp>
#define DLL_EXPORT extern "C" __declspec(dllexport)
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
@ -28,6 +30,7 @@
#include <map>
#include <csetjmp>
#include <atlcomcli.h>
#include <Psapi.h>
#pragma comment(lib, "urlmon.lib")
@ -36,6 +39,7 @@ using namespace std::literals;
#include <gsl/gsl>
#include <MinHook.h>
#include "utils/memory.hpp"
#include "utils/string.hpp"
#include "utils/hook.hpp"

View File

@ -4,6 +4,48 @@
namespace utils::hook
{
// open-iw5
void signature::process()
{
if (this->signatures_.empty()) return;
const auto start = static_cast<char*>(this->start_);
const unsigned int sig_count = this->signatures_.size();
const auto containers = this->signatures_.data();
for (size_t i = 0; i < this->length_; ++i)
{
const auto address = start + i;
for (unsigned int k = 0; k < sig_count; ++k)
{
const auto container = &containers[k];
unsigned int j;
for (j = 0; j < static_cast<unsigned int>(container->mask.size()); ++j)
{
if (container->mask[j] != '?' && container->signature[j] != address[j])
{
break;
}
}
if (j == container->mask.size())
{
container->callback(address);
}
}
}
}
void signature::add(const container& container)
{
signatures_.push_back(container);
}
namespace
{
[[maybe_unused]] class _

View File

@ -4,6 +4,37 @@
namespace utils::hook
{
class signature final
{
public:
struct container final
{
std::string signature;
std::string mask;
std::function<void(char*)> callback;
};
signature(void* start, const size_t length) : start_(start), length_(length)
{
}
signature(const DWORD start, const size_t length) : signature(reinterpret_cast<void*>(start), length)
{
}
signature() : signature(0x400000, 0x800000)
{
}
void process();
void add(const container& container);
private:
void* start_;
size_t length_;
std::vector<container> signatures_;
};
class detour
{
public:

View File

@ -1,8 +1,14 @@
#include <stdinc.hpp>
#include <fstream>
#include "io.hpp"
namespace utils::io
{
bool remove_file(const std::string& file)
{
return DeleteFileA(file.data()) == TRUE;
}
bool file_exists(const std::string& file)
{
return std::ifstream(file).good();

View File

@ -6,6 +6,7 @@
namespace utils::io
{
bool remove_file(const std::string& file);
bool file_exists(const std::string& file);
bool write_file(const std::string& file, const std::string& data, bool append = false);
bool read_file(const std::string& file, std::string* data);

BIN
tools/premake5.exe Normal file

Binary file not shown.

Binary file not shown.