Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix more sdktools crash on 64 bits #2152

Merged
merged 3 commits into from
Jun 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions extensions/sdktools/hooks.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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));
}
Expand Down Expand Up @@ -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;
Expand Down
4 changes: 2 additions & 2 deletions extensions/sdktools/vhelpers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down