Host_CheckDumpMemoryStats
0x00176b00 · 332 bytes · unknown
_Z25Host_CheckDumpMemoryStatsv
Decompiled
undefined (0 params)
/* WARNING: Unknown calling convention -- yet parameter storage is locked */
/* Host_CheckDumpMemoryStats() */
void Host_CheckDumpMemoryStats(void)
{
char cVar1;
char *pcVar2;
int in_GS_OFFSET;
longdouble lVar3;
char local_110 [256];
int local_10;
local_10 = *(int *)(in_GS_OFFSET + 0x14);
if (*(int *)(mem_test_each_frame._28_4_ + 0x30) == 0) {
if (*(int *)(mem_test_every_n_seconds._28_4_ + 0x30) < 1) goto LAB_00176b69;
lVar3 = (longdouble)Plat_FloatTime();
if ((float)lVar3 - g_TimeLastMemTest <= (float)*(int *)(mem_test_every_n_seconds._28_4_ + 0x30))
goto LAB_00176b69;
g_TimeLastMemTest = (float)lVar3;
cVar1 = MemTest();
}
else {
cVar1 = MemTest();
}
if (cVar1 == '\0') {
cVar1 = Plat_IsInDebugSession(0);
if (cVar1 != '\0') {
raise(5);
}
Error("Heap is corrupt\n");
}
LAB_00176b69:
if (0.0 < *(float *)(mem_periodicdumps._28_4_ + 0x2c)) {
lVar3 = (longdouble)Plat_FloatTime();
if ((double)*(float *)(mem_periodicdumps._28_4_ + 0x2c) <
(double)lVar3 - g_flLastPeriodicMemDump) {
pcVar2 = &DAT_003b7f70;
if (DAT_003b7f70 == '\0') {
pcVar2 = "nomap";
}
V_FileBase(pcVar2,local_110,0x100);
g_flLastPeriodicMemDump = (double)lVar3;
}
}
if (local_10 == *(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.