L L4D2node

DataMapInit<CChangeLevel>

0x00b18610 · 937 bytes · __cdecl

_Z11DataMapInitI12CChangeLevelEP9datamap_tPT_

Decompiled

datamap_t * (1 param)

/* WARNING: Globals starting with '_' overlap smaller symbols at the same address */
/* datamap_t* DataMapInit<CChangeLevel>(CChangeLevel*) */

datamap_t * DataMapInit<CChangeLevel>(CChangeLevel *param_1)

{
  int iVar1;
  char *pcVar2;
  char *pcVar3;
  int iVar4;
  int iVar5;
  
  if ((DataMapInit<CChangeLevel>(CChangeLevel*)::nameHolder == '\0') &&
     (iVar1 = __cxa_guard_acquire(&DataMapInit<CChangeLevel>(CChangeLevel*)::nameHolder), iVar1 != 0
     )) {
    DataMapInit<CChangeLevel>(CChangeLevel*)::nameHolder = "CChangeLevel";
    DAT_01034cbc = (void *)0x0;
    DAT_01034cc0 = 0;
    DAT_01034cc4 = 0;
    DAT_01034cc8 = 0;
    _DAT_01034ccc = (void *)0x0;
    DAT_01034cb8 = 0xc;
    __cxa_guard_release(&DataMapInit<CChangeLevel>(CChangeLevel*)::nameHolder);
    __cxa_atexit(CDatadescGeneratedNameHolder::~CDatadescGeneratedNameHolder,
                 &DataMapInit<CChangeLevel>(CChangeLevel*)::nameHolder,&__dso_handle);
  }
  CChangeLevel::m_DataMap._12_4_ = CBaseTrigger::m_DataMap;
  if ((DataMapInit<CChangeLevel>(CChangeLevel*)::dataDesc != '\0') ||
     (iVar1 = __cxa_guard_acquire(&DataMapInit<CChangeLevel>(CChangeLevel*)::dataDesc), iVar1 == 0))
  goto LAB_00b18639;
  DataMapInit<CChangeLevel>(CChangeLevel*)::dataDesc._76_2_ = 0x20;
  DataMapInit<CChangeLevel>(CChangeLevel*)::dataDesc._140_2_ = 0x20;
                    /* try { // try from 00b18692 to 00b18961 has its CatchHandler @ 00b189ee */
  pcVar2 = operator_new__(DAT_01034cb8 + 0x11);
  pcVar3 = stpcpy(pcVar2,DataMapInit<CChangeLevel>(CChangeLevel*)::nameHolder);
  builtin_strncpy(pcVar3,"TouchChangeLevel",0x11);
  iVar4 = DAT_01034cc8;
  iVar1 = DAT_01034cc8 + 1;
  if ((DAT_01034cc0 < iVar1) && (-1 < DAT_01034cc4)) {
    if (DAT_01034cc4 == 0) {
      if (DAT_01034cc0 == 0) {
        if (iVar1 < 9) {
          DAT_01034cc0 = 8;
          goto LAB_00b1889f;
        }
        DAT_01034cc0 = 8;
      }
      do {
        DAT_01034cc0 = DAT_01034cc0 * 2;
      } while (DAT_01034cc0 < iVar1);
    }
    else {
      for (DAT_01034cc0 = (DAT_01034cc8 / DAT_01034cc4 + 1) * DAT_01034cc4; DAT_01034cc0 < iVar1;
          DAT_01034cc0 = (DAT_01034cc0 + iVar1) / 2) {
      }
    }
LAB_00b1889f:
    if (DAT_01034cbc == (void *)0x0) {
      DAT_01034cbc = malloc(DAT_01034cc0 << 2);
    }
    else {
      DAT_01034cbc = realloc(DAT_01034cbc,DAT_01034cc0 << 2);
      iVar1 = DAT_01034cc8 + 1;
    }
  }
  iVar5 = iVar4 * 4;
  iVar4 = (iVar1 - iVar4) + -1;
  DAT_01034cc8 = iVar1;
  _DAT_01034ccc = DAT_01034cbc;
  if (0 < iVar4) {
    _V_memmove((void *)((int)DAT_01034cbc + iVar5 + 4),(void *)((int)DAT_01034cbc + iVar5),iVar4 * 4
              );
  }
  if ((undefined4 *)(iVar5 + (int)DAT_01034cbc) != (undefined4 *)0x0) {
    *(undefined4 *)(iVar5 + (int)DAT_01034cbc) = pcVar2;
  }
  DataMapInit<CChangeLevel>(CChangeLevel*)::dataDesc._276_4_ = eventFuncs;
  DataMapInit<CChangeLevel>(CChangeLevel*)::dataDesc._196_4_ = pcVar2;
  pcVar2 = operator_new__(DAT_01034cb8 + 0x11);
  pcVar3 = stpcpy(pcVar2,DataMapInit<CChangeLevel>(CChangeLevel*)::nameHolder);
  builtin_strncpy(pcVar3,"ChangelevelThink",0x11);
  iVar4 = DAT_01034cc8;
  iVar1 = DAT_01034cc8 + 1;
  if ((DAT_01034cc0 < iVar1) && (-1 < DAT_01034cc4)) {
    if (DAT_01034cc4 == 0) {
      if (DAT_01034cc0 == 0) {
        if (iVar1 < 9) {
          DAT_01034cc0 = 8;
          goto LAB_00b1890f;
        }
        DAT_01034cc0 = 8;
      }
      do {
        DAT_01034cc0 = DAT_01034cc0 * 2;
      } while (DAT_01034cc0 < iVar1);
    }
    else {
      for (DAT_01034cc0 = (DAT_01034cc8 / DAT_01034cc4 + 1) * DAT_01034cc4; DAT_01034cc0 < iVar1;
          DAT_01034cc0 = (DAT_01034cc0 + iVar1) / 2) {
      }
    }
LAB_00b1890f:
    if (DAT_01034cbc == (void *)0x0) {
      DAT_01034cbc = malloc(DAT_01034cc0 << 2);
    }
    else {
      DAT_01034cbc = realloc(DAT_01034cbc,DAT_01034cc0 << 2);
      iVar1 = DAT_01034cc8 + 1;
    }
  }
  iVar5 = iVar4 * 4;
  iVar4 = (iVar1 - iVar4) + -1;
  DAT_01034cc8 = iVar1;
  _DAT_01034ccc = DAT_01034cbc;
  if (0 < iVar4) {
    _V_memmove((void *)((int)DAT_01034cbc + iVar5 + 4),(void *)((int)DAT_01034cbc + iVar5),iVar4 * 4
              );
  }
  if ((undefined4 *)(iVar5 + (int)DAT_01034cbc) != (undefined4 *)0x0) {
    *(undefined4 *)(iVar5 + (int)DAT_01034cbc) = pcVar2;
  }
  DataMapInit<CChangeLevel>(CChangeLevel*)::dataDesc._324_4_ = pcVar2;
  __cxa_guard_release(&DataMapInit<CChangeLevel>(CChangeLevel*)::dataDesc);
LAB_00b18639:
  CChangeLevel::m_DataMap._4_4_ = 5;
  CChangeLevel::m_DataMap._0_4_ = 0xf650e0;
  return (datamap_t *)CChangeLevel::m_DataMap;
}

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)