diff --git a/extensions/sdktools/vcaller.cpp b/extensions/sdktools/vcaller.cpp index 2b5b16b9..f823ee40 100644 --- a/extensions/sdktools/vcaller.cpp +++ b/extensions/sdktools/vcaller.cpp @@ -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]);