Con_DebugLog
0x00127ae0 · 634 bytes · __cdecl
_Z12Con_DebugLogPKcz
Decompiled
undefined (1 param)
/* WARNING: Globals starting with '_' overlap smaller symbols at the same address */
/* Con_DebugLog(char const*, ...) */
void Con_DebugLog(char *param_1,...)
{
undefined4 uVar1;
int iVar2;
int iVar3;
uint *puVar4;
uint *puVar5;
CMapReslistGenerator *this;
char *__s;
size_t sVar6;
uint uVar7;
uint uVar8;
int in_GS_OFFSET;
undefined4 local_104c;
undefined4 local_1048;
undefined4 local_1044;
undefined4 local_1040;
int local_103c;
int local_1038;
uint local_1020 [1024];
int local_20;
local_20 = *(int *)(in_GS_OFFSET + 0x14);
V_vsnprintf((char *)local_1020,0x1000,param_1,&stack0x00000008);
uVar1 = GetConsoleLogFilename();
iVar2 = (**(code **)(*(int *)(g_pFileSystem + 4) + 8))(g_pFileSystem + 4,uVar1,&DAT_002b462c,0);
if (iVar2 != 0) {
if (con_debuglogmapprefixed != '\0') {
this = (CMapReslistGenerator *)MapReslistGenerator();
__s = (char *)CMapReslistGenerator::LogPrefix(this);
iVar3 = g_pFileSystem;
if (__s != (char *)0x0) {
sVar6 = strlen(__s);
(**(code **)(*(int *)(iVar3 + 4) + 4))(iVar3 + 4,__s,sVar6,iVar2);
}
}
puVar5 = local_1020;
if (*(int *)(con_timestamp._28_4_ + 0x30) != 0) {
if (Con_DebugLog(char_const*,...)::needTimestamp != '\0') {
(**(code **)(_g_pVCR + 0x5c))(&local_104c);
V_snprintf((char *)&GetTimestampString()::string,0x80,"%02i/%02i/%04i - %02i:%02i:%02i",
local_103c + 1,local_1040,local_1038 + 0x76c,local_1044,local_1048,local_104c);
puVar5 = &GetTimestampString()::string;
do {
puVar4 = puVar5;
uVar7 = *puVar4 + 0xfefefeff & ~*puVar4;
uVar8 = uVar7 & 0x80808080;
puVar5 = puVar4 + 1;
} while (uVar8 == 0);
if ((uVar7 & 0x8080) == 0) {
puVar5 = (uint *)((int)puVar4 + 6);
uVar8 = uVar8 >> 0x10;
}
(**(code **)(*(int *)(g_pFileSystem + 4) + 4))
(g_pFileSystem + 4,&GetTimestampString()::string,
(int)puVar5 + (-0x39c283 - (uint)CARRY1((byte)uVar8,(byte)uVar8)),iVar2);
(**(code **)(*(int *)(g_pFileSystem + 4) + 4))(g_pFileSystem + 4,&DAT_002bd4b4,2,iVar2);
}
iVar3 = V_stristr((char *)local_1020,"\n");
Con_DebugLog(char_const*,...)::needTimestamp = iVar3 != 0;
puVar5 = local_1020;
}
do {
puVar4 = puVar5;
uVar7 = *puVar4 + 0xfefefeff & ~*puVar4;
uVar8 = uVar7 & 0x80808080;
puVar5 = puVar4 + 1;
} while (uVar8 == 0);
if ((uVar7 & 0x8080) == 0) {
puVar5 = (uint *)((int)puVar4 + 6);
uVar8 = uVar8 >> 0x10;
}
(**(code **)(*(int *)(g_pFileSystem + 4) + 4))
(g_pFileSystem + 4,local_1020,
(char *)((int)puVar5 +
((-3 - (uint)CARRY1((byte)uVar8,(byte)uVar8)) - (int)local_1020)),iVar2);
(**(code **)(*(int *)(g_pFileSystem + 4) + 0xc))(g_pFileSystem + 4,iVar2);
}
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.