CUtlCachedFileData<CModelSoundsCache>::SaveManifest
0x0061b810 · 850 bytes · __thiscall
_ZN18CUtlCachedFileDataI17CModelSoundsCacheE12SaveManifestEv
Decompiled
undefined (1 param)
/* CUtlCachedFileData<CModelSoundsCache>::SaveManifest() */
void __thiscall
CUtlCachedFileData<CModelSoundsCache>::SaveManifest(CUtlCachedFileData<CModelSoundsCache> *this)
{
uint uVar1;
char cVar2;
ushort uVar3;
char *pcVar4;
int iVar5;
int in_GS_OFFSET;
undefined4 local_47c;
uint local_478;
int local_474;
undefined4 local_470;
undefined4 local_46c;
int local_468;
int local_464;
undefined4 local_460;
char local_45c;
undefined4 local_458 [4];
undefined4 local_448;
char local_420 [512];
char local_220 [512];
int local_20;
local_20 = *(int *)(in_GS_OFFSET + 0x14);
CUtlBuffer::CUtlBuffer((CUtlBuffer *)local_458,0,0,1);
local_474 = 0;
local_470 = 0;
local_46c = 0;
local_468 = 0;
local_464 = 0;
local_460 = 0;
local_45c = '\0';
uVar3 = CUtlRBTree<CUtlCachedFileData<CModelSoundsCache>::ElementType_t,unsigned_short,bool(*)(CUtlCachedFileData<CModelSoundsCache>::ElementType_t_const&,CUtlCachedFileData<CModelSoundsCache>::ElementType_t_const&),CUtlMemory<UtlRBTreeNode_t<CUtlCachedFileData<CModelSoundsCache>::ElementType_t,unsigned_short>,unsigned_short>>
::FirstInorder((CUtlRBTree<CUtlCachedFileData<CModelSoundsCache>::ElementType_t,unsigned_short,bool(*)(CUtlCachedFileData<CModelSoundsCache>::ElementType_t_const&,CUtlCachedFileData<CModelSoundsCache>::ElementType_t_const&),CUtlMemory<UtlRBTreeNode_t<CUtlCachedFileData<CModelSoundsCache>::ElementType_t,unsigned_short>,unsigned_short>>
*)(this + 4));
uVar1 = local_478;
while (local_478 = (uint)uVar3, local_478 != 0xffff) {
local_47c = *(undefined4 *)(*(int *)(this + 8) + local_478 * 0x18 + 8);
/* try { // try from 0061b8db to 0061bb57 has its CatchHandler @ 0061bb62 */
CUtlSortVector<CSortedCacheFile,CSortedCacheFile>::InsertNoSort
((CUtlSortVector<CSortedCacheFile,CSortedCacheFile> *)&local_474,
(CSortedCacheFile *)&local_47c);
uVar3 = CUtlRBTree<CUtlCachedFileData<CModelSoundsCache>::ElementType_t,unsigned_short,bool(*)(CUtlCachedFileData<CModelSoundsCache>::ElementType_t_const&,CUtlCachedFileData<CModelSoundsCache>::ElementType_t_const&),CUtlMemory<UtlRBTreeNode_t<CUtlCachedFileData<CModelSoundsCache>::ElementType_t,unsigned_short>,unsigned_short>>
::NextInorder((CUtlRBTree<CUtlCachedFileData<CModelSoundsCache>::ElementType_t,unsigned_short,bool(*)(CUtlCachedFileData<CModelSoundsCache>::ElementType_t_const&,CUtlCachedFileData<CModelSoundsCache>::ElementType_t_const&),CUtlMemory<UtlRBTreeNode_t<CUtlCachedFileData<CModelSoundsCache>::ElementType_t,unsigned_short>,unsigned_short>>
*)(this + 4),uVar3);
uVar1 = local_478;
}
local_478 = uVar1;
if (local_45c != '\0') {
CUtlSortVector<CSortedCacheFile,CSortedCacheFile>::RedoSort(SUB41(&local_474,0));
}
iVar5 = 0;
if (0 < local_468) {
do {
(**(code **)(*g_pFullFileSystem + 0x98))
(g_pFullFileSystem,
*(int *)(this + 8) + 8 + (uint)*(ushort *)(local_474 + 4 + iVar5 * 8) * 0x18,
local_220,0x200);
CUtlBuffer::Printf((CUtlBuffer *)local_458,"\"%s\"\r\n",local_220);
iVar5 = iVar5 + 1;
} while (iVar5 < local_468);
}
pcVar4 = (char *)CUtlString::Get((CUtlString *)(this + 0x34));
V_strncpy(local_420,pcVar4,0x200);
V_StripFilename(local_420);
(**(code **)(*g_pFullFileSystem + 0x48))(g_pFullFileSystem,local_420,&DAT_00c146f4);
pcVar4 = (char *)CUtlString::Get((CUtlString *)(this + 0x34));
V_strncpy(local_220,pcVar4,0x200);
V_SetExtension(local_220,".manifest",0x200);
cVar2 = (**(code **)(g_pFullFileSystem[1] + 0x28))(g_pFullFileSystem + 1,local_220,&DAT_00c146f4);
if ((cVar2 != '\0') &&
(cVar2 = (**(code **)(g_pFullFileSystem[1] + 0x2c))
(g_pFullFileSystem + 1,local_220,&DAT_00c146f4), cVar2 == '\0')) {
(**(code **)(g_pFullFileSystem[1] + 0x30))(g_pFullFileSystem + 1,local_220,1,&DAT_00c146f4);
}
iVar5 = (**(code **)(g_pFullFileSystem[1] + 8))(g_pFullFileSystem + 1,local_220,&DAT_00c5cbad,0);
if (iVar5 == 0) {
Warning("Unable to persist cache manifest \'%s\', check file permissions\n",local_220);
}
else {
(**(code **)(g_pFullFileSystem[1] + 4))(g_pFullFileSystem + 1,local_458[0],local_448,iVar5);
(**(code **)(g_pFullFileSystem[1] + 0xc))(g_pFullFileSystem + 1,iVar5);
}
local_468 = 0;
CUtlMemory<CSortedCacheFile,int>::Purge((CUtlMemory<CSortedCacheFile,int> *)&local_474);
local_464 = local_474;
CUtlMemory<CSortedCacheFile,int>::Purge((CUtlMemory<CSortedCacheFile,int> *)&local_474);
CUtlMemory<unsigned_char,int>::Purge((CUtlMemory<unsigned_char,int> *)local_458);
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.