CHLTVTestSystem::StartTest
0x00174ec0 · 406 bytes · __thiscall
_ZN15CHLTVTestSystem9StartTestEiPKc
Decompiled
undefined (3 params)
/* CHLTVTestSystem::StartTest(int, char const*) */
undefined4 __thiscall CHLTVTestSystem::StartTest(CHLTVTestSystem *this,int param_1,char *param_2)
{
int iVar1;
int iVar2;
code *pcVar3;
undefined1 uVar4;
CHLTVServer *this_00;
undefined4 uVar5;
int iVar6;
size_t __size;
void *pvVar7;
int iVar8;
iVar8 = *(int *)(this + 0xc);
do {
if (param_1 <= iVar8) {
if (0 < param_1) {
iVar8 = 0;
do {
iVar1 = iVar8 * 4;
iVar8 = iVar8 + 1;
CHLTVServer::ConnectRelay(*(CHLTVServer **)(*(int *)this + iVar1),param_2);
} while (iVar8 != param_1);
}
return 1;
}
this_00 = operator_new(0x8abc);
/* try { // try from 00174ef1 to 00174ef5 has its CatchHandler @ 00175066 */
CHLTVServer::CHLTVServer(this_00);
iVar1 = *(int *)(this + 0xc);
iVar2 = *(int *)(this + 4);
iVar8 = iVar1 + 1;
if (iVar2 < iVar8) {
iVar6 = *(int *)(this + 8);
if (iVar6 < 0) goto LAB_00174f07;
if (iVar6 == 0) {
if (iVar2 == 0) {
if (iVar8 < 9) {
iVar6 = 8;
goto LAB_00174ff7;
}
iVar2 = 8;
}
do {
iVar6 = iVar2;
iVar2 = iVar6 * 2;
} while (iVar2 < iVar8);
pvVar7 = *(void **)this;
*(int *)(this + 4) = iVar2;
__size = iVar6 << 3;
if (pvVar7 == (void *)0x0) goto LAB_0017504d;
LAB_00175006:
pvVar7 = realloc(pvVar7,__size);
*(void **)this = pvVar7;
iVar8 = *(int *)(this + 0xc) + 1;
}
else {
for (iVar6 = (iVar1 / iVar6 + 1) * iVar6; iVar6 < iVar8; iVar6 = (iVar6 + iVar8) / 2) {
}
LAB_00174ff7:
pvVar7 = *(void **)this;
*(int *)(this + 4) = iVar6;
__size = iVar6 << 2;
if (pvVar7 != (void *)0x0) goto LAB_00175006;
LAB_0017504d:
pvVar7 = malloc(__size);
*(void **)this = pvVar7;
}
}
else {
LAB_00174f07:
pvVar7 = *(void **)this;
}
*(int *)(this + 0xc) = iVar8;
iVar2 = iVar1 * 4;
iVar8 = (iVar8 - iVar1) + -1;
*(void **)(this + 0x10) = pvVar7;
if (0 < iVar8) {
_V_memmove((void *)((int)pvVar7 + iVar2 + 4),(void *)((int)pvVar7 + iVar2),iVar8 * 4);
pvVar7 = *(void **)this;
}
if ((undefined4 *)((int)pvVar7 + iVar2) != (undefined4 *)0x0) {
*(undefined4 *)((int)pvVar7 + iVar2) = this_00;
}
pcVar3 = *(code **)(*(int *)this_00 + 0x10);
uVar4 = NET_IsDedicated();
(*pcVar3)(this_00,uVar4);
uVar5 = NET_AddExtraSocket(-1);
*(undefined4 *)(this_00 + 0x220) = uVar5;
iVar8 = *(int *)(this + 0xc);
} 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.