L L4D2node

Host_BuildConVarUpdateMessage

0x00179870 · 430 bytes · __cdecl

_Z29Host_BuildConVarUpdateMessageR10CUtlVectorI16NetMessageCvar_t10CUtlMemoryIS0_iEEib

Decompiled

undefined (3 params)

/* Host_BuildConVarUpdateMessage(CUtlVector<NetMessageCvar_t, CUtlMemory<NetMessageCvar_t, int> >&,
   int, bool) */

void Host_BuildConVarUpdateMessage(CUtlVector *param_1,int param_2,bool param_3)

{
  char cVar1;
  int iVar2;
  int *piVar3;
  ConVar *this;
  char *pcVar4;
  int in_GS_OFFSET;
  char *local_234;
  NetMessageCvar_t local_228 [260];
  char local_124 [260];
  int local_20;
  
  local_20 = *(int *)(in_GS_OFFSET + 0x14);
  iVar2 = Host_CountVariablesWithFlags(param_2,param_3);
  if (0 < iVar2) {
    if (iVar2 < 0x100) {
      piVar3 = (int *)(**(code **)(*g_pCVar + 0x98))(g_pCVar);
                    /* try { // try from 001798d6 to 001799ec has its CatchHandler @ 00179a25 */
      (**(code **)(*piVar3 + 8))(piVar3);
      while( true ) {
        cVar1 = (**(code **)(*piVar3 + 0x10))(piVar3);
        if (cVar1 == '\0') break;
        this = (ConVar *)(**(code **)(*piVar3 + 0x14))();
        cVar1 = (**(code **)(*(int *)this + 8))(this);
        if ((cVar1 == '\0') &&
           (cVar1 = (**(code **)(*(int *)this + 0xc))(this,param_2), cVar1 != '\0')) {
          if (param_3) {
            local_234 = "FCVAR_NEVER_AS_STRING";
            if ((((byte)this[0x15] & 0x10) == 0) &&
               (local_234 = *(char **)(*(int *)(this + 0x1c) + 0x24), local_234 == (char *)0x0)) {
              local_234 = "";
            }
            pcVar4 = (char *)ConVar::GetDefault(this);
            iVar2 = V_strcasecmp(pcVar4,local_234);
            if (iVar2 == 0) goto LAB_001798e0;
          }
          pcVar4 = (char *)(**(code **)(*(int *)this + 0x1c))(this);
          V_strncpy((char *)local_228,pcVar4,0x104);
          pcVar4 = "FCVAR_NEVER_AS_STRING";
          if (((byte)this[0x15] & 0x10) == 0) {
            pcVar4 = "";
            if (*(char **)(*(int *)(this + 0x1c) + 0x24) != (char *)0x0) {
              pcVar4 = *(char **)(*(int *)(this + 0x1c) + 0x24);
            }
          }
          pcVar4 = (char *)Host_CleanupConVarStringValue(pcVar4);
          V_strncpy(local_124,pcVar4,0x104);
          CUtlVector<NetMessageCvar_t,CUtlMemory<NetMessageCvar_t,int>>::InsertBefore
                    ((CUtlVector<NetMessageCvar_t,CUtlMemory<NetMessageCvar_t,int>> *)param_1,
                     *(int *)(param_1 + 0xc),local_228);
        }
LAB_001798e0:
        (**(code **)(*piVar3 + 0xc))(piVar3);
      }
      (**(code **)(*piVar3 + 4))(piVar3);
    }
    else {
      Sys_Error("Engine only supports 255 ConVars marked %i\n",param_2);
    }
  }
  if (local_20 != *(int *)(in_GS_OFFSET + 0x14)) {
                    /* WARNING: Subroutine does not return */
    __stack_chk_fail();
  }
  return;
}

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)