mirror of
https://github.com/fedddddd/iw5-gsc-utils.git
synced 2025-04-28 08:35:01 +00:00
Compare commits
52 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
1061c08829 | ||
|
c75cf561f7 | ||
|
3ea6050498 | ||
|
1551d7f1fd | ||
|
bf1d649bc1 | ||
|
71727a5197 | ||
|
530cd10466 | ||
|
978e251df8 | ||
|
cb96052638 | ||
|
9b217b20e3 | ||
|
136a723187 | ||
|
ad27dcb098 | ||
|
96acf0718e | ||
|
72f936e82a | ||
|
9a11ac82b3 | ||
|
8f36c271fd | ||
|
e952b8a0f7 | ||
|
f6d78fd815 | ||
|
cadcca22f9 | ||
|
c04a0a0d8c | ||
|
61706336ce | ||
|
eb08109392 | ||
|
b23cb2014b | ||
|
4d979bf659 | ||
|
206d06dc7d | ||
|
4d8af4bd45 | ||
|
46ab288488 | ||
|
dd8c1ff71e | ||
|
ed1ac62153 | ||
|
7f7fd016cf | ||
|
6c093888b5 | ||
|
1440760aa5 | ||
|
105c11a8b2 | ||
|
795f8ac162 | ||
|
6dd4d2651a | ||
|
b2f030f349 | ||
|
2690eeeece | ||
|
098bd21008 | ||
|
2f474e979f | ||
|
2ab4da0ad9 | ||
|
28c5594094 | ||
|
6525bbb8bf | ||
|
1a9e3dfb15 | ||
|
c62f1995e7 | ||
|
883e38ae58 | ||
|
1b2d4dbc46 | ||
|
7dfb35233e | ||
|
d842022056 | ||
|
0a8ebc3058 | ||
|
8ccae5ddec | ||
|
cfb143f0fd | ||
|
0281b5bef6 |
2
deps/GSL
vendored
2
deps/GSL
vendored
@ -1 +1 @@
|
||||
Subproject commit c31a9ad5e8e99da8567237a7ba51a7d8f419e5bf
|
||||
Subproject commit b39e7e4b0987859f5b19ff7686b149c916588658
|
2
deps/gsc-tool
vendored
2
deps/gsc-tool
vendored
@ -1 +1 @@
|
||||
Subproject commit a8a62c2667ca1c2643798a6c88e39a9e5a30df86
|
||||
Subproject commit 0e6238a6ab8643df6404f7c0280242df2812f6c8
|
2
deps/json
vendored
2
deps/json
vendored
@ -1 +1 @@
|
||||
Subproject commit e4643d1f1b03fc7a1d7b65f17e012ca93680cad8
|
||||
Subproject commit 0457de21cffb298c22b629e538036bfeb96130b7
|
2
deps/minhook
vendored
2
deps/minhook
vendored
@ -1 +1 @@
|
||||
Subproject commit 423d1e45af2ed2719a5c31e990e935ef301ed9c3
|
||||
Subproject commit f5485b8454544c2f034c78f8f127c1d03dea3636
|
2
deps/zlib
vendored
2
deps/zlib
vendored
@ -1 +1 @@
|
||||
Subproject commit 04f42ceca40f73e2978b50e93806c2a18c1281fc
|
||||
Subproject commit 5c42a230b7b468dff011f444161c0145b5efae59
|
@ -1,4 +1,3 @@
|
||||
@echo off
|
||||
call git submodule update --init --recursive
|
||||
tools\windows\premake5.exe vs2022
|
||||
pause
|
||||
tools\premake5.exe vs2022
|
||||
|
@ -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,21 @@ namespace gsc
|
||||
{
|
||||
void add(const std::string& name, const script_method& func)
|
||||
{
|
||||
try
|
||||
auto index = 0u;
|
||||
auto& ctx = (*game::plutonium::gsc_ctx);
|
||||
|
||||
if (ctx->meth_exists(name))
|
||||
{
|
||||
const auto index = method_map_start++;
|
||||
methods[index] = func;
|
||||
(*game::plutonium::gsc_ctx)->meth_add(name, index);
|
||||
printf("[iw5-gsc-utils] Warning: method '%s' already defined\n", name.data());
|
||||
index = ctx->meth_id(name);
|
||||
}
|
||||
catch (const std::exception& e)
|
||||
else
|
||||
{
|
||||
printf("[iw5-gsc-utils] failed to add method \"%s\": %s\n", name.data(), e.what());
|
||||
index = method_map_start++;
|
||||
ctx->meth_add(name, index);
|
||||
}
|
||||
|
||||
methods.insert(std::make_pair(index, func));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -35,11 +35,18 @@ namespace signatures
|
||||
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;
|
||||
}
|
||||
});
|
||||
@ -63,13 +70,14 @@ namespace signatures
|
||||
|
||||
bool process_gsc_ctx()
|
||||
{
|
||||
const auto string_ref = find_string_ref("in call to builtin %s");
|
||||
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 - 0xAD);
|
||||
OutputDebugString(utils::string::va("gsc_ctx_ptr: %p\n", gsc_ctx_ptr));
|
||||
game::plutonium::gsc_ctx.set(gsc_ctx_ptr);
|
||||
return true;
|
||||
}
|
||||
@ -83,7 +91,9 @@ namespace signatures
|
||||
}
|
||||
|
||||
const auto offset = *reinterpret_cast<size_t*>(string_ref + 5);
|
||||
game::plutonium::printf.set(string_ref + 4 + 5 + offset);
|
||||
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;
|
||||
}
|
||||
|
BIN
tools/premake5.exe
Normal file
BIN
tools/premake5.exe
Normal file
Binary file not shown.
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user