From fcc8971d434d73c8d1c7858cd6ddbadf6309d632 Mon Sep 17 00:00:00 2001 From: momo5502 Date: Wed, 16 Jan 2019 23:00:42 +0100 Subject: [PATCH] Prepare stack unwind protection --- src/module/scripting.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/module/scripting.cpp b/src/module/scripting.cpp index 6472cad..2db605c 100644 --- a/src/module/scripting.cpp +++ b/src/module/scripting.cpp @@ -278,7 +278,18 @@ void scripting::call(const std::string& function, const unsigned int entity_id, const auto function_ptr = game::native::Scr_GetFunc(function_index); + /*static_assert(sizeof(jmp_buf) == 64); + ++*(DWORD*)0x20B21FC; + int res = setjmp(((jmp_buf*)0x20B4218)[*(DWORD*)0x20B21FC]); + if (res) + { + --*(DWORD*)0x20B21FC; + return; + }*/ + function_ptr(entity.val); + + //--*(DWORD*)0x20B21FC; } int scripting::find_function_index(const std::string& function)