L L4D2node

ConVar::Create

0x0003dff0 · 269 bytes · __thiscall

_ZN6ConVar6CreateEPKcS1_iS1_bfbfPFvP7IConVarS1_fE

Decompiled

undefined (10 params)

/* ConVar::Create(char const*, char const*, int, char const*, bool, float, bool, float, void
   (*)(IConVar*, char const*, float)) */

void __thiscall
ConVar::Create(ConVar *this,char *param_1,char *param_2,int param_3,char *param_4,bool param_5,
              float param_6,bool param_7,float param_8,
              _func_void_IConVar_ptr_char_ptr_float *param_9)

{
  char *__s;
  size_t sVar1;
  void *__dest;
  longdouble lVar2;
  
  *(ConVar **)(this + 0x1c) = this;
  this[0x3c] = (ConVar)param_7;
  __s = "";
  if (param_2 != (char *)0x0) {
    __s = param_2;
  }
  *(float *)(this + 0x38) = param_6;
  this[0x34] = (ConVar)param_5;
  *(char **)(this + 0x20) = __s;
  *(float *)(this + 0x40) = param_8;
  *(_func_void_IConVar_ptr_char_ptr_float **)(this + 0x44) = param_9;
  sVar1 = strlen(__s);
  *(size_t *)(this + 0x28) = sVar1 + 1;
  __dest = operator_new__(sVar1 + 1);
  *(void **)(this + 0x24) = __dest;
  memcpy(__dest,*(void **)(this + 0x20),*(size_t *)(this + 0x28));
  lVar2 = (longdouble)V_atod(*(char **)(this + 0x24));
  *(float *)(this + 0x2c) = (float)lVar2;
  if (((uint)(float)lVar2 & 0x7f800000) == 0x7f800000) {
    Warning("ConVar(%s) defined with infinite float value (%s)\n",param_1,
            *(undefined4 *)(this + 0x24));
    *(undefined4 *)(this + 0x2c) = 0x7f7fffff;
    lVar2 = (longdouble)(double)lVar2;
  }
  *(int *)(this + 0x30) = (int)lVar2;
  if ((param_3 & 0x84280U) == 0) {
    param_3 = param_3 | 2;
  }
  ConCommandBase::Create((ConCommandBase *)this,param_1,param_4,param_3);
  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)