CSave::Log
0x004a7580 · 921 bytes · __thiscall
_ZN5CSave3LogEPKc11_fieldtypesPvi
Decompiled
undefined (5 params)
/* CSave::Log(char const*, _fieldtypes, void*, int) */
void __thiscall
CSave::Log(CSave *this,undefined4 param_1,undefined4 param_3,float *param_4,int param_5)
{
uint uVar1;
float fVar2;
undefined1 *puVar3;
uint *puVar4;
int iVar5;
float *pfVar6;
float *pfVar7;
float *local_20;
if (*(int *)(this + 0x20) == 0) {
return;
}
V_snprintf((char *)&Log(char_const*,_fieldtypes,void*,int)::szBuf,0x400,"%s ",param_1);
if (0 < param_5) {
local_20 = param_4;
iVar5 = 0;
pfVar6 = param_4;
pfVar7 = param_4;
do {
switch(param_3) {
default:
goto switchD_004a75f4_caseD_0;
case 1:
V_snprintf(Log(char_const*,_fieldtypes,void*,int)::szTempBuf,0x100,"%f",(double)*pfVar6);
break;
case 2:
puVar3 = (undefined1 *)*param_4;
if (puVar3 == (undefined1 *)0x0) {
puVar3 = &DAT_00d539c2;
}
V_snprintf(Log(char_const*,_fieldtypes,void*,int)::szTempBuf,0x100,"%s",puVar3);
break;
case 3:
V_snprintf(Log(char_const*,_fieldtypes,void*,int)::szTempBuf,0x100,"(%f %f %f)",
(double)*local_20,(double)local_20[1],(double)local_20[2]);
break;
case 4:
V_snprintf(Log(char_const*,_fieldtypes,void*,int)::szTempBuf,0x100,"(%f %f %f %f)",
(double)*pfVar7,(double)pfVar7[1],(double)pfVar7[2],(double)pfVar7[3]);
break;
case 5:
fVar2 = *pfVar6;
goto LAB_004a770f;
case 6:
fVar2 = (float)(uint)*(byte *)((int)param_4 + iVar5);
goto LAB_004a770f;
case 7:
fVar2 = (float)(int)*(short *)((int)param_4 + iVar5 * 2);
LAB_004a770f:
V_snprintf(Log(char_const*,_fieldtypes,void*,int)::szTempBuf,0x100,"%d",fVar2);
break;
case 8:
V_snprintf(Log(char_const*,_fieldtypes,void*,int)::szTempBuf,0x100,"%c",
(int)*(char *)((int)param_4 + iVar5));
V_strncat((char *)&Log(char_const*,_fieldtypes,void*,int)::szBuf,
Log(char_const*,_fieldtypes,void*,int)::szTempBuf,0x100,-1);
case 9:
V_snprintf(Log(char_const*,_fieldtypes,void*,int)::szTempBuf,0x100,"(%d %d %d %d)",
(uint)*(byte *)pfVar6,(uint)*(byte *)((int)pfVar6 + 1),
(uint)*(byte *)((int)pfVar6 + 2),(uint)*(byte *)((int)pfVar6 + 3));
break;
case 0x1d:
V_snprintf(Log(char_const*,_fieldtypes,void*,int)::szTempBuf,0x100,"%llx",param_4[iVar5 * 2]
);
}
V_strncat((char *)&Log(char_const*,_fieldtypes,void*,int)::szBuf,
Log(char_const*,_fieldtypes,void*,int)::szTempBuf,0x100,-1);
switchD_004a75f4_caseD_0:
iVar5 = iVar5 + 1;
if (iVar5 == param_5) goto LAB_004a789b;
pfVar6 = pfVar6 + 1;
pfVar7 = pfVar7 + 4;
V_strncpy(Log(char_const*,_fieldtypes,void*,int)::szTempBuf," ",0x100);
V_strncat((char *)&Log(char_const*,_fieldtypes,void*,int)::szBuf,
Log(char_const*,_fieldtypes,void*,int)::szTempBuf,0x100,-1);
local_20 = local_20 + 3;
} while( true );
}
LAB_004a78d3:
puVar4 = &Log(char_const*,_fieldtypes,void*,int)::szBuf;
do {
uVar1 = *puVar4;
puVar4 = puVar4 + 1;
} while ((uVar1 + 0xfefefeff & ~uVar1 & 0x80808080) == 0);
/* WARNING: Could not recover jumptable at 0x004a7937. Too many branches */
/* WARNING: Treating indirect jump as call */
(**(code **)(*(int *)(filesystem + 4) + 4))();
return;
LAB_004a789b:
V_strncpy(Log(char_const*,_fieldtypes,void*,int)::szTempBuf,"\n",0x100);
V_strncat((char *)&Log(char_const*,_fieldtypes,void*,int)::szBuf,
Log(char_const*,_fieldtypes,void*,int)::szTempBuf,0x100,-1);
goto LAB_004a78d3;
}
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.