Bump SourcePawn submodule (#2428)
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user