mirror of
https://github.com/alliedmodders/sourcemod.git
synced 2025-12-07 02:18:35 +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);
|
hook.SetHookID(hookid);
|
||||||
netProcessVoiceData.push_back(new CVTableHook(hook));
|
netProcessVoiceData.push_back(new CVTableHook(hook));
|
||||||
}
|
}
|
||||||
@ -584,7 +584,7 @@ bool CHookManager::SendFile(const char *filename, unsigned int transferID)
|
|||||||
#if !defined CLIENTVOICE_HOOK_SUPPORT
|
#if !defined CLIENTVOICE_HOOK_SUPPORT
|
||||||
bool CHookManager::ProcessVoiceData(CLC_VoiceData *msg)
|
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)
|
if (pClient == NULL)
|
||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
@ -753,8 +753,8 @@ CEntityFactoryDictionary *GetEntityFactoryDictionary()
|
|||||||
int32_t funcOffset = *(int32_t *)((intptr_t)addr + offset);
|
int32_t funcOffset = *(int32_t *)((intptr_t)addr + offset);
|
||||||
|
|
||||||
// Get real address of function
|
// Get real address of function
|
||||||
// Address of signature + offset of relative offset + sizeof(int32_t) offset + relative offset
|
// Address of signature + offset of relative offset + pointer size + relative offset
|
||||||
addr = (void *)((intptr_t)addr + offset + 4 + funcOffset);
|
addr = (void *)((intptr_t)addr + offset + sizeof(void *) + funcOffset);
|
||||||
}
|
}
|
||||||
|
|
||||||
pWrapper = g_pBinTools->CreateCall(addr, CallConv_Cdecl, &retData, NULL, 0);
|
pWrapper = g_pBinTools->CreateCall(addr, CallConv_Cdecl, &retData, NULL, 0);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user