CResponseSystem::ParseEnumeration
0x005bda20 · 795 bytes · __thiscall
_ZN15CResponseSystem16ParseEnumerationEv
Decompiled
undefined (1 param)
/* CResponseSystem::ParseEnumeration() */
void __thiscall CResponseSystem::ParseEnumeration(CResponseSystem *this)
{
CResponseSystem *__nptr;
byte bVar1;
short sVar2;
int iVar3;
undefined4 uVar4;
byte *pbVar5;
int in_GS_OFFSET;
double dVar6;
int local_1a8;
byte *local_1a4;
char local_1a0 [128];
char local_120 [128];
byte local_a0;
byte local_9f [127];
int local_20;
local_20 = *(int *)(in_GS_OFFSET + 0x14);
__nptr = this + 0x38c8;
ParseToken(this);
V_strncpy(local_1a0,(char *)__nptr,0x80);
ParseToken(this);
iVar3 = _V_stricmp((char *)__nptr,"{");
if (iVar3 != 0) {
ResponseWarning(this,"Expecting \'{\' in enumeration \'%s\', got \'%s\'\n",local_1a0,__nptr);
LAB_005bdd02:
if (local_20 == *(int *)(in_GS_OFFSET + 0x14)) {
return;
}
/* WARNING: Subroutine does not return */
__stack_chk_fail();
}
LAB_005bda8a:
if (this[0x3d7c] != (CResponseSystem)0x0) goto LAB_005bdcc8;
do {
if (0 < *(int *)(this + 0x3d8c)) {
iVar3 = *(int *)(this + 0x3d80);
uVar4 = RR_Parse(*(char **)(iVar3 + 8),(char *)__nptr);
*(undefined4 *)(iVar3 + 8) = uVar4;
*(int *)(*(int *)(this + 0x3d80) + 0xc) = *(int *)(*(int *)(this + 0x3d80) + 0xc) + 1;
}
while( true ) {
iVar3 = _V_stricmp((char *)__nptr,"}");
if (iVar3 == 0) goto LAB_005bdd02;
iVar3 = _V_strlen((char *)__nptr);
if (iVar3 < 1) {
ResponseWarning(this,"Expecting more tokens in enumeration \'%s\'\n",local_1a0);
goto LAB_005bdd02;
}
V_strncpy(local_120,(char *)__nptr,0x80);
if (this[0x3d7c] == (CResponseSystem)0x0) {
if (0 < *(int *)(this + 0x3d8c)) {
iVar3 = *(int *)(this + 0x3d80);
uVar4 = RR_Parse(*(char **)(iVar3 + 8),(char *)__nptr);
*(undefined4 *)(iVar3 + 8) = uVar4;
*(int *)(*(int *)(this + 0x3d80) + 0xc) = *(int *)(*(int *)(this + 0x3d80) + 0xc) + 1;
}
}
else {
this[0x3d7c] = (CResponseSystem)0x0;
}
dVar6 = strtod((char *)__nptr,(char **)0x0);
V_snprintf((char *)&local_a0,0x80,"[%s::%s]",local_1a0,local_120);
if (local_a0 == 0) {
local_1a8 = -0x55555556;
}
else {
pbVar5 = &local_a0;
local_1a8 = -0x55555556;
bVar1 = local_a0;
do {
pbVar5 = pbVar5 + 1;
local_1a8 = (uint)bVar1 + local_1a8 * 0x21;
bVar1 = *pbVar5;
} while (bVar1 != 0);
}
sVar2 = CUtlRBTree<CUtlMap<unsigned_int,CResponseSystem::Enumeration,unsigned_short>::Node_t,unsigned_short,CUtlMap<unsigned_int,CResponseSystem::Enumeration,unsigned_short>::CKeyLess,CUtlMemory<UtlRBTreeNode_t<CUtlMap<unsigned_int,CResponseSystem::Enumeration,unsigned_short>::Node_t,unsigned_short>,unsigned_short>>
::Find((CUtlRBTree<CUtlMap<unsigned_int,CResponseSystem::Enumeration,unsigned_short>::Node_t,unsigned_short,CUtlMap<unsigned_int,CResponseSystem::Enumeration,unsigned_short>::CKeyLess,CUtlMemory<UtlRBTreeNode_t<CUtlMap<unsigned_int,CResponseSystem::Enumeration,unsigned_short>::Node_t,unsigned_short>,unsigned_short>>
*)(this + 0x387c),(Node_t *)&local_1a8);
if (sVar2 != -1) goto LAB_005bda8a;
iVar3 = -0x55555556;
local_1a4 = (byte *)ResponseCopyString((char *)&local_a0);
bVar1 = *local_1a4;
pbVar5 = local_1a4;
while (bVar1 != 0) {
pbVar5 = pbVar5 + 1;
iVar3 = (uint)bVar1 + iVar3 * 0x21;
bVar1 = *pbVar5;
}
local_1a8 = iVar3;
CUtlRBTree<CUtlMap<unsigned_int,char_const*,unsigned_short>::Node_t,unsigned_short,CUtlMap<unsigned_int,char_const*,unsigned_short>::CKeyLess,CUtlMemory<UtlRBTreeNode_t<CUtlMap<unsigned_int,char_const*,unsigned_short>::Node_t,unsigned_short>,unsigned_short>>
::Insert((CUtlRBTree<CUtlMap<unsigned_int,char_const*,unsigned_short>::Node_t,unsigned_short,CUtlMap<unsigned_int,char_const*,unsigned_short>::CKeyLess,CUtlMemory<UtlRBTreeNode_t<CUtlMap<unsigned_int,char_const*,unsigned_short>::Node_t,unsigned_short>,unsigned_short>>
*)(this + 0x3898),(Node_t *)&local_1a8);
local_1a4 = (byte *)(float)dVar6;
local_1a8 = iVar3;
CUtlRBTree<CUtlMap<unsigned_int,CResponseSystem::Enumeration,unsigned_short>::Node_t,unsigned_short,CUtlMap<unsigned_int,CResponseSystem::Enumeration,unsigned_short>::CKeyLess,CUtlMemory<UtlRBTreeNode_t<CUtlMap<unsigned_int,CResponseSystem::Enumeration,unsigned_short>::Node_t,unsigned_short>,unsigned_short>>
::Insert((CUtlRBTree<CUtlMap<unsigned_int,CResponseSystem::Enumeration,unsigned_short>::Node_t,unsigned_short,CUtlMap<unsigned_int,CResponseSystem::Enumeration,unsigned_short>::CKeyLess,CUtlMemory<UtlRBTreeNode_t<CUtlMap<unsigned_int,CResponseSystem::Enumeration,unsigned_short>::Node_t,unsigned_short>,unsigned_short>>
*)(this + 0x387c),(Node_t *)&local_1a8);
if (this[0x3d7c] == (CResponseSystem)0x0) break;
LAB_005bdcc8:
this[0x3d7c] = (CResponseSystem)0x0;
}
} while( true );
}
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.