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
+19 -4
View File
@@ -30,6 +30,7 @@
*
* Adopted to provide similar features to SourceHook by AlliedModders LLC.
*/
#include "bandaid.h"
// ============================================================================
// >> INCLUDES
@@ -642,8 +643,15 @@ void CHook::CreateBridge()
// This will still call post hooks, but will skip the original function.
masm.ret(m_pCallingConvention->GetPopSize());
void* base = smutils->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;
m_pBridge = base;
}
@@ -728,8 +736,15 @@ void CHook::CreatePostCallback()
masm.jmp(Operand(ExternalAddress(&pRetAddr)));
// Generate the code
void* base = smutils->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;
m_pNewRetAddr = base;
}