mirror of
https://github.com/alliedmodders/sourcemod.git
synced 2025-12-07 10:28:34 +00:00
Fix more sdktools crash on 64 bits (#2152)
* fix sdktools crash on 64 bits * remove other 32bit-isms from sdktools * Swap sizeof(intptr_t) for sizeof(void *) --------- Co-authored-by: Nick Hastings <nshastings@gmail.com>
This commit is contained in:
parent
b6d98c762c
commit
5edfa79543
@ -234,7 +234,7 @@ void CHookManager::OnClientConnected(int client)
|
||||
}
|
||||
}
|
||||
|
||||
int hookid = SH_ADD_VPHOOK(IClientMessageHandler, ProcessVoiceData, (IClientMessageHandler *)((intptr_t)(pClient) + 4), SH_MEMBER(this, &CHookManager::ProcessVoiceData), true);
|
||||
int hookid = SH_ADD_VPHOOK(IClientMessageHandler, ProcessVoiceData, (IClientMessageHandler *)((intptr_t)(pClient) + sizeof(void *)), SH_MEMBER(this, &CHookManager::ProcessVoiceData), true);
|
||||
hook.SetHookID(hookid);
|
||||
netProcessVoiceData.push_back(new CVTableHook(hook));
|
||||
}
|
||||
@ -584,7 +584,7 @@ bool CHookManager::SendFile(const char *filename, unsigned int transferID)
|
||||
#if !defined CLIENTVOICE_HOOK_SUPPORT
|
||||
bool CHookManager::ProcessVoiceData(CLC_VoiceData *msg)
|
||||
{
|
||||
IClient *pClient = (IClient *)((intptr_t)(META_IFACEPTR(IClient)) - 4);
|
||||
IClient *pClient = (IClient *)((intptr_t)(META_IFACEPTR(IClient)) - sizeof(void *));
|
||||
if (pClient == NULL)
|
||||
{
|
||||
return true;
|
||||
|
||||
@ -753,8 +753,8 @@ CEntityFactoryDictionary *GetEntityFactoryDictionary()
|
||||
int32_t funcOffset = *(int32_t *)((intptr_t)addr + offset);
|
||||
|
||||
// Get real address of function
|
||||
// Address of signature + offset of relative offset + sizeof(int32_t) offset + relative offset
|
||||
addr = (void *)((intptr_t)addr + offset + 4 + funcOffset);
|
||||
// Address of signature + offset of relative offset + pointer size + relative offset
|
||||
addr = (void *)((intptr_t)addr + offset + sizeof(void *) + funcOffset);
|
||||
}
|
||||
|
||||
pWrapper = g_pBinTools->CreateCall(addr, CallConv_Cdecl, &retData, NULL, 0);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user