This commit is contained in:
alice
2025-12-03 05:45:25 +01:00
parent 54226a0e56
commit 8d4fa65e3b
16 changed files with 163 additions and 45 deletions

View File

@@ -270,6 +270,11 @@ namespace gsc
{
void add(const std::string& name, const script_method& func)
{
if (true)
{
return;
}
auto index = 0u;
auto& ctx = (*game::plutonium::gsc_ctx);

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,7 +34,7 @@ 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,
@@ -70,37 +70,23 @@ namespace signatures
bool process_gsc_ctx()
{
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 - 0xAD);
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);
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();
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)