L L4D2node

SplitScreenConVarRef::Init

0x002484a0 · 355 bytes · __thiscall

_ZN20SplitScreenConVarRef4InitEPKcb

Decompiled

undefined (3 params)

/* SplitScreenConVarRef::Init(char const*, bool) */

void __thiscall SplitScreenConVarRef::Init(SplitScreenConVarRef *this,char *param_1,bool param_2)

{
  undefined1 *puVar1;
  int iVar2;
  int iVar3;
  SplitScreenConVarRef *pSVar4;
  int in_GS_OFFSET;
  char local_120 [256];
  int local_20;
  
  local_20 = *(int *)(in_GS_OFFSET + 0x14);
  iVar2 = 0;
  pSVar4 = this;
  do {
    if (iVar2 == 0) {
      iVar3 = 1;
      V_strncpy(local_120,param_1,0x100);
    }
    else {
      iVar3 = iVar2 + 1;
      V_snprintf(local_120,0x100,"%s%d",param_1,iVar3);
    }
    if (g_pCVar == (int *)0x0) {
      puVar1 = s_EmptyConVar;
LAB_0024852d:
      puVar1 = puVar1 + 0x18;
      *(undefined1 **)pSVar4 = puVar1;
LAB_00248532:
      puVar1 = puVar1 + -0x18;
    }
    else {
      puVar1 = (undefined1 *)(**(code **)(*g_pCVar + 0x30))(g_pCVar,local_120);
      if (puVar1 != (undefined1 *)0x0) goto LAB_0024852d;
      *(int *)pSVar4 = 0x3f3ef8;
      puVar1 = (undefined1 *)0x3f3ef8;
      if (iVar2 == 0) goto LAB_00248532;
      puVar1 = *(undefined1 **)this;
      *(undefined1 **)pSVar4 = puVar1;
      if (puVar1 != (undefined1 *)0x0) goto LAB_00248532;
      puVar1 = (undefined1 *)0x0;
    }
    *(undefined1 **)(pSVar4 + 4) = puVar1;
    pSVar4 = pSVar4 + 8;
    iVar2 = iVar3;
    if (iVar3 == 4) {
      if ((*(int *)this == 0x3f3ef8) &&
         ((g_pCVar != (int *)0x0 || (Init(char_const*,bool)::bFirst != '\0')))) {
        if (!param_2) {
          Warning("ConVarRef %s doesn\'t point to an existing ConVar\n",param_1);
        }
        Init(char_const*,bool)::bFirst = '\0';
      }
      if (local_20 != *(int *)(in_GS_OFFSET + 0x14)) {
                    /* WARNING: Subroutine does not return */
        __stack_chk_fail();
      }
      return;
    }
  } 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)