Bump SourcePawn submodule (#2428)

This commit is contained in:
Benoist
2026-03-31 23:28:34 +02:00
committed by GitHub
parent b697537378
commit 59ecab555b
6 changed files with 71 additions and 9 deletions
+21 -4
View File
@@ -29,6 +29,8 @@
* Version: $Id$
*/
#include "bandaid.h"
#include "vhook.h"
#include "vfunc_call.h"
#include "util.h"
@@ -175,8 +177,16 @@ void *GenerateThunk(HookSetup* hook)
masm.pop(ebp); // restore ebp
masm.ret();
void *base = g_pSM->GetScriptingEngine()->AllocatePageMemory(masm.length());
masm.emitToExecutableMemory(base);
void* base = smutils->GetScriptingEngine()->AllocatePageMemory(masm.total_size());
DhookCodeChunk chunk((uint8_t*)base, masm.total_size());
// Can't let dtor call happen
LinkedCode* code = (LinkedCode*)new uint8_t[sizeof(LinkedCode)];
*((DhookCodeChunk*)&code->chunk) = chunk;
masm.emitToExecutableMemory(code);
delete[] (uint8_t*)code;
return base;
}
#else
@@ -215,8 +225,15 @@ void *GenerateThunk(HookSetup* hook)
masm.addl(esp, ecx); // remove arguments
masm.jmp(edx); // return to caller
void *base = g_pSM->GetScriptingEngine()->AllocatePageMemory(masm.length());
masm.emitToExecutableMemory(base);
void* base = smutils->GetScriptingEngine()->AllocatePageMemory(masm.total_size());
DhookCodeChunk chunk((uint8_t*)base, masm.total_size());
// Can't let dtor call happen
LinkedCode* code = (LinkedCode*)new uint8_t[sizeof(LinkedCode)];
*((DhookCodeChunk*)&code->chunk) = chunk;
masm.emitToExecutableMemory(code);
delete[] (uint8_t*)code;
return base;
}
#endif