CAppSystemGroup::LoadModule
0x0026b980 · 434 bytes · __thiscall
_ZN15CAppSystemGroup10LoadModuleEPKc
Decompiled
undefined (2 params)
/* CAppSystemGroup::LoadModule(char const*) */
int __thiscall CAppSystemGroup::LoadModule(CAppSystemGroup *this,char *param_1)
{
code *pcVar1;
int iVar2;
char *pcVar3;
int iVar4;
int iVar5;
void *pvVar6;
int iVar7;
int in_GS_OFFSET;
int iStackY_50;
undefined1 auStack_40 [8];
char *local_38;
int local_34;
undefined1 *local_30;
int local_20;
local_20 = *(int *)(in_GS_OFFSET + 0x14);
local_38 = param_1;
iStackY_50 = 0x26b9a8;
iVar4 = _V_strlen(param_1);
local_34 = iVar4 + 1;
iVar2 = -((iVar4 + 0x10U & 0xfffffff0) + 0x10);
*(char **)(&stack0xffffffb4 + iVar2) = param_1;
local_30 = auStack_40 + iVar2;
*(int *)(&stack0xffffffbc + iVar2) = iVar4 + 1;
*(undefined1 **)(&stack0xffffffb8 + iVar2) = local_30;
*(undefined4 *)((int)&iStackY_50 + iVar2) = 0x26b9d7;
V_StripExtension(*(char **)(&stack0xffffffb4 + iVar2),*(char **)(&stack0xffffffb8 + iVar2),
*(int *)(&stack0xffffffbc + iVar2));
iVar4 = *(int *)(this + 0x10) + -1;
iVar5 = iVar4 * 0xc;
for (; pcVar3 = local_38, -1 < iVar4; iVar4 = iVar4 + -1) {
iVar7 = *(int *)(*(int *)(this + 4) + 8 + iVar5);
if (iVar7 != 0) {
*(int *)(&stack0xffffffb8 + iVar2) = iVar7;
*(undefined1 **)(&stack0xffffffb4 + iVar2) = local_30;
*(undefined4 *)((int)&iStackY_50 + iVar2) = 0x26ba0a;
iVar7 = _V_stricmp(*(char **)(&stack0xffffffb4 + iVar2),*(char **)(&stack0xffffffb8 + iVar2));
if (iVar7 == 0) goto LAB_0026baa8;
}
iVar5 = iVar5 + -0xc;
}
iVar4 = *(int *)this;
*(CAppSystemGroup **)(&stack0xffffffb4 + iVar2) = this;
*(char **)(&stack0xffffffb8 + iVar2) = pcVar3;
pcVar1 = *(code **)(iVar4 + 0x1c);
*(undefined4 *)((int)&iStackY_50 + iVar2) = 0x26ba2b;
iVar5 = (*pcVar1)();
pcVar3 = local_38;
if (iVar5 == 0) {
*(char **)(&stack0xffffffb4 + iVar2) = "AppFramework : Unable to load module %s!\n";
*(char **)(&stack0xffffffb8 + iVar2) = pcVar3;
*(undefined4 *)((int)&iStackY_50 + iVar2) = 0x26bb37;
Warning();
iVar4 = -1;
}
else {
iVar4 = *(int *)(this + 0x10);
iVar7 = iVar4 + 1;
local_38 = (char *)iVar5;
if (*(int *)(this + 8) < iVar7) {
*(int *)(&stack0xffffffb8 + iVar2) = iVar7 - *(int *)(this + 8);
*(CAppSystemGroup **)(&stack0xffffffb4 + iVar2) = this + 4;
*(undefined4 *)((int)&iStackY_50 + iVar2) = 0x26bb0c;
CUtlMemory<CAppSystemGroup::Module_t,int>::Grow
(*(CUtlMemory<CAppSystemGroup::Module_t,int> **)(&stack0xffffffb4 + iVar2),
*(int *)(&stack0xffffffb8 + iVar2));
iVar7 = *(int *)(this + 0x10) + 1;
}
iVar5 = *(int *)(this + 4);
*(int *)(this + 0x10) = iVar7;
iVar7 = (iVar7 - iVar4) + -1;
*(int *)(this + 0x14) = iVar5;
if (0 < iVar7) {
*(int *)(&stack0xffffffbc + iVar2) = iVar7 * 0xc;
*(int *)(&stack0xffffffb8 + iVar2) = iVar5 + iVar4 * 0xc;
*(int *)(&stack0xffffffb4 + iVar2) = iVar5 + 0xc + iVar4 * 0xc;
*(undefined4 *)((int)&iStackY_50 + iVar2) = 0x26bae6;
_V_memmove(*(void **)(&stack0xffffffb4 + iVar2),*(void **)(&stack0xffffffb8 + iVar2),
*(int *)(&stack0xffffffbc + iVar2));
iVar5 = *(int *)(this + 4);
}
iVar7 = iVar4 * 0xc;
*(char **)(iVar5 + iVar7) = local_38;
*(undefined4 *)(*(int *)(this + 4) + 4 + iVar7) = 0;
iVar5 = *(int *)(this + 4);
*(int *)(&stack0xffffffb4 + iVar2) = local_34;
local_38 = (char *)(iVar5 + iVar7);
*(undefined4 *)((int)&iStackY_50 + iVar2) = 0x26ba83;
pvVar6 = malloc(*(size_t *)(&stack0xffffffb4 + iVar2));
*(void **)(local_38 + 8) = pvVar6;
*(int *)(&stack0xffffffbc + iVar2) = local_34;
*(undefined1 **)(&stack0xffffffb8 + iVar2) = local_30;
*(undefined4 *)(&stack0xffffffb4 + iVar2) = *(undefined4 *)(*(int *)(this + 4) + 8 + iVar7);
*(undefined4 *)((int)&iStackY_50 + iVar2) = 0x26baa6;
V_strncpy(*(char **)(&stack0xffffffb4 + iVar2),*(char **)(&stack0xffffffb8 + iVar2),
*(int *)(&stack0xffffffbc + iVar2));
}
LAB_0026baa8:
if (local_20 != *(int *)(in_GS_OFFSET + 0x14)) {
/* WARNING: Subroutine does not return */
*(undefined **)((int)&iStackY_50 + iVar2) = &UNK_0026bb46;
__stack_chk_fail();
}
return iVar4;
}
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.