mirror of
https://github.com/Mr-X-GTA/YimMenu.git
synced 2026-10-11 09:48:03 +08:00
Add script patcher and update protections (#588)
This commit is contained in:
1 parent
4244ff8093
commit
e6ce363963
31 files changed
+610
-172
No files matched your search
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user