CBlackBox::Record
0x00113840 · 235 bytes · __thiscall
_ZN9CBlackBox6RecordEiPKc
Decompiled
undefined (3 params)
/* CBlackBox::Record(int, char const*) */
void __thiscall CBlackBox::Record(CBlackBox *this,int param_1,char *param_2)
{
undefined4 *puVar1;
void *pvVar2;
CBlackBoxRecord *pCVar3;
size_t sVar4;
char *__dest;
int iVar5;
longdouble lVar6;
CBlackBoxRecord *local_10;
if ((*(int *)(blackbox._28_4_ + 0x30) != 0) && ((uint)param_1 < 3)) {
pCVar3 = operator_new(0xc);
/* try { // try from 00113876 to 00113892 has its CatchHandler @ 00113936 */
lVar6 = (longdouble)Plat_FloatTime();
*(double *)pCVar3 = (double)lVar6;
sVar4 = strlen(param_2);
__dest = operator_new__(sVar4 + 1);
*(char **)(pCVar3 + 8) = __dest;
strcpy(__dest,param_2);
local_10 = pCVar3;
CUtlVector<CBlackBoxRecord*,CUtlMemory<CBlackBoxRecord*,int>>::InsertBefore
((CUtlVector<CBlackBoxRecord*,CUtlMemory<CBlackBoxRecord*,int>> *)
(this + param_1 * 0x14 + 4),*(int *)(this + param_1 * 0x14 + 0x10),&local_10);
if (*(uint *)(this + param_1 * 4 + 0x40) < *(uint *)(this + param_1 * 0x14 + 0x10)) {
puVar1 = *(undefined4 **)(this + param_1 * 0x14 + 4);
iVar5 = *(uint *)(this + param_1 * 0x14 + 0x10) - 1;
pvVar2 = (void *)*puVar1;
if (0 < iVar5) {
_V_memmove(puVar1,puVar1 + 1,iVar5 * 4);
iVar5 = *(int *)(this + param_1 * 0x14 + 0x10) + -1;
}
*(int *)(this + param_1 * 0x14 + 0x10) = iVar5;
if (pvVar2 != (void *)0x0) {
if (*(void **)((int)pvVar2 + 8) != (void *)0x0) {
operator_delete(*(void **)((int)pvVar2 + 8));
}
operator_delete(pvVar2);
}
}
}
return;
}
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.