Compare commits

..

No commits in common. "main" and "v1.3.5" have entirely different histories.
main ... v1.3.5

10 changed files with 21 additions and 37 deletions

2
deps/GSL vendored

@ -1 +1 @@
Subproject commit b39e7e4b0987859f5b19ff7686b149c916588658
Subproject commit e64c97fc2cfc11992098bb38eda932de275e3f4d

2
deps/json vendored

@ -1 +1 @@
Subproject commit 0457de21cffb298c22b629e538036bfeb96130b7
Subproject commit 3780b41dd070436f3f55327b0a88f27a52e2dfa8

2
deps/zlib vendored

@ -1 +1 @@
Subproject commit 5c42a230b7b468dff011f444161c0145b5efae59
Subproject commit 643e17b7498d12ab8d15565662880579692f769d

View File

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

View File

@ -35,18 +35,11 @@ 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;
}
});
@ -77,6 +70,7 @@ namespace signatures
}
const auto gsc_ctx_ptr = *reinterpret_cast<size_t*>(string_ref - 0xAD);
OutputDebugString(utils::string::va("string_ref: %p\n", string_ref));
OutputDebugString(utils::string::va("gsc_ctx_ptr: %p\n", gsc_ctx_ptr));
game::plutonium::gsc_ctx.set(gsc_ctx_ptr);
return true;