mirror of
https://github.com/geode-sdk/geode.git
synced 2024-11-27 09:55:34 -05:00
34 lines
892 B
C++
34 lines
892 B
C++
#include <Geode/loader/Log.hpp>
|
|
#include <Geode/loader/Mod.hpp>
|
|
#include <Geode/loader/cgeode.h>
|
|
|
|
USE_GEODE_NAMESPACE();
|
|
|
|
std::string g_lastError = "";
|
|
|
|
void geode_mod_log(void* cmod, char const* message) {
|
|
auto mod = static_cast<Mod*>(cmod);
|
|
log::log(Severity::Debug, mod, "{}", message);
|
|
}
|
|
|
|
bool geode_mod_add_hook(void* cmod, void* address, void* detour) {
|
|
// auto mod = static_cast<Mod*>(cmod);
|
|
// auto res = mod->addHook(address, detour);
|
|
// if (!res) {
|
|
// g_lastError = res.error();
|
|
// return false;
|
|
// }
|
|
return true;
|
|
}
|
|
|
|
bool geode_get_last_error(char* buffer, size_t bufferSize) {
|
|
if (buffer && bufferSize >= g_lastError.size()) {
|
|
try {
|
|
std::copy(g_lastError.begin(), g_lastError.end(), buffer);
|
|
return true;
|
|
}
|
|
catch (...) {
|
|
}
|
|
}
|
|
return false;
|
|
}
|