111
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user