mirror of
https://github.com/fedddddd/iw5-gsc-utils.git
synced 2025-07-03 09:41:51 +00:00
Compare commits
12 Commits
v1.3.5
...
dependabot
Author | SHA1 | Date | |
---|---|---|---|
5f45acb202 | |||
1061c08829 | |||
c75cf561f7 | |||
3ea6050498 | |||
1551d7f1fd | |||
bf1d649bc1 | |||
71727a5197 | |||
530cd10466 | |||
978e251df8 | |||
cb96052638 | |||
9b217b20e3 | |||
136a723187 |
2
deps/GSL
vendored
2
deps/GSL
vendored
Submodule deps/GSL updated: e64c97fc2c...b39e7e4b09
2
deps/json
vendored
2
deps/json
vendored
Submodule deps/json updated: 3780b41dd0...0457de21cf
2
deps/minhook
vendored
2
deps/minhook
vendored
Submodule deps/minhook updated: f5485b8454...1cc46107ee
2
deps/zlib
vendored
2
deps/zlib
vendored
Submodule deps/zlib updated: 643e17b749...5c42a230b7
@ -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;
|
||||
}
|
||||
});
|
||||
@ -70,7 +77,6 @@ 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;
|
||||
|
Reference in New Issue
Block a user