L L4D2node

CTestScriptMgr::RunCommands

0x002199e0 · 476 bytes · __thiscall

_ZN14CTestScriptMgr11RunCommandsEv

Decompiled

undefined (1 param)

/* CTestScriptMgr::RunCommands() */

void __thiscall CTestScriptMgr::RunCommands(CTestScriptMgr *this)

{
  bool bVar1;
  char cVar2;
  undefined4 uVar3;
  int iVar4;
  char *pcVar5;
  int in_GS_OFFSET;
  longdouble lVar6;
  char local_221 [513];
  int local_20;
  
  local_20 = *(int *)(in_GS_OFFSET + 0x14);
LAB_00219a00:
  lVar6 = (longdouble)Plat_FloatTime();
  if ((*(double *)(this + 0x28) <= (double)lVar6) && (this[8] == (CTestScriptMgr)0x0)) {
    pcVar5 = local_221;
    bVar1 = false;
    iVar4 = 0;
    do {
      pcVar5 = pcVar5 + 1;
      (**(code **)g_pFileSystem[1])(g_pFileSystem + 1,pcVar5,1,*(undefined4 *)(this + 4));
      cVar2 = *pcVar5;
      if (cVar2 == '/') {
        if (bVar1) {
          local_221[0] = '\0';
          goto LAB_00219b70;
        }
        bVar1 = true;
      }
      else {
        if (((cVar2 == '\n') || (cVar2 == ';')) ||
           (cVar2 = (**(code **)(*g_pFileSystem + 0x5c))(g_pFileSystem,*(undefined4 *)(this + 4)),
           cVar2 != '\0')) break;
        bVar1 = false;
      }
      iVar4 = iVar4 + 1;
    } while (iVar4 != 0x1ff);
    goto LAB_00219a82;
  }
  goto LAB_00219a1a;
  while ((**(code **)g_pFileSystem[1])(g_pFileSystem + 1,local_221,1,*(undefined4 *)(this + 4)),
        local_221[0] != '\n') {
LAB_00219b70:
    cVar2 = (**(code **)(*g_pFileSystem + 0x5c))(g_pFileSystem,*(undefined4 *)(this + 4));
    if (cVar2 != '\0') break;
  }
  iVar4 = iVar4 + -1;
LAB_00219a82:
  local_221[iVar4 + 1] = '\0';
  if (local_221[1] == '\0') {
    cVar2 = (**(code **)(*g_pFileSystem + 0x5c))(g_pFileSystem,*(undefined4 *)(this + 4));
    if (cVar2 != '\0') {
      if (*(int *)(this + 4) != 0) {
        (**(code **)(g_pFileSystem[1] + 0xc))(g_pFileSystem + 1,*(int *)(this + 4));
        *(undefined4 *)(this + 4) = 0;
      }
LAB_00219a1a:
      if (local_20 != *(int *)(in_GS_OFFSET + 0x14)) {
                    /* WARNING: Subroutine does not return */
        __stack_chk_fail();
      }
      return;
    }
  }
  else {
    uVar3 = Cbuf_GetCurrentPlayer();
    Cbuf_AddText(uVar3,local_221 + 1,0);
    Cbuf_Execute();
  }
  goto LAB_00219a00;
}

SourceMod gamedata

paste into addons/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.



        

        

          

Type inference is best-effort from the C signature - sanity-check the DHooks types before shipping.

Return-type handling cheatsheet (DHookReturn)