56 Commits

Author SHA1 Message Date
alice
b2bd1e0835 Update build.yml 2025-12-03 05:49:19 +01:00
alice
e2a5d96e10 update 2 2025-12-03 05:47:55 +01:00
alice
8d4fa65e3b update 2025-12-03 05:45:25 +01:00
alice
54226a0e56 Update gsc-tool 2025-12-03 04:26:17 +01:00
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
26 changed files with 204 additions and 66 deletions

View File

@@ -19,14 +19,14 @@ jobs:
- Release
steps:
- name: Check out files
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
submodules: true
fetch-depth: 0
lfs: false
- name: Add msbuild to PATH
uses: microsoft/setup-msbuild@v1.1.3
uses: microsoft/setup-msbuild@v2
- name: Generate project files
run: tools/premake5 vs2022
@@ -38,7 +38,7 @@ jobs:
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
uses: actions/upload-artifact@v4
with:
name: ${{matrix.configuration}} binaries
path: |

3
.gitmodules vendored
View File

@@ -14,3 +14,6 @@
[submodule "deps/zlib"]
path = deps/zlib
url = https://github.com/madler/zlib.git
[submodule "deps/plutonium-sdk"]
path = deps/plutonium-sdk
url = https://github.com/plutoniummod/plutonium-sdk.git

2
deps/GSL vendored

Submodule deps/GSL updated: c31a9ad5e8...b39e7e4b09

2
deps/gsc-tool vendored

2
deps/json vendored

Submodule deps/json updated: e4643d1f1b...0457de21cf

2
deps/minhook vendored

1
deps/plutonium-sdk vendored Submodule

Submodule deps/plutonium-sdk added at 17e9a0a4d5

18
deps/premake/plutonium-sdk.lua vendored Normal file
View File

@@ -0,0 +1,18 @@
plutonium_sdk = {
source = path.join(dependencies.basePath, "plutonium-sdk"),
}
function plutonium_sdk.import()
plutonium_sdk.includes()
end
function plutonium_sdk.includes()
includedirs {
plutonium_sdk.source,
}
end
function plutonium_sdk.project()
end
table.insert(dependencies, plutonium_sdk)

2
deps/zlib vendored

Submodule deps/zlib updated: 04f42ceca4...5c42a230b7

View File

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

View File

@@ -248,16 +248,21 @@ namespace gsc
{
void add(const std::string& name, const script_function& func)
{
try
auto index = 0u;
auto& ctx = (*game::plutonium::gsc_ctx);
if (ctx->func_exists(name))
{
const auto index = function_map_start++;
functions[index] = func;
(*game::plutonium::gsc_ctx)->func_add(name, index);
printf("[iw5-gsc-utils] Warning: function '%s' already defined\n", name.data());
index = ctx->func_id(name);
}
catch (const std::exception& e)
else
{
printf("[iw5-gsc-utils] failed to add function \"%s\": %s\n", name.data(), e.what());
index = function_map_start++;
ctx->func_add(name, index);
}
functions.insert(std::make_pair(index, func));
}
}
@@ -265,16 +270,26 @@ namespace gsc
{
void add(const std::string& name, const script_method& func)
{
try
if (true)
{
const auto index = method_map_start++;
methods[index] = func;
(*game::plutonium::gsc_ctx)->meth_add(name, index);
return;
}
catch (const std::exception& e)
auto index = 0u;
auto& ctx = (*game::plutonium::gsc_ctx);
if (ctx->meth_exists(name))
{
printf("[iw5-gsc-utils] failed to add method \"%s\": %s\n", name.data(), e.what());
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));
}
}

View File

@@ -179,4 +179,4 @@ namespace io
};
}
REGISTER_COMPONENT(io::component)
//REGISTER_COMPONENT(io::component)

View File

@@ -194,4 +194,4 @@ namespace json
};
}
REGISTER_COMPONENT(json::component)
//REGISTER_COMPONENT(json::component)

View File

@@ -71,4 +71,4 @@ namespace notifies
};
}
REGISTER_COMPONENT(notifies::component)
//REGISTER_COMPONENT(notifies::component)

View File

@@ -144,4 +144,4 @@ namespace scheduler
};
}
REGISTER_COMPONENT(scheduler::component)
//REGISTER_COMPONENT(scheduler::component)

View File

@@ -136,4 +136,4 @@ namespace scripting
};
}
REGISTER_COMPONENT(scripting::component)
//REGISTER_COMPONENT(scripting::component)

View File

@@ -34,12 +34,19 @@ namespace signatures
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);
OutputDebugString(utils::string::va("%p %p\n", base, get_image_size()));
auto found = false;
signature.add({
string,
mask,
[&](char* address)
{
if (found)
{
return;
}
found = true;
string_ptr = address;
}
});
@@ -63,34 +70,23 @@ namespace signatures
bool process_gsc_ctx()
{
const auto string_ref = find_string_ref("in call to builtin %s");
OutputDebugString("HELLOOO");
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 - 0x8C);
const auto gsc_ctx_ptr = *reinterpret_cast<size_t*>(string_ref + 215);
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);
game::plutonium::printf.set(string_ref + 4 + 5 + offset);
return true;
}
bool process()
{
load_function_tables();
return process_printf() && process_gsc_ctx();
return process_gsc_ctx();
}
}

View File

@@ -43,4 +43,4 @@ namespace string
};
}
REGISTER_COMPONENT(string::component)
//REGISTER_COMPONENT(string::component)

View File

@@ -193,4 +193,4 @@ namespace userinfo
};
}
REGISTER_COMPONENT(userinfo::component)
//REGISTER_COMPONENT(userinfo::component)

View File

@@ -1,28 +1,23 @@
#include <stdinc.hpp>
#include "loader/component_loader.hpp"
#include "component/signatures.hpp"
#include "plugin.hpp"
PLUTONIUM_API plutonium::sdk::plugin* PLUTONIUM_CALLBACK on_initialize()
{
return plugin::get();
}
BOOL APIENTRY DllMain(HMODULE /*hModule*/, DWORD ul_reason_for_call, LPVOID /*lpReserved*/)
{
if (ul_reason_for_call == DLL_PROCESS_ATTACH)
{
if (!signatures::process())
{
MessageBoxA(NULL,
"This version of iw5-gsc-utils is outdated.\n" \
"Download the latest dll from here: https://github.com/fedddddd/iw5-gsc-utils/releases",
"ERROR", MB_ICONERROR);
return FALSE;
}
}
if (game::plutonium::printf.get() != nullptr)
{
utils::hook::jump(reinterpret_cast<uintptr_t>(&printf), game::plutonium::printf);
}
component_loader::post_unpack();
if (ul_reason_for_call == DLL_PROCESS_DETACH)
{
component_loader::pre_destroy();
}
return TRUE;

View File

@@ -212,8 +212,6 @@ namespace scripting
{
return this->get(key.as<std::string>());
}
return {};
}
script_value array::get(const std::string& key) const

View File

@@ -87,7 +87,6 @@ namespace game
namespace plutonium
{
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};
}

84
src/plugin.cpp Normal file
View File

@@ -0,0 +1,84 @@
#include <stdinc.hpp>
#include "loader/component_loader.hpp"
#include "plugin.hpp"
#include "component/signatures.hpp"
#include <utils/hook.hpp>
#include <utils/string.hpp>
namespace plugin
{
namespace
{
void printf_stub(const char* fmt, ...)
{
char buffer[0x2000] = {};
va_list ap;
va_start(ap, fmt);
vsnprintf_s(buffer, sizeof(buffer), _TRUNCATE, fmt, ap);
va_end(ap);
get()->get_interface()->logging()->info(buffer);
}
}
std::uint32_t plugin::plugin_version()
{
return 1;
}
const char* plugin::plugin_name()
{
return "iw5-gsc-utils";
}
bool plugin::is_game_supported([[maybe_unused]] plutonium::sdk::game game)
{
return game == plutonium::sdk::game::iw5;
}
void plugin::on_startup(plutonium::sdk::iinterface* interface_ptr, plutonium::sdk::game game)
{
this->interface_ = interface_ptr;
this->game_ = game;
utils::hook::jump(reinterpret_cast<uintptr_t>(&printf), printf_stub);
if (!signatures::process())
{
MessageBoxA(NULL,
"This version of iw5-gsc-utils is outdated.\n" \
"Download the latest dll from here: https://github.com/alicealys/iw5-gsc-utils/releases",
"ERROR", MB_ICONERROR);
}
else
{
component_loader::post_unpack();
}
}
void plugin::on_shutdown()
{
component_loader::pre_destroy();
}
plutonium::sdk::iinterface* plugin::get_interface()
{
return this->interface_;
}
plutonium::sdk::game plugin::get_game()
{
return this->game_;
}
plugin* get()
{
static plugin instance;
return &instance;
}
}

30
src/plugin.hpp Normal file
View File

@@ -0,0 +1,30 @@
#pragma once
#include <plutonium_sdk.hpp>
namespace plugin
{
class plugin : public plutonium::sdk::plugin
{
public:
~plugin() = default;
std::uint32_t plugin_version() override;
const char* plugin_name() override;
bool is_game_supported([[maybe_unused]] plutonium::sdk::game game) override;
void on_startup(plutonium::sdk::iinterface* interface_ptr, plutonium::sdk::game game) override;
void on_shutdown() override;
plutonium::sdk::iinterface* get_interface();
plutonium::sdk::game get_game();
private:
plutonium::sdk::iinterface* interface_{};
plutonium::sdk::game game_{};
};
plugin* get();
}

BIN
tools/premake5.exe Normal file

Binary file not shown.

Binary file not shown.