L L4D2node

CMaster::RebuildRules

0x00203870 · 415 bytes · __cdecl

_ZN7CMaster12RebuildRulesEP11CBaseServer

Decompiled

undefined (1 param)

/* CMaster::RebuildRules(CBaseServer*) */

void CMaster::RebuildRules(CBaseServer *param_1)

{
  char cVar1;
  int iVar2;
  int *piVar3;
  int *piVar4;
  char *pcVar5;
  bf_write *this;
  
  this = (bf_write *)(param_1 + 0x9a8);
  *(undefined4 *)(param_1 + 0x4f4) = realtime;
  bf_write::Reset(this);
  bf_write::Reset(this);
  iVar2 = CCvarUtilities::CountVariablesWithFlags((CCvarUtilities *)cv,0x100);
  if (iVar2 < 1) {
    return;
  }
  bf_write::WriteLong(this,-1);
  bf_write::WriteByte(this,0x45);
  bf_write::WriteShort(this,iVar2);
  piVar3 = (int *)(**(code **)(*g_pCVar + 0x98))(g_pCVar);
                    /* try { // try from 00203904 to 00203a00 has its CatchHandler @ 00203a2f */
  (**(code **)(*piVar3 + 8))(piVar3);
  do {
    cVar1 = (**(code **)(*piVar3 + 0x10))(piVar3);
    if (cVar1 == '\0') {
                    /* WARNING: Could not recover jumptable at 0x00203a2d. Too many branches */
                    /* WARNING: Treating indirect jump as call */
      (**(code **)(*piVar3 + 4))();
      return;
    }
    piVar4 = (int *)(**(code **)(*piVar3 + 0x14))(piVar3);
    cVar1 = (**(code **)(*piVar4 + 8))(piVar4);
    if (cVar1 == '\0') {
      cVar1 = (**(code **)(*piVar4 + 0xc))(piVar4,0x100);
      if (cVar1 != '\0') {
        pcVar5 = (char *)(**(code **)(*piVar4 + 0x1c))(piVar4);
        bf_write::WriteString(this,pcVar5);
        cVar1 = (**(code **)(*piVar4 + 0xc))(piVar4,0x20);
        if (cVar1 == '\0') {
          pcVar5 = "FCVAR_NEVER_AS_STRING";
          if (((*(byte *)((int)piVar4 + 0x15) & 0x10) == 0) &&
             (pcVar5 = *(char **)(piVar4[7] + 0x24), pcVar5 == (char *)0x0)) {
            pcVar5 = "";
          }
          bf_write::WriteString(this,pcVar5);
        }
        else {
          if ((*(byte *)((int)piVar4 + 0x15) & 0x10) == 0) {
            pcVar5 = *(char **)(piVar4[7] + 0x24);
            if ((pcVar5 != (char *)0x0) && (*pcVar5 != '\0')) goto LAB_002039dd;
          }
          else {
            pcVar5 = "FCVAR_NEVER_AS_STRING";
LAB_002039dd:
            iVar2 = _V_stricmp(pcVar5,"none");
            if (iVar2 != 0) {
              bf_write::WriteString(this,"1");
              goto LAB_00203910;
            }
          }
          bf_write::WriteString(this,"0");
        }
      }
    }
LAB_00203910:
    (**(code **)(*piVar3 + 0xc))(piVar3);
  } while( true );
}

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)