BeginTrace
0x0011cb70 · 624 bytes · unknown
_Z10BeginTracev
Decompiled
undefined (0 params)
/* WARNING: Unknown calling convention -- yet parameter storage is locked */
/* BeginTrace() */
TraceInfo_t * BeginTrace(void)
{
CUtlVector<unsigned_int,CUtlMemory<unsigned_int,int>> *this;
char cVar1;
undefined4 *puVar2;
int iVar3;
TraceInfo_t *pTVar4;
TraceInfo_t *pTVar5;
byte bVar6;
int local_20;
bVar6 = 0;
do {
puVar2 = g_TraceInfoPool;
if (g_TraceInfoPool == (undefined4 *)0x0) {
puVar2 = operator_new(0x180);
puVar2[0x4c] = 0;
pTVar4 = (TraceInfo_t *)(puVar2 + 2);
puVar2[0x4d] = 0;
puVar2[0x4e] = 0;
puVar2[0x4f] = 0;
puVar2[0x50] = 0;
puVar2[0x51] = 0;
puVar2[0x52] = 0;
puVar2[0x53] = 0;
puVar2[0x54] = 0;
puVar2[0x55] = 0;
puVar2[0x56] = 0;
puVar2[0x57] = 0;
puVar2[0x58] = 0;
puVar2[0x59] = 0;
puVar2[0x5a] = 0;
puVar2[0x5b] = 0;
puVar2[0x5c] = 0;
puVar2[0x5d] = 0;
puVar2[0x5e] = 0;
puVar2[0x5f] = 0;
pTVar5 = pTVar4;
for (iVar3 = 0x4a; iVar3 != 0; iVar3 = iVar3 + -1) {
*(undefined4 *)pTVar5 = 0;
pTVar5 = pTVar5 + (uint)bVar6 * -8 + 4;
}
puVar2[0x49] = 0xffffffff;
goto LAB_0011ccac;
}
cVar1 = ThreadInterlockedAssignIf64
(&g_TraceInfoPool,*g_TraceInfoPool,DAT_003942e4 + -1,g_TraceInfoPool,
DAT_003942e4);
} while (cVar1 == '\0');
pTVar4 = (TraceInfo_t *)(puVar2 + 2);
LAB_0011ccac:
iVar3 = DAT_003943c0;
if (puVar2[0x4f] != DAT_003943c0 + 1) {
local_20 = 2;
puVar2[0x4a] = 0;
puVar2[0x4b] = 0;
puVar2[0x49] = 0xffffffff;
puVar2[0x4f] = 0;
this = (CUtlVector<unsigned_int,CUtlMemory<unsigned_int,int>> *)(puVar2 + 0x4c);
while( true ) {
iVar3 = iVar3 + 1;
if (iVar3 != 0) {
CUtlVector<unsigned_int,CUtlMemory<unsigned_int,int>>::GrowVector(this,iVar3);
CUtlVector<unsigned_int,CUtlMemory<unsigned_int,int>>::ShiftElementsRight(this,0,iVar3);
}
iVar3 = g_DispCollTreeCount;
*(undefined4 *)(this + 0x34) = 0;
if (iVar3 != 0) {
CUtlVector<unsigned_int,CUtlMemory<unsigned_int,int>>::GrowVector(this + 0x28,iVar3);
CUtlVector<unsigned_int,CUtlMemory<unsigned_int,int>>::ShiftElementsRight
(this + 0x28,0,iVar3);
}
memset(*(void **)this,0,*(int *)(this + 0xc) * 4);
memset(*(void **)(this + 0x28),0,*(int *)(this + 0x34) * 4);
iVar3 = DAT_003943c0;
local_20 = local_20 + -1;
if (local_20 == 0) break;
*(undefined4 *)(this + 0x20) = 0;
this = this + 0x14;
}
}
PushTraceVisits(pTVar4);
puVar2[0x43] = &g_BSPData;
return pTVar4;
}
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.