CUGCFileRequestManager::CreateFileUploadRequest
0x00222c60 · 632 bytes · __thiscall
_ZN22CUGCFileRequestManager23CreateFileUploadRequestEPKcS1_S1_j
Decompiled
undefined (5 params)
/* CUGCFileRequestManager::CreateFileUploadRequest(char const*, char const*, char const*, unsigned
int) */
undefined4 __thiscall
CUGCFileRequestManager::CreateFileUploadRequest
(CUGCFileRequestManager *this,char *param_1,char *param_2,char *param_3,uint param_4)
{
int iVar1;
UGCFileRequest_t *pUVar2;
undefined4 uVar3;
int in_GS_OFFSET;
bool bVar4;
UGCFileRequest_t *local_128;
char local_124 [260];
int local_20;
local_20 = *(int *)(in_GS_OFFSET + 0x14);
if (param_1 == (char *)0x0) {
uVar3 = 0;
}
else {
V_SafeComposeFilename(param_2,param_3,local_124,0x104);
iVar1 = GetFileRequestByFilename(this,local_124);
if ((iVar1 == 0) || (*(int *)(iVar1 + 0x314) != 1)) {
pUVar2 = operator_new(0x8cc);
*(undefined4 *)pUVar2 = 0xffffffff;
*(undefined4 *)(pUVar2 + 4) = 0xffffffff;
*(undefined4 *)(pUVar2 + 0x314) = 0xffffffff;
*(undefined4 *)(pUVar2 + 0x318) = 0;
pUVar2[0x31c] = (UGCFileRequest_t)0x0;
*(undefined4 *)(pUVar2 + 800) = 0;
*(undefined4 *)(pUVar2 + 0x324) = 0;
/* try { // try from 00222d1d to 00222d21 has its CatchHandler @ 00222ee9 */
CUGCFileRequest::CUGCFileRequest((CUGCFileRequest *)(pUVar2 + 0x328));
pUVar2[0x10c] = (UGCFileRequest_t)0x0;
pUVar2[0x210] = (UGCFileRequest_t)0x0;
pUVar2[8] = (UGCFileRequest_t)0x0;
*(undefined4 *)(pUVar2 + 0x314) = 1;
*(undefined4 *)pUVar2 = 0xffffffff;
*(undefined4 *)(pUVar2 + 4) = 0xffffffff;
local_128 = pUVar2;
if (param_2 != (char *)0x0) {
V_strncpy((char *)(pUVar2 + 0x210),param_2,0x104);
V_FixSlashes((char *)(local_128 + 0x210),'/');
}
if (param_3 != (char *)0x0) {
V_strncpy((char *)(local_128 + 0x10c),param_3,0x104);
}
V_strncpy((char *)(local_128 + 8),param_1,0x104);
V_FixSlashes((char *)(local_128 + 8),'/');
*(undefined4 *)(local_128 + 0x318) = 0;
*(uint *)(local_128 + 0x324) = g_TimeStampIncr;
local_128[0x31c] = (UGCFileRequest_t)0x0;
bVar4 = 0xfffffffe < g_TimeStampIncr;
g_TimeStampIncr = g_TimeStampIncr + 1;
DAT_003ef494 = DAT_003ef494 + (uint)bVar4;
*(uint *)(local_128 + 800) = param_4;
CUtlPriorityQueue<UGCFileRequest_t*,CDefUtlPriorityQueueLessFunc<UGCFileRequest_t*>,CUtlMemory<UGCFileRequest_t*,int>>
::Insert((CUtlPriorityQueue<UGCFileRequest_t*,CDefUtlPriorityQueueLessFunc<UGCFileRequest_t*>,CUtlMemory<UGCFileRequest_t*,int>>
*)(this + 0x1c),&local_128);
uVar3 = LoggingSystem_IsChannelEnabled(LOG_WORKSHOP,0);
if ((char)uVar3 != '\0') {
LoggingSystem_Log(LOG_WORKSHOP,0,
"[CUGCFileRequestManager] Inserted Upload: %llu\tPriority:%u\tTimestamp:%u\n"
,*(undefined4 *)local_128,*(undefined4 *)(local_128 + 4),
*(undefined4 *)(local_128 + 800),*(undefined4 *)(local_128 + 0x324));
goto LAB_00222e70;
}
}
uVar3 = 1;
}
LAB_00222e70:
if (local_20 == *(int *)(in_GS_OFFSET + 0x14)) {
return uVar3;
}
/* 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.