#pragma once #include "common.hpp" #include "gta/fwddec.hpp" #include "gta/joaat.hpp" #include "gta/natives.hpp" #include "vmt_hook.hpp" namespace big { class script_hook { public: explicit script_hook(rage::joaat_t script_hash, std::unordered_map native_replacements); ~script_hook(); void ensure(); private: void hook_instance(rage::scrProgram *program); static void scrprogram_dtor(rage::scrProgram *this_, bool free_memory); static std::unordered_map s_map; rage::joaat_t m_script_hash; rage::scrProgram* m_program; std::unique_ptr m_vmt_hook; std::unordered_map m_native_replacements; std::unordered_map m_native_handler_ptrs; }; }