ServerDTI_HookTable
0x0014c2a0 · 475 bytes · __cdecl
_Z19ServerDTI_HookTableP9SendTable
Decompiled
undefined (1 param)
/* WARNING: Globals starting with '_' overlap smaller symbols at the same address */
/* ServerDTI_HookTable(SendTable*) */
CUtlString * ServerDTI_HookTable(SendTable *param_1)
{
CUtlString *this;
int iVar1;
uint uVar2;
ushort uVar3;
int iVar4;
uint uVar5;
CUtlString *pCVar6;
byte bVar7;
bVar7 = 0;
if (g_bServerDTIEnabled == '\0') {
return (CUtlString *)0x0;
}
this = operator_new(0x94);
/* try { // try from 0014c2c7 to 0014c2cb has its CatchHandler @ 0014c498 */
CUtlString::CUtlString(this);
pCVar6 = this;
for (iVar4 = 0x25; iVar4 != 0; iVar4 = iVar4 + -1) {
*(undefined4 *)pCVar6 = 0;
pCVar6 = pCVar6 + (uint)bVar7 * -8 + 4;
}
CUtlString::Set(this,*(char **)(param_1 + 8));
uVar5 = (uint)DAT_0039f50c;
uVar2 = 0;
if (DAT_0039f50c == 0xffff) {
if ((int)(uint)DAT_0039f512 < DAT_0039f500) {
uVar5 = DAT_0039f512 + 1;
uVar2 = uVar5 & 0xffff;
if (DAT_0039f500 <= (int)uVar2) {
uVar5 = 0xffff;
uVar2 = 0xffff;
}
}
else {
if (DAT_0039f500 < 1) {
uVar2 = 0xffff;
}
uVar5 = (0 < DAT_0039f500) - 1;
}
if (DAT_0039f500 <= (int)uVar2) {
CUtlMemory<UtlLinkedListElem_t<CDTISendTable*,unsigned_short>,unsigned_short>::Grow
((CUtlMemory<UtlLinkedListElem_t<CDTISendTable*,unsigned_short>,unsigned_short> *)
&g_DTISendTables,1);
_DAT_0039f514 = g_DTISendTables;
if ((int)(uint)DAT_0039f512 < DAT_0039f500) {
uVar5 = DAT_0039f512 + 1;
uVar2 = uVar5 & 0xffff;
if (DAT_0039f500 <= (int)uVar2) {
uVar5 = 0xffff;
uVar2 = 0xffff;
}
}
else {
uVar2 = 0;
if (DAT_0039f500 < 1) {
uVar2 = 0xffff;
}
uVar5 = (0 < DAT_0039f500) - 1;
}
if (DAT_0039f500 <= (int)uVar2) {
if (9 < CUtlLinkedList<CDTISendTable*,unsigned_short,false,unsigned_short,CUtlMemory<UtlLinkedListElem_t<CDTISendTable*,unsigned_short>,unsigned_short>>
::AllocInternal(bool)::__executeCount) {
_DAT_0039f514 = g_DTISendTables;
return this;
}
CUtlLinkedList<CDTISendTable*,unsigned_short,false,unsigned_short,CUtlMemory<UtlLinkedListElem_t<CDTISendTable*,unsigned_short>,unsigned_short>>
::AllocInternal(bool)::__executeCount =
CUtlLinkedList<CDTISendTable*,unsigned_short,false,unsigned_short,CUtlMemory<UtlLinkedListElem_t<CDTISendTable*,unsigned_short>,unsigned_short>>
::AllocInternal(bool)::__executeCount + 1;
Warning("CUtlLinkedList overflow! (exhausted memory allocator)\n");
return this;
}
}
uVar3 = (ushort)uVar5;
if (uVar3 == 0xffff) {
if (9 < CUtlLinkedList<CDTISendTable*,unsigned_short,false,unsigned_short,CUtlMemory<UtlLinkedListElem_t<CDTISendTable*,unsigned_short>,unsigned_short>>
::AllocInternal(bool)::__executeCount) {
return this;
}
CUtlLinkedList<CDTISendTable*,unsigned_short,false,unsigned_short,CUtlMemory<UtlLinkedListElem_t<CDTISendTable*,unsigned_short>,unsigned_short>>
::AllocInternal(bool)::__executeCount =
CUtlLinkedList<CDTISendTable*,unsigned_short,false,unsigned_short,CUtlMemory<UtlLinkedListElem_t<CDTISendTable*,unsigned_short>,unsigned_short>>
::AllocInternal(bool)::__executeCount + 1;
Warning("CUtlLinkedList overflow! (exhausted index range)\n");
return this;
}
uVar5 = uVar5 & 0xffff;
iVar4 = uVar5 * 8;
_DAT_0039f510 = _DAT_0039f510 + 1;
iVar1 = g_DTISendTables + iVar4;
DAT_0039f512 = uVar3;
}
else {
iVar4 = uVar5 * 8;
iVar1 = g_DTISendTables + iVar4;
uVar3 = DAT_0039f50c;
DAT_0039f50c = *(ushort *)(iVar1 + 6);
}
*(ushort *)(iVar1 + 6) = uVar3;
*(ushort *)(iVar1 + 4) = uVar3;
CUtlLinkedList<CDTISendTable*,unsigned_short,false,unsigned_short,CUtlMemory<UtlLinkedListElem_t<CDTISendTable*,unsigned_short>,unsigned_short>>
::LinkBefore((CUtlLinkedList<CDTISendTable*,unsigned_short,false,unsigned_short,CUtlMemory<UtlLinkedListElem_t<CDTISendTable*,unsigned_short>,unsigned_short>>
*)&g_DTISendTables,0xffff,(ushort)uVar5);
if ((undefined4 *)(iVar4 + g_DTISendTables) != (undefined4 *)0x0) {
*(undefined4 *)(iVar4 + g_DTISendTables) = this;
}
return this;
}
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.