add mysql + update build

This commit is contained in:
alice
2025-08-11 17:52:46 +02:00
parent 589c5b5a48
commit 459ecf1695
28 changed files with 1242 additions and 171 deletions
+23
View File
@@ -6,8 +6,30 @@
#include "game/game.hpp"
#include <utils/hook.hpp>
#include <utils/binary_resource.hpp>
#include <utils/nt.hpp>
namespace
{
utils::hook::detour load_library_hook;
HMODULE __stdcall load_library_stub(LPCSTR lib_name, HANDLE file, DWORD flags)
{
if (lib_name == "libmysql.dll"s)
{
static auto dll = utils::binary_resource{LIBMYSQL_DLL, lib_name};
const auto path = dll.get_extracted_file();
const auto handle = load_library_hook.invoke_pascal<HMODULE>(path.data(), file, flags);
if (handle != nullptr)
{
return handle;
}
}
return load_library_hook.invoke_pascal<HMODULE>(lib_name, file, flags);
}
}
PLUTONIUM_API plutonium::sdk::plugin* PLUTONIUM_CALLBACK on_initialize()
{
return plugin::get();
@@ -18,6 +40,7 @@ BOOL APIENTRY DllMain(HMODULE module, DWORD ul_reason_for_call, LPVOID /*reserve
if (ul_reason_for_call == DLL_PROCESS_ATTACH)
{
utils::nt::library::set_current_handle(module);
load_library_hook.create(LoadLibraryExA, load_library_stub);
}
if (ul_reason_for_call == DLL_PROCESS_DETACH)