DownloadCache::GetCachedData
0x0013c8d0 · 389 bytes · __thiscall
_ZN13DownloadCache13GetCachedDataEP14RequestContext
Decompiled
undefined (2 params)
/* DownloadCache::GetCachedData(RequestContext*) */
void __thiscall DownloadCache::GetCachedData(DownloadCache *this,RequestContext *param_1)
{
int iVar1;
uint uVar2;
void *pvVar3;
int iVar4;
char *__src;
int in_GS_OFFSET;
char local_1020 [4096];
int local_20;
local_20 = *(int *)(in_GS_OFFSET + 0x14);
if (*(int *)this != 0) {
GetCacheFilename(this,param_1,local_1020);
if (local_1020[0] != '\0') {
iVar1 = (**(code **)(*(int *)(g_pFileSystem + 4) + 8))
(g_pFileSystem + 4,local_1020,&DAT_002a3e98,0);
if (iVar1 != 0) {
uVar2 = (**(code **)(*(int *)(g_pFileSystem + 4) + 0x18))(g_pFileSystem + 4,iVar1);
pvVar3 = operator_new__(uVar2);
iVar4 = g_pFileSystem;
*(void **)(param_1 + 0x524) = pvVar3;
iVar4 = (*(code *)**(undefined4 **)(iVar4 + 4))(iVar4 + 4,pvVar3,uVar2,iVar1);
(**(code **)(*(int *)(g_pFileSystem + 4) + 0xc))(g_pFileSystem + 4,iVar1);
if (iVar4 == 0) {
if (*(void **)(param_1 + 0x524) != (void *)0x0) {
operator_delete__(*(void **)(param_1 + 0x524));
}
*(undefined4 *)(param_1 + 0x524) = 0;
}
else {
BuildKeyNames(this,(char *)(param_1 + 0x214));
*(uint *)(param_1 + 0x51c) = uVar2;
__src = (char *)KeyValues::GetString(*(KeyValues **)this,(char *)(this + 0x144),"");
strncpy((char *)(param_1 + 0x414),__src,0x100);
}
}
}
}
if (local_20 == *(int *)(in_GS_OFFSET + 0x14)) {
return;
}
/* WARNING: Subroutine does not return */
__stack_chk_fail();
}
SourceMod gamedata
paste intoaddons/sourcemod/gamedata/<your_plugin>.txt
used as the SourceMod key — change to fit your plugin's convention
SourceMod library name (server / engine / matchmaking)
Just a Signatures{} block, ready to drop into a gamedata
file. Wire it up in your plugin however you like - SDKCall, DHooks,
raw memory ops, or anything else.
Signatures + Functions block. The plugin uses
DHookCreateFromConf - DHooks reads return type, this-type,
calling convention, and argument types straight from the gamedata. Less
boilerplate in the plugin, types travel with the gamedata.
Gamedata KeyValues
DHooks plugin example
Type inference is best-effort from the C signature - sanity-check the DHooks types before shipping.