CResponseSystem::ParseResponse
0x005bc490 · 897 bytes · __thiscall
_ZN15CResponseSystem13ParseResponseEv
Decompiled
undefined (1 param)
/* CResponseSystem::ParseResponse() */
void __thiscall CResponseSystem::ParseResponse(CResponseSystem *this)
{
ResponseGroup *pRVar1;
CResponseSystem *pCVar2;
byte bVar3;
CResponseSystem CVar4;
char cVar5;
ushort uVar6;
short sVar7;
int iVar8;
undefined4 uVar9;
byte *pbVar10;
CResponseSystem *pCVar11;
uint uVar12;
int iVar13;
int in_GS_OFFSET;
uint local_ec;
int local_e8;
byte *local_e4;
int local_e0;
void *local_dc;
undefined4 local_d8;
int local_d4;
undefined4 local_d0;
undefined1 local_cc;
undefined1 local_cb;
undefined1 local_ca;
byte local_c9;
undefined2 local_c5;
undefined2 local_c3;
undefined2 local_c1;
undefined2 local_bf;
undefined2 local_bd;
undefined2 local_bb;
undefined2 local_b9;
undefined2 local_b7;
undefined1 local_b5;
undefined2 local_b4;
undefined2 local_b2;
undefined4 local_b0;
undefined4 local_ac;
undefined4 local_a8;
undefined4 local_a4;
char local_a0 [128];
int local_20;
local_b7 = 0;
local_20 = *(int *)(in_GS_OFFSET + 0x14);
local_b9 = 100;
local_ac = 0;
local_a8 = 0;
local_a4 = 0;
pCVar2 = this + 0x38c8;
local_c5 = float16::ConvertFloatTo16bits(0.0);
local_b5 = 0;
local_b0 = 0;
local_c3 = local_c5;
local_c1 = local_c5;
local_bf = local_c5;
local_bd = local_c5;
local_bb = local_c5;
local_b4 = local_c5;
local_b2 = local_c5;
ParseToken(this);
/* try { // try from 005bc555 to 005bc5b9 has its CatchHandler @ 005bc80c */
V_strncpy(local_a0,(char *)pCVar2,0x80);
local_e4 = (byte *)ResponseCopyString(local_a0);
local_e0 = -0x55555556;
bVar3 = *local_e4;
pbVar10 = local_e4;
while (bVar3 != 0) {
pbVar10 = pbVar10 + 1;
local_e0 = (uint)bVar3 + local_e0 * 0x21;
bVar3 = *pbVar10;
}
local_e8 = local_e0;
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 + 0x28),(Node_t *)&local_e8);
local_dc = (void *)0x0;
local_d8 = 0;
local_d4 = 0;
local_cc = 1;
local_c9 = local_c9 & 0xe0 | 1;
local_cb = 0;
local_d0 = 0;
local_ca = 1;
/* try { // try from 005bc620 to 005bc624 has its CatchHandler @ 005bc829 */
uVar6 = CUtlRBTree<CUtlMap<unsigned_int,ResponseGroup,unsigned_short>::Node_t,unsigned_short,CUtlMap<unsigned_int,ResponseGroup,unsigned_short>::CKeyLess,CUtlMemory<UtlRBTreeNode_t<CUtlMap<unsigned_int,ResponseGroup,unsigned_short>::Node_t,unsigned_short>,unsigned_short>>
::Insert((CUtlRBTree<CUtlMap<unsigned_int,ResponseGroup,unsigned_short>::Node_t,unsigned_short,CUtlMap<unsigned_int,ResponseGroup,unsigned_short>::CKeyLess,CUtlMemory<UtlRBTreeNode_t<CUtlMap<unsigned_int,ResponseGroup,unsigned_short>::Node_t,unsigned_short>,unsigned_short>>
*)(this + 0xc),(Node_t *)&local_e0);
iVar8 = local_d4 + -1;
if (-1 < iVar8) {
iVar13 = iVar8 * 0x50;
do {
iVar8 = iVar8 + -1;
AI_ResponseParams::ScriptFollowup_t::~ScriptFollowup_t
((ScriptFollowup_t *)((int)local_dc + iVar13 + 0x19));
iVar13 = iVar13 + -0x50;
} while (iVar8 != -1);
}
local_d4 = 0;
free(local_dc);
pRVar1 = (ResponseGroup *)((uint)uVar6 * 0x20 + *(int *)(this + 0x10) + 0xc);
LAB_005bc6c0:
if (this[0x3d7c] != (CResponseSystem)0x0) goto LAB_005bc7c0;
LAB_005bc6cd:
if (0 < *(int *)(this + 0x3d8c)) {
iVar8 = *(int *)(this + 0x3d80);
uVar9 = RR_Parse(*(char **)(iVar8 + 8),(char *)pCVar2);
*(undefined4 *)(iVar8 + 8) = uVar9;
*(int *)(*(int *)(this + 0x3d80) + 0xc) = *(int *)(*(int *)(this + 0x3d80) + 0xc) + 1;
}
CVar4 = this[0x38c8];
if (CVar4 == (CResponseSystem)0x0) goto LAB_005bc7d6;
do {
uVar12 = 0xaaaaaaaa;
pCVar11 = pCVar2;
do {
pCVar11 = pCVar11 + 1;
uVar12 = (uint)(byte)CVar4 + uVar12 * 0x21;
CVar4 = *pCVar11;
} while (CVar4 != (CResponseSystem)0x0);
while( true ) {
local_ec = uVar12;
/* try { // try from 005bc73c to 005bc7ae has its CatchHandler @ 005bc80c */
sVar7 = CUtlRBTree<unsigned_int,unsigned_short,bool(*)(unsigned_int_const&,unsigned_int_const&),CUtlMemory<UtlRBTreeNode_t<unsigned_int,unsigned_short>,unsigned_short>>
::Find((CUtlRBTree<unsigned_int,unsigned_short,bool(*)(unsigned_int_const&,unsigned_int_const&),CUtlMemory<UtlRBTreeNode_t<unsigned_int,unsigned_short>,unsigned_short>>
*)(this + 0x3e20),&local_ec);
if (sVar7 != -1) {
this[0x3d7c] = (CResponseSystem)0x1;
AI_ResponseParams::ScriptFollowup_t::~ScriptFollowup_t((ScriptFollowup_t *)&local_ac);
if (local_20 == *(int *)(in_GS_OFFSET + 0x14)) {
return;
}
/* WARNING: Subroutine does not return */
__stack_chk_fail();
}
cVar5 = DispatchParseResponseGroup
(this,(char *)pCVar2,uVar12,(CUtlMap *)(this + 0x3e04),local_a0,pRVar1,
(AI_ResponseParams *)&local_c5);
if (cVar5 != '\0') goto LAB_005bc6c0;
ParseOneResponse(this,local_a0,pRVar1,(AI_ResponseParams *)0x0);
if (this[0x3d7c] == (CResponseSystem)0x0) goto LAB_005bc6cd;
LAB_005bc7c0:
CVar4 = this[0x38c8];
this[0x3d7c] = (CResponseSystem)0x0;
if (CVar4 != (CResponseSystem)0x0) break;
LAB_005bc7d6:
uVar12 = 0xaaaaaaaa;
}
} 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.