L L4D2node

CheckVarRange_Generic

0x00177cc0 · 267 bytes · __cdecl

_Z21CheckVarRange_GenericP6ConVarii

Decompiled

undefined (3 params)

/* WARNING: Globals starting with '_' overlap smaller symbols at the same address */
/* CheckVarRange_Generic(ConVar*, int, int) */

undefined4 CheckVarRange_Generic(ConVar *param_1,int param_2,int param_3)

{
  char cVar1;
  int iVar2;
  undefined1 *puVar3;
  undefined4 uVar4;
  
  if (CheckVarRange_Generic(ConVar*,int,int)::bInFunction != '\0') {
    return 1;
  }
  CheckVarRange_Generic(ConVar*,int,int)::bInFunction = 1;
  cVar1 = ConVar::IsFlagSet((ConVar *)sv_hosting_lobby,2);
  if (cVar1 == '\0') {
    puVar3 = sv_cheats;
  }
  else {
    if ((g_pMatchFramework == (int *)0x0) ||
       (iVar2 = (**(code **)(*g_pMatchFramework + 0x24))(g_pMatchFramework), iVar2 == 0)) {
      puVar3 = sv_cheats;
    }
    else {
      puVar3 = (undefined1 *)0x0;
    }
    if (((DAT_003b80d0 != 0 || _DAT_003b80cc != 0) ||
        (*(int *)(sv_hosting_lobby._28_4_ + 0x30) != 0)) || (puVar3 == (undefined1 *)0x0))
    goto LAB_00177d4f;
  }
  if (*(int *)(*(int *)(puVar3 + 0x1c) + 0x30) != 0) {
    CheckVarRange_Generic(ConVar*,int,int)::bInFunction = 0;
    return 0;
  }
LAB_00177d4f:
  cVar1 = Cmd_IsRptActive();
  if ((cVar1 == '\0') && ((DAT_003b7f64 < 2 || (1 < DAT_003b8064)))) {
    iVar2 = *(int *)(*(int *)(param_1 + 0x1c) + 0x30);
    if (iVar2 <= param_3) {
      if (param_2 <= iVar2) {
        CheckVarRange_Generic(ConVar*,int,int)::bInFunction = 0;
        return 0;
      }
      param_3 = param_2;
    }
    uVar4 = (**(code **)(*(int *)param_1 + 0x1c))(param_1);
    Warning("sv_cheats=0 prevented changing %s outside of the range [0,2] (was %d).\n",uVar4,iVar2);
    (**(code **)(*(int *)param_1 + 0x44))(param_1,param_3);
  }
  CheckVarRange_Generic(ConVar*,int,int)::bInFunction = 0;
  return 0;
}

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)