This commit is contained in:
lenheart
2025-03-27 20:24:19 +08:00
parent 21f64fbd9e
commit f2992c2a86
214 changed files with 18814 additions and 316 deletions

View File

@@ -111,11 +111,24 @@ static SQInteger L_DeHookFunc(HSQUIRRELVM v)
static void example_listener_on_enter(GumInvocationListener *listener, GumInvocationContext *ic)
{
gpointer ReturnAddress = gum_invocation_context_get_return_address(ic);
ExampleListener *self = EXAMPLE_LISTENER(listener);
std::lock_guard<std::recursive_mutex> lock(SqMtx);
// 执行虚拟机Main函数
SQInteger top = sq_gettop(v); // saves the stack size before the call
sq_pushroottable(v);
sq_pushstring(v, _SC("_Haker_SetNextReturnAddress"), -1);
if (SQ_SUCCEEDED(sq_get(v, -2)))
{
sq_pushroottable(v);
sq_pushuserpointer(v, ReturnAddress);
sq_call(v, 2, SQFalse, SQTrue);
}
sq_settop(v, top);
sq_pushobject(v, self->CallBackOnEnter);
sq_pushroottable(v);
sq_newarray(v, 0);