L L4D2node

ConVar::ChangeStringValue

0x0003e4c0 · 230 bytes · __thiscall

_ZN6ConVar17ChangeStringValueEPKcf

Decompiled

undefined (3 params)

/* ConVar::ChangeStringValue(char const*, float) */

void __thiscall ConVar::ChangeStringValue(ConVar *this,char *param_1,float param_2)

{
  int iVar1;
  undefined4 uVar2;
  code *pcVar3;
  int iVar4;
  int iVar5;
  void *pvVar6;
  int in_GS_OFFSET;
  uint auStack_50 [3];
  float afStack_44 [5];
  int local_30 [4];
  int local_20;
  
  local_20 = *(int *)(in_GS_OFFSET + 0x14);
  iVar4 = -((*(int *)(this + 0x28) + 0xfU & 0xfffffff0) + 0x10);
  uVar2 = *(undefined4 *)(this + 0x24);
  iVar1 = (int)local_30 + iVar4;
  *(int *)((int)afStack_44 + iVar4) = *(int *)(this + 0x28);
  *(int *)((int)auStack_50 + iVar4 + 4) = iVar1;
  *(undefined4 *)((int)auStack_50 + iVar4 + 8) = uVar2;
  *(undefined4 *)((int)auStack_50 + iVar4) = 0x3e502;
  memcpy(*(void **)((int)auStack_50 + iVar4 + 4),*(void **)((int)auStack_50 + iVar4 + 8),
         *(size_t *)((int)afStack_44 + iVar4));
  *(char **)((int)auStack_50 + iVar4 + 4) = param_1;
  *(undefined4 *)((int)auStack_50 + iVar4) = 0x3e50a;
  iVar5 = _V_strlen(*(char **)((int)auStack_50 + iVar4 + 4));
  iVar5 = iVar5 + 1;
  pvVar6 = *(void **)(this + 0x24);
  if (*(int *)(this + 0x28) < iVar5) {
    if (pvVar6 != (void *)0x0) {
      *(void **)((int)auStack_50 + iVar4 + 4) = pvVar6;
      local_30[0] = iVar5;
      *(undefined4 *)((int)auStack_50 + iVar4) = 0x3e524;
      operator_delete__(*(void **)((int)auStack_50 + iVar4 + 4));
      iVar5 = local_30[0];
    }
    *(int *)((int)auStack_50 + iVar4 + 4) = iVar5;
    local_30[0] = iVar5;
    *(undefined4 *)((int)auStack_50 + iVar4) = 0x3e532;
    pvVar6 = operator_new__(*(uint *)((int)auStack_50 + iVar4 + 4));
    *(void **)(this + 0x24) = pvVar6;
    *(int *)(this + 0x28) = local_30[0];
    iVar5 = local_30[0];
  }
  *(int *)((int)afStack_44 + iVar4) = iVar5;
  *(char **)((int)auStack_50 + iVar4 + 8) = param_1;
  *(void **)((int)auStack_50 + iVar4 + 4) = pvVar6;
  *(undefined4 *)((int)auStack_50 + iVar4) = 0x3e54b;
  memcpy(*(void **)((int)auStack_50 + iVar4 + 4),*(void **)((int)auStack_50 + iVar4 + 8),
         *(size_t *)((int)afStack_44 + iVar4));
  pcVar3 = *(code **)(this + 0x44);
  if (pcVar3 != (code *)0x0) {
    *(int *)((int)auStack_50 + iVar4 + 8) = iVar1;
    *(ConVar **)((int)auStack_50 + iVar4 + 4) = this + 0x18;
    *(float *)((int)afStack_44 + iVar4) = param_2;
    *(undefined4 *)((int)auStack_50 + iVar4) = 0x3e569;
    (*pcVar3)();
  }
  if (g_pCVar != (int *)0x0) {
    iVar5 = *g_pCVar;
    *(int *)((int)afStack_44 + iVar4) = iVar1;
    *(ConVar **)((int)auStack_50 + iVar4 + 8) = this;
    *(int **)((int)auStack_50 + iVar4 + 4) = g_pCVar;
    *(float *)((int)afStack_44 + iVar4 + 4) = param_2;
    pcVar3 = *(code **)(iVar5 + 0x48);
    *(undefined4 *)((int)auStack_50 + iVar4) = 0x3e58d;
    (*pcVar3)();
  }
  if (local_20 == *(int *)(in_GS_OFFSET + 0x14)) {
    return;
  }
                    /* WARNING: Subroutine does not return */
  *(undefined **)((int)auStack_50 + iVar4) = &UNK_0003e5a6;
  __stack_chk_fail();
}

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)