CBaseClientState::ProcessClassInfo
0x00100d90 · 984 bytes · __thiscall
_ZN16CBaseClientState16ProcessClassInfoEP13SVC_ClassInfo
Decompiled
undefined (2 params)
/* WARNING: Globals starting with '_' overlap smaller symbols at the same address */
/* CBaseClientState::ProcessClassInfo(SVC_ClassInfo*) */
undefined4 __thiscall
CBaseClientState::ProcessClassInfo(CBaseClientState *this,SVC_ClassInfo *param_1)
{
uint uVar1;
char cVar2;
C_ServerClassInfo *pCVar3;
uint uVar4;
uint *puVar5;
int iVar6;
char *pcVar7;
undefined4 uVar8;
int iVar9;
uint *puVar10;
int *piVar11;
C_ServerClassInfo *this_00;
int iVar12;
undefined4 local_34;
undefined4 local_30;
undefined4 local_28;
undefined4 local_24;
int local_20;
local_34 = 0;
local_30 = 0;
if (_exit == 0) {
local_20 = 0;
}
else {
(**(code **)(_exit + 0x50))
(_exit,&local_34,0,0,0,0,"/data/src/engine/./baseclientstate.cpp",0x71c,
&ProcessClassInfo(SVC_ClassInfo*)::tm_fmt,"(%s)%s","Unaccounted","ProcessClassInfo");
local_20 = _exit;
}
iVar9 = _DAT_0040b9d4;
local_28 = local_34;
local_24 = local_30;
/* try { // try from 00101076 to 001010c4 has its CatchHandler @ 0010118f */
if (((_DAT_0040b028 != 0) || (DAT_0040b02c == '\0')) &&
(iVar12 = ThreadGetCurrentId(), iVar9 == iVar12)) {
if ((char *)*_DAT_0040b030 != "ProcessClassInfo") {
_DAT_0040b030 =
(int *)CVProfNode::GetSubNode((char *)_DAT_0040b030,0x2a6e0c,&DAT_00000001,0x2a054b);
}
CVProfNode::EnterScope();
DAT_0040b02c = '\0';
}
/* try { // try from 00100e48 to 00101002 has its CatchHandler @ 001011a4 */
COM_TimestampedLog(" CBaseClient::ProcessClassInfo");
if (param_1[0x4c] == (SVC_ClassInfo)0x0) {
pCVar3 = *(C_ServerClassInfo **)(this + 0x41c4);
if (pCVar3 != (C_ServerClassInfo *)0x0) {
this_00 = pCVar3 + *(int *)(pCVar3 + -4) * 0x10;
if (pCVar3 != this_00) {
do {
this_00 = this_00 + -0x10;
C_ServerClassInfo::~C_ServerClassInfo(this_00);
pCVar3 = *(C_ServerClassInfo **)(this + 0x41c4);
} while (pCVar3 != this_00);
}
operator_delete__(pCVar3 + -4);
}
uVar1 = *(uint *)(param_1 + 0x5c);
*(uint *)(this + 0x41c8) = uVar1;
uVar4 = 0xffffffff;
if (uVar1 < 0x7f00001) {
uVar4 = uVar1 * 0x10 + 4;
}
puVar5 = operator_new__(uVar4);
*puVar5 = uVar1;
uVar4 = 0;
puVar5 = puVar5 + 1;
puVar10 = puVar5;
if (uVar1 != 0) {
do {
uVar4 = uVar4 + 1;
puVar10[1] = 0;
puVar10[2] = 0;
puVar10[3] = 0xffff;
puVar10 = puVar10 + 4;
} while (uVar1 != uVar4);
}
*(uint **)(this + 0x41c4) = puVar5;
if (puVar5 == (uint *)0x0) {
/* try { // try from 00101183 to 00101187 has its CatchHandler @ 001011a4 */
Host_EndGame(true,"ProcessClassInfo: can\'t allocate %d C_ServerClassInfos.\n",
*(undefined4 *)(this + 0x41c8));
uVar8 = 0;
}
else {
if (0 < *(int *)(this + 0x41c8)) {
piVar11 = *(int **)(param_1 + 0x50);
iVar9 = *piVar11;
if ((iVar9 < 0) || (*(int *)(this + 0x41c8) <= iVar9)) {
LAB_001010e8:
/* try { // try from 001010fb to 0010112b has its CatchHandler @ 001011a4 */
Host_EndGame(true,"ProcessClassInfo: invalid class index (%d).\n",iVar9);
uVar8 = 0;
goto LAB_00101005;
}
iVar12 = 0;
while( true ) {
iVar6 = _V_strlen((char *)(piVar11 + 0x41));
pcVar7 = operator_new__(iVar6 + 1U);
puVar5[iVar9 * 4 + 1] = (uint)pcVar7;
V_strncpy(pcVar7,(char *)(piVar11 + 0x41),iVar6 + 1U);
iVar6 = _V_strlen((char *)(piVar11 + 1));
pcVar7 = operator_new__(iVar6 + 1U);
puVar5[iVar9 * 4 + 2] = (uint)pcVar7;
V_strncpy(pcVar7,(char *)(piVar11 + 1),iVar6 + 1U);
iVar12 = iVar12 + 1;
if (*(int *)(this + 0x41c8) <= iVar12) break;
piVar11 = (int *)(iVar12 * 0x204 + *(int *)(param_1 + 0x50));
iVar9 = *piVar11;
if ((iVar9 < 0) || (*(int *)(this + 0x41c8) <= iVar9)) goto LAB_001010e8;
puVar5 = *(uint **)(this + 0x41c4);
}
}
COM_TimestampedLog(" CBaseClient::ProcessClassInfo(done)");
uVar8 = (**(code **)(*(int *)this + 0xb8))(this);
}
}
else {
ConMsg("Can\'t create class tables.\n");
uVar8 = 0;
}
LAB_00101005:
iVar9 = _DAT_0040b9d4;
if (((DAT_0040b02c == '\0') || (_DAT_0040b028 != 0)) &&
(iVar12 = ThreadGetCurrentId(), iVar9 == iVar12)) {
cVar2 = CVProfNode::ExitScope();
if (cVar2 != '\0') {
_DAT_0040b030 = (int *)_DAT_0040b030[0x19];
}
DAT_0040b02c = _DAT_0040b030 == (int *)0x40b034;
}
if (local_20 != 0) {
(**(code **)(local_20 + 0x54))(local_20,local_28,local_24,0,0,0);
}
return uVar8;
}
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.