L L4D2node

CEntityMapData::SetValue

0x004691f0 · 495 bytes · __thiscall

_ZN14CEntityMapData8SetValueEPKcPci

Decompiled

undefined (4 params)

/* CEntityMapData::SetValue(char const*, char*, int) */

undefined4 __thiscall
CEntityMapData::SetValue(CEntityMapData *this,char *param_1,char *param_2,int param_3)

{
  int iVar1;
  char *pcVar2;
  size_t sVar3;
  char *pcVar4;
  char *pcVar5;
  int iVar6;
  int in_GS_OFFSET;
  undefined4 local_c30;
  char local_c20 [1024];
  char local_820 [2048];
  int local_20;
  
  local_20 = *(int *)(in_GS_OFFSET + 0x14);
  if ((*(int *)(this + 4) != -1) && (pcVar2 = *(char **)this, pcVar2 != (char *)0x0)) {
    iVar6 = 0;
    while( true ) {
      pcVar2 = (char *)MapEntity_ParseToken(pcVar2,local_820);
      if (local_820[0] == '}') break;
      iVar1 = strcmp(local_820,param_1);
      if ((iVar1 == 0) && (iVar6 = iVar6 + 1, param_3 < iVar6)) {
        sVar3 = strlen(*(char **)this);
        pcVar4 = operator_new__(sVar3);
        pcVar5 = (char *)MapEntity_ParseToken(pcVar2,local_820);
        V_strncpy(pcVar4,pcVar5,sVar3);
        if (*param_2 == '\"') {
          V_strncpy(local_c20,param_2,0x400);
        }
        else {
          V_snprintf(local_c20,0x400,"\"%s\"",param_2);
        }
        iVar6 = _V_strlen(local_c20);
        iVar1 = _V_strlen(local_820);
        V_strncpy(pcVar2 + 1,local_c20,iVar6 + 1);
        V_strncat(pcVar2,pcVar4,~((int)pcVar2 - *(int *)this) + *(int *)(this + 4),-1);
        local_c30 = 1;
        *(int *)(this + 8) = *(int *)(this + 8) + (iVar6 - iVar1) + -2;
        if (pcVar4 != (char *)0x0) {
          local_c30 = 1;
          operator_delete__(pcVar4);
        }
        goto LAB_00469287;
      }
      pcVar2 = (char *)MapEntity_ParseToken(pcVar2,local_820);
      if (pcVar2 == (char *)0x0) break;
    }
  }
  local_c30 = 0;
LAB_00469287:
  if (local_20 == *(int *)(in_GS_OFFSET + 0x14)) {
    return local_c30;
  }
                    /* WARNING: Subroutine does not return */
  __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)