CDedicatedServerAPI::ModInit
0x00216e70 · 461 bytes · __thiscall
_ZN19CDedicatedServerAPI7ModInitER9ModInfo_t
Decompiled
undefined (2 params)
/* CDedicatedServerAPI::ModInit(ModInfo_t&) */
undefined4 __thiscall CDedicatedServerAPI::ModInit(CDedicatedServerAPI *this,ModInfo_t *param_1)
{
int *piVar1;
int iVar2;
undefined4 uVar3;
CAppSystemGroup *this_00;
int in_GS_OFFSET;
CFmtStrN<256> local_12c [5];
undefined1 local_127 [263];
int local_20;
local_20 = *(int *)(in_GS_OFFSET + 0x14);
g_bIsVGuiBasedDedicatedServer = (**(code **)(*dedicated + 0x1c))(dedicated);
piVar1 = (int *)CommandLine_Tier0();
iVar2 = (**(code **)(*piVar1 + 0x28))(piVar1,"-nobreakpad");
if (iVar2 == 0) {
if (g_nDedicatedServerAppIdBreakpad != 0) {
SteamAPI_SetBreakpadAppID(g_nDedicatedServerAppIdBreakpad);
}
Msg("Using breakpad minidump system\n");
uVar3 = build_number();
CFmtStrN<256>::CFmtStrN(local_12c,"%d",uVar3);
SteamAPI_UseBreakpadCrashHandler(local_127,"Jul 27 2024","18:37:18",0,this,PreMinidumpCallback);
if (g_nDedicatedServerAppIdBreakpad != 0) {
SteamAPI_SetBreakpadAppID(g_nDedicatedServerAppIdBreakpad);
}
}
(**(code **)(*(int *)eng + 0x28))(eng,0);
host_parms = *(undefined4 *)(param_1 + 4);
DAT_003a1540 = GetModDirFromPath(*(char **)(param_1 + 8));
DAT_003a1544 = *(undefined4 *)(param_1 + 0xc);
g_bTextMode = param_1[0x14];
TraceInit("COM_InitFilesystem( info.m_pInitialMod )","COM_ShutdownFileSystem()",0);
COM_InitFilesystem(*(char **)(param_1 + 8));
(**(code **)(*materials + 0x20))(materials);
uVar3 = (**(code **)(*(int *)game + 8))(game,0);
if ((char)uVar3 != '\0') {
this_00 = operator_new(0x54);
/* try { // try from 00216ff8 to 00216ffc has its CatchHandler @ 0021704a */
CAppSystemGroup::CAppSystemGroup(this_00,*(CAppSystemGroup **)(param_1 + 0x10));
*(undefined ***)this_00 = &PTR_Create_002c6f28;
this_00[0x50] = (CAppSystemGroup)0x1;
*(CAppSystemGroup **)(this + 8) = this_00;
g_AppSystemFactory = CAppSystemGroup::GetFactory();
CAppSystemGroup::Run(*(CAppSystemGroup **)(this + 8));
}
if (local_20 == *(int *)(in_GS_OFFSET + 0x14)) {
return uVar3;
}
/* WARNING: Subroutine does not return */
__stack_chk_fail();
}
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.