Add script patcher and update protections (#588)

This commit is contained in:
maybegreat48 authored and GitHub committed 2022-11-12 18:35:28 +00:00
1 parent 4244ff8093
commit e6ce363963
31 files changed
+610 -172

No files matched your search

+10
View File
@@ -5,6 +5,8 @@
#include "pointers.hpp"
#include "script_hook.hpp"
#include "native_hooks/native_hooks.hpp"
namespace big
{
inline std::unordered_map<rage::scrProgram*, script_hook*> script_hook::s_map;
@@ -30,6 +32,12 @@ namespace big
ensure();
}
script_hook::script_hook(rage::scrProgram* program, std::unordered_map<rage::scrNativeHash, rage::scrNativeHandler> native_replacements) :
m_native_replacements(std::move(native_replacements))
{
hook_instance(program);
}
script_hook::~script_hook()
{
if (m_program)
@@ -101,6 +109,8 @@ namespace big
hook->m_vmt_hook->disable();
hook->m_vmt_hook.reset();
g_native_hooks->unhook_program(this_);
og_func(this_, free_memory);
}
}