CWin32UploadGameStats::SendUploadCommand
0x002132a0 · 1183 bytes · __thiscall
_ZN21CWin32UploadGameStats17SendUploadCommandER22EGameStatsUploadStatusR10CUtlBuffer
Decompiled
undefined (3 params)
/* CWin32UploadGameStats::SendUploadCommand(EGameStatsUploadStatus&, CUtlBuffer&) */
bool __thiscall
CWin32UploadGameStats::SendUploadCommand
(CWin32UploadGameStats *this,EGameStatsUploadStatus *param_1,CUtlBuffer *param_2)
{
undefined4 uVar1;
char cVar2;
ssize_t sVar3;
void *pvVar4;
int iVar5;
undefined1 local_28;
undefined1 uStack_27;
undefined1 uStack_26;
undefined1 uStack_25;
undefined1 local_24;
undefined1 uStack_23;
undefined1 uStack_22;
undefined1 uStack_21;
undefined1 local_20;
undefined1 local_1f;
undefined1 local_1e;
undefined1 local_1d;
UpdateProgress(*(TGameStatsParameters **)(this + 0x2c),
"Sending harvesting protocol upload request.");
*(undefined4 *)(param_2 + 0xc) = 0;
*(undefined4 *)(param_2 + 0x10) = 0;
*(undefined4 *)(param_2 + 0x20) = 0;
*(undefined4 *)(param_2 + 0x1c) = 0;
param_2[0x14] = (CUtlBuffer)0x0;
CUtlMemory<unsigned_char,int>::Purge((CUtlMemory<unsigned_char,int> *)param_2);
if (((byte)param_2[0x15] & 1) == 0) {
cVar2 = CUtlBuffer::CheckPut(param_2,4);
if (cVar2 != '\0') {
if (((byte)param_2[0x34] & 1) == 0) {
*(undefined4 *)(*(int *)param_2 + (*(int *)(param_2 + 0x10) - *(int *)(param_2 + 0x20))) =
0x11;
iVar5 = *(int *)(param_2 + 0x10);
}
else {
iVar5 = *(int *)(param_2 + 0x10);
pvVar4 = (void *)((iVar5 - *(int *)(param_2 + 0x20)) + *(int *)param_2);
if (pvVar4 != (void *)0x0) {
local_20 = 0;
local_1f = 0;
local_1e = 0;
local_1d = 0x11;
_V_memcpy(pvVar4,&local_20,4);
iVar5 = *(int *)(param_2 + 0x10);
}
}
*(int *)(param_2 + 0x10) = iVar5 + 4;
CUtlBuffer::AddNullTermination(param_2);
}
}
else {
CUtlBuffer::Printf(param_2,"%d",0x11);
}
if (((((byte)param_2[0x15] & 1) != 0) && (*(int *)(param_2 + 0x10) != 0)) &&
(*(char *)(*(int *)param_2 + ((*(int *)(param_2 + 0x10) + -1) - *(int *)(param_2 + 0x20))) ==
'\n')) {
if (((byte)param_2[0x15] & 0x10) == 0) {
iVar5 = *(int *)(param_2 + 0x18);
}
else {
iVar5 = 0;
}
while (iVar5 = iVar5 + -1, -1 < iVar5) {
cVar2 = CUtlBuffer::CheckPut(param_2,1);
if (cVar2 != '\0') {
*(undefined1 *)(*(int *)param_2 + (*(int *)(param_2 + 0x10) - *(int *)(param_2 + 0x20))) = 9
;
*(int *)(param_2 + 0x10) = *(int *)(param_2 + 0x10) + 1;
CUtlBuffer::AddNullTermination(param_2);
}
}
}
cVar2 = CUtlBuffer::CheckPut(param_2,1);
if (cVar2 != '\0') {
*(undefined1 *)(*(int *)param_2 + (*(int *)(param_2 + 0x10) - *(int *)(param_2 + 0x20))) = 1;
*(int *)(param_2 + 0x10) = *(int *)(param_2 + 0x10) + 1;
CUtlBuffer::AddNullTermination(param_2);
}
uVar1 = *(undefined4 *)(this + 0x30);
if (((byte)param_2[0x15] & 1) == 0) {
cVar2 = CUtlBuffer::CheckPut(param_2,4);
if (cVar2 != '\0') {
if (((byte)param_2[0x34] & 1) == 0) {
*(undefined4 *)(*(int *)param_2 + (*(int *)(param_2 + 0x10) - *(int *)(param_2 + 0x20))) =
uVar1;
iVar5 = *(int *)(param_2 + 0x10);
}
else {
iVar5 = *(int *)(param_2 + 0x10);
pvVar4 = (void *)((iVar5 - *(int *)(param_2 + 0x20)) + *(int *)param_2);
if (pvVar4 != (void *)0x0) {
uStack_25 = (undefined1)((uint)uVar1 >> 0x18);
local_20 = uStack_25;
uStack_26 = (undefined1)((uint)uVar1 >> 0x10);
local_1f = uStack_26;
uStack_27 = (undefined1)((uint)uVar1 >> 8);
local_1e = uStack_27;
local_28 = (undefined1)uVar1;
local_1d = local_28;
_V_memcpy(pvVar4,&local_20,4);
iVar5 = *(int *)(param_2 + 0x10);
}
}
*(int *)(param_2 + 0x10) = iVar5 + 4;
CUtlBuffer::AddNullTermination(param_2);
}
}
else {
CUtlBuffer::Printf(param_2,"%d",uVar1);
}
uVar1 = *(undefined4 *)(*(int *)(this + 0x2c) + 0xd4);
if (((byte)param_2[0x15] & 1) == 0) {
cVar2 = CUtlBuffer::CheckPut(param_2,4);
if (cVar2 != '\0') {
if (((byte)param_2[0x34] & 1) == 0) {
*(undefined4 *)(*(int *)param_2 + (*(int *)(param_2 + 0x10) - *(int *)(param_2 + 0x20))) =
uVar1;
iVar5 = *(int *)(param_2 + 0x10);
}
else {
iVar5 = *(int *)(param_2 + 0x10);
pvVar4 = (void *)((iVar5 - *(int *)(param_2 + 0x20)) + *(int *)param_2);
if (pvVar4 != (void *)0x0) {
uStack_21 = (undefined1)((uint)uVar1 >> 0x18);
local_20 = uStack_21;
uStack_22 = (undefined1)((uint)uVar1 >> 0x10);
local_1f = uStack_22;
uStack_23 = (undefined1)((uint)uVar1 >> 8);
local_1e = uStack_23;
local_24 = (undefined1)uVar1;
local_1d = local_24;
_V_memcpy(pvVar4,&local_20,4);
iVar5 = *(int *)(param_2 + 0x10);
}
}
*(int *)(param_2 + 0x10) = iVar5 + 4;
CUtlBuffer::AddNullTermination(param_2);
}
}
else {
CUtlBuffer::Printf(param_2,"%d",uVar1);
}
if (((byte)param_2[0x15] & 1) == 0) {
cVar2 = CUtlBuffer::CheckPut(param_2,4);
if (cVar2 != '\0') {
if (((byte)param_2[0x34] & 1) == 0) {
*(undefined4 *)(*(int *)param_2 + (*(int *)(param_2 + 0x10) - *(int *)(param_2 + 0x20))) = 0
;
iVar5 = *(int *)(param_2 + 0x10);
}
else {
iVar5 = *(int *)(param_2 + 0x10);
pvVar4 = (void *)((iVar5 - *(int *)(param_2 + 0x20)) + *(int *)param_2);
if (pvVar4 != (void *)0x0) {
local_20 = 0;
local_1f = 0;
local_1e = 0;
local_1d = 0;
_V_memcpy(pvVar4,&local_20,4);
iVar5 = *(int *)(param_2 + 0x10);
}
}
*(int *)(param_2 + 0x10) = iVar5 + 4;
CUtlBuffer::AddNullTermination(param_2);
}
}
else {
CUtlBuffer::Printf(param_2,"%d",0);
}
if (((byte)param_2[0x15] & 1) == 0) {
cVar2 = CUtlBuffer::CheckPut(param_2,4);
if (cVar2 != '\0') {
if (((byte)param_2[0x34] & 1) == 0) {
*(undefined4 *)(*(int *)param_2 + (*(int *)(param_2 + 0x10) - *(int *)(param_2 + 0x20))) = 0
;
iVar5 = *(int *)(param_2 + 0x10);
}
else {
iVar5 = *(int *)(param_2 + 0x10);
pvVar4 = (void *)((iVar5 - *(int *)(param_2 + 0x20)) + *(int *)param_2);
if (pvVar4 != (void *)0x0) {
local_20 = 0;
local_1f = 0;
local_1e = 0;
local_1d = 0;
_V_memcpy(pvVar4,&local_20,4);
iVar5 = *(int *)(param_2 + 0x10);
}
}
*(int *)(param_2 + 0x10) = iVar5 + 4;
CUtlBuffer::AddNullTermination(param_2);
}
}
else {
CUtlBuffer::Printf(param_2,"%d",0);
}
sVar3 = send(*(int *)(this + 0x28),*(void **)param_2,*(size_t *)(param_2 + 0x10),0);
if (sVar3 == -1) {
UpdateProgress(*(TGameStatsParameters **)(this + 0x2c),"Send failed.");
*(undefined4 *)param_1 = 1;
}
else {
*(undefined4 *)(this + 0x14) = 5;
}
return sVar3 != -1;
}
SourceMod gamedata
paste intoaddons/sourcemod/gamedata/<your_plugin>.txt
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.
Type inference is best-effort from the C signature - sanity-check the DHooks types before shipping.