sdktools: permit symbol signatures on win32 (#1346)
* Fix sig scanner for windows * fix linux build * Update vcaller.cpp Co-authored-by: Kyle Sanderson <kyle.leet@gmail.com>
This commit is contained in:
parent
e0d9dfb68e
commit
c38b392fdf
@ -119,9 +119,15 @@ static cell_t PrepSDKCall_SetSignature(IPluginContext *pContext, const cell_t *p
|
||||
char *sig;
|
||||
pContext->LocalToString(params[2], &sig);
|
||||
|
||||
#if defined PLATFORM_POSIX
|
||||
if (sig[0] == '@')
|
||||
{
|
||||
#if defined PLATFORM_WINDOWS
|
||||
MEMORY_BASIC_INFORMATION mem;
|
||||
if (VirtualQuery(addrInBase, &mem, sizeof(mem)))
|
||||
{
|
||||
s_call_addr = memutils->ResolveSymbol(mem.AllocationBase, &sig[1]);
|
||||
}
|
||||
#elif defined PLATFORM_POSIX
|
||||
Dl_info info;
|
||||
if (dladdr(addrInBase, &info) == 0)
|
||||
{
|
||||
@ -132,6 +138,7 @@ static cell_t PrepSDKCall_SetSignature(IPluginContext *pContext, const cell_t *p
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
#if SOURCE_ENGINE == SE_CSS \
|
||||
|| SOURCE_ENGINE == SE_HL2DM \
|
||||
|| SOURCE_ENGINE == SE_DODS \
|
||||
@ -148,12 +155,13 @@ static cell_t PrepSDKCall_SetSignature(IPluginContext *pContext, const cell_t *p
|
||||
s_call_addr = memutils->ResolveSymbol(handle, &sig[1]);
|
||||
#else
|
||||
s_call_addr = dlsym(handle, &sig[1]);
|
||||
#endif
|
||||
#endif /* SOURCE_ENGINE */
|
||||
|
||||
dlclose(handle);
|
||||
#endif
|
||||
|
||||
return (s_call_addr != NULL) ? 1 : 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
s_call_addr = memutils->FindPattern(addrInBase, sig, params[3]);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user