CUGCFileRequestManager::DeleteFileRequest
0x002231e0 · 436 bytes · __cdecl
_ZN22CUGCFileRequestManager17DeleteFileRequestEyb
Decompiled
undefined (2 params)
/* CUGCFileRequestManager::DeleteFileRequest(unsigned long long, bool) */
undefined4 CUGCFileRequestManager::DeleteFileRequest(ulonglong param_1,bool param_2)
{
uint *puVar1;
ushort uVar2;
void *pvVar3;
int iVar4;
undefined4 uVar5;
int in_GS_OFFSET;
undefined3 in_stack_0000000d;
char in_stack_00000010;
uint local_130;
uint local_12c;
char local_124 [260];
int local_20;
local_20 = *(int *)(in_GS_OFFSET + 0x14);
if (((param_1._4_4_ & _param_2) == 0xffffffff) ||
(pvVar3 = (void *)GetFileRequestByHandle(param_1), pvVar3 == (void *)0x0)) {
uVar5 = 0;
}
else {
if (0 < *(int *)((CUtlRBTree<CUtlMap<unsigned_long_long,UGCFileRequest_t_const*,unsigned_short>::Node_t,unsigned_short,CUtlMap<unsigned_long_long,UGCFileRequest_t_const*,unsigned_short>::CKeyLess,CUtlMemory<UtlRBTreeNode_t<CUtlMap<unsigned_long_long,UGCFileRequest_t_const*,unsigned_short>::Node_t,unsigned_short>,unsigned_short>>
*)param_1 + 0x28)) {
iVar4 = 0;
do {
puVar1 = *(uint **)(*(int *)((CUtlRBTree<CUtlMap<unsigned_long_long,UGCFileRequest_t_const*,unsigned_short>::Node_t,unsigned_short,CUtlMap<unsigned_long_long,UGCFileRequest_t_const*,unsigned_short>::CKeyLess,CUtlMemory<UtlRBTreeNode_t<CUtlMap<unsigned_long_long,UGCFileRequest_t_const*,unsigned_short>::Node_t,unsigned_short>,unsigned_short>>
*)param_1 + 0x1c) + iVar4 * 4);
if ((puVar1 != (uint *)0x0) && (_param_2 == puVar1[1] && *puVar1 == param_1._4_4_)) {
CUtlPriorityQueue<UGCFileRequest_t*,CDefUtlPriorityQueueLessFunc<UGCFileRequest_t*>,CUtlMemory<UGCFileRequest_t*,int>>
::RemoveAt((CUtlPriorityQueue<UGCFileRequest_t*,CDefUtlPriorityQueueLessFunc<UGCFileRequest_t*>,CUtlMemory<UGCFileRequest_t*,int>>
*)((CUtlRBTree<CUtlMap<unsigned_long_long,UGCFileRequest_t_const*,unsigned_short>::Node_t,unsigned_short,CUtlMap<unsigned_long_long,UGCFileRequest_t_const*,unsigned_short>::CKeyLess,CUtlMemory<UtlRBTreeNode_t<CUtlMap<unsigned_long_long,UGCFileRequest_t_const*,unsigned_short>::Node_t,unsigned_short>,unsigned_short>>
*)param_1 + 0x1c),iVar4);
break;
}
iVar4 = iVar4 + 1;
} while (iVar4 != *(int *)((CUtlRBTree<CUtlMap<unsigned_long_long,UGCFileRequest_t_const*,unsigned_short>::Node_t,unsigned_short,CUtlMap<unsigned_long_long,UGCFileRequest_t_const*,unsigned_short>::CKeyLess,CUtlMemory<UtlRBTreeNode_t<CUtlMap<unsigned_long_long,UGCFileRequest_t_const*,unsigned_short>::Node_t,unsigned_short>,unsigned_short>>
*)param_1 + 0x28));
}
local_130 = param_1._4_4_;
local_12c = _param_2;
uVar2 = CUtlRBTree<CUtlMap<unsigned_long_long,UGCFileRequest_t_const*,unsigned_short>::Node_t,unsigned_short,CUtlMap<unsigned_long_long,UGCFileRequest_t_const*,unsigned_short>::CKeyLess,CUtlMemory<UtlRBTreeNode_t<CUtlMap<unsigned_long_long,UGCFileRequest_t_const*,unsigned_short>::Node_t,unsigned_short>,unsigned_short>>
::Find((CUtlRBTree<CUtlMap<unsigned_long_long,UGCFileRequest_t_const*,unsigned_short>::Node_t,unsigned_short,CUtlMap<unsigned_long_long,UGCFileRequest_t_const*,unsigned_short>::CKeyLess,CUtlMemory<UtlRBTreeNode_t<CUtlMap<unsigned_long_long,UGCFileRequest_t_const*,unsigned_short>::Node_t,unsigned_short>,unsigned_short>>
*)param_1,(Node_t *)&local_130);
uVar5 = 0;
if (uVar2 != 0xffff) {
CUtlRBTree<CUtlMap<unsigned_long_long,UGCFileRequest_t_const*,unsigned_short>::Node_t,unsigned_short,CUtlMap<unsigned_long_long,UGCFileRequest_t_const*,unsigned_short>::CKeyLess,CUtlMemory<UtlRBTreeNode_t<CUtlMap<unsigned_long_long,UGCFileRequest_t_const*,unsigned_short>::Node_t,unsigned_short>,unsigned_short>>
::Unlink((CUtlRBTree<CUtlMap<unsigned_long_long,UGCFileRequest_t_const*,unsigned_short>::Node_t,unsigned_short,CUtlMap<unsigned_long_long,UGCFileRequest_t_const*,unsigned_short>::CKeyLess,CUtlMemory<UtlRBTreeNode_t<CUtlMap<unsigned_long_long,UGCFileRequest_t_const*,unsigned_short>::Node_t,unsigned_short>,unsigned_short>>
*)param_1,uVar2);
*(ushort *)
(*(int *)((CUtlRBTree<CUtlMap<unsigned_long_long,UGCFileRequest_t_const*,unsigned_short>::Node_t,unsigned_short,CUtlMap<unsigned_long_long,UGCFileRequest_t_const*,unsigned_short>::CKeyLess,CUtlMemory<UtlRBTreeNode_t<CUtlMap<unsigned_long_long,UGCFileRequest_t_const*,unsigned_short>::Node_t,unsigned_short>,unsigned_short>>
*)param_1 + 4) + (uint)uVar2 * 0x14) = uVar2;
*(undefined2 *)
(*(int *)((CUtlRBTree<CUtlMap<unsigned_long_long,UGCFileRequest_t_const*,unsigned_short>::Node_t,unsigned_short,CUtlMap<unsigned_long_long,UGCFileRequest_t_const*,unsigned_short>::CKeyLess,CUtlMemory<UtlRBTreeNode_t<CUtlMap<unsigned_long_long,UGCFileRequest_t_const*,unsigned_short>::Node_t,unsigned_short>,unsigned_short>>
*)param_1 + 4) + 2 + (uint)uVar2 * 0x14) =
*(undefined2 *)
((CUtlRBTree<CUtlMap<unsigned_long_long,UGCFileRequest_t_const*,unsigned_short>::Node_t,unsigned_short,CUtlMap<unsigned_long_long,UGCFileRequest_t_const*,unsigned_short>::CKeyLess,CUtlMemory<UtlRBTreeNode_t<CUtlMap<unsigned_long_long,UGCFileRequest_t_const*,unsigned_short>::Node_t,unsigned_short>,unsigned_short>>
*)param_1 + 0x14);
*(short *)((CUtlRBTree<CUtlMap<unsigned_long_long,UGCFileRequest_t_const*,unsigned_short>::Node_t,unsigned_short,CUtlMap<unsigned_long_long,UGCFileRequest_t_const*,unsigned_short>::CKeyLess,CUtlMemory<UtlRBTreeNode_t<CUtlMap<unsigned_long_long,UGCFileRequest_t_const*,unsigned_short>::Node_t,unsigned_short>,unsigned_short>>
*)param_1 + 0x12) =
*(short *)((CUtlRBTree<CUtlMap<unsigned_long_long,UGCFileRequest_t_const*,unsigned_short>::Node_t,unsigned_short,CUtlMap<unsigned_long_long,UGCFileRequest_t_const*,unsigned_short>::CKeyLess,CUtlMemory<UtlRBTreeNode_t<CUtlMap<unsigned_long_long,UGCFileRequest_t_const*,unsigned_short>::Node_t,unsigned_short>,unsigned_short>>
*)param_1 + 0x12) + -1;
*(ushort *)
((CUtlRBTree<CUtlMap<unsigned_long_long,UGCFileRequest_t_const*,unsigned_short>::Node_t,unsigned_short,CUtlMap<unsigned_long_long,UGCFileRequest_t_const*,unsigned_short>::CKeyLess,CUtlMemory<UtlRBTreeNode_t<CUtlMap<unsigned_long_long,UGCFileRequest_t_const*,unsigned_short>::Node_t,unsigned_short>,unsigned_short>>
*)param_1 + 0x14) = uVar2;
if (in_stack_00000010 != '\0') {
CUGCFileRequest::GetFullPath((CUGCFileRequest *)((int)pvVar3 + 0x328),local_124,0x104);
(**(code **)(*g_pFullFileSystem + 0x40))(g_pFullFileSystem,(short)local_124,0);
}
CUGCFileRequest::~CUGCFileRequest((CUGCFileRequest *)((int)pvVar3 + 0x328));
operator_delete(pvVar3);
uVar5 = 1;
}
}
if (local_20 != *(int *)(in_GS_OFFSET + 0x14)) {
/* WARNING: Subroutine does not return */
__stack_chk_fail();
}
return uVar5;
}
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.