L L4D2node

DataMapInit<CEntityDissolve>

0x00678720 · 902 bytes · __cdecl

_Z11DataMapInitI15CEntityDissolveEP9datamap_tPT_

Decompiled

datamap_t * (1 param)

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

datamap_t * DataMapInit<CEntityDissolve>(CEntityDissolve *param_1)

{
  int iVar1;
  char *pcVar2;
  char *pcVar3;
  int iVar4;
  int iVar5;
  
  if ((DataMapInit<CEntityDissolve>(CEntityDissolve*)::nameHolder == '\0') &&
     (iVar1 = __cxa_guard_acquire(&DataMapInit<CEntityDissolve>(CEntityDissolve*)::nameHolder),
     iVar1 != 0)) {
    DataMapInit<CEntityDissolve>(CEntityDissolve*)::nameHolder = "CEntityDissolve";
    DAT_00fc8e18 = (void *)0x0;
    DAT_00fc8e1c = 0;
    DAT_00fc8e20 = 0;
    DAT_00fc8e24 = 0;
    _DAT_00fc8e28 = (void *)0x0;
    DAT_00fc8e14 = 0xf;
    __cxa_guard_release(&DataMapInit<CEntityDissolve>(CEntityDissolve*)::nameHolder);
    __cxa_atexit(CDatadescGeneratedNameHolder::~CDatadescGeneratedNameHolder,
                 &DataMapInit<CEntityDissolve>(CEntityDissolve*)::nameHolder,&__dso_handle);
  }
  CEntityDissolve::m_DataMap._12_4_ = CBaseEntity::m_DataMap;
  if ((DataMapInit<CEntityDissolve>(CEntityDissolve*)::dataDesc != '\0') ||
     (iVar1 = __cxa_guard_acquire(&DataMapInit<CEntityDissolve>(CEntityDissolve*)::dataDesc),
     iVar1 == 0)) goto LAB_00678749;
                    /* try { // try from 0067878b to 00678a51 has its CatchHandler @ 00678ade */
  pcVar2 = operator_new__(DAT_00fc8e14 + 0xe);
  pcVar3 = stpcpy(pcVar2,DataMapInit<CEntityDissolve>(CEntityDissolve*)::nameHolder);
  builtin_strncpy(pcVar3,"DissolveThink",0xe);
  iVar4 = DAT_00fc8e24;
  iVar1 = DAT_00fc8e24 + 1;
  if ((DAT_00fc8e1c < iVar1) && (-1 < DAT_00fc8e20)) {
    if (DAT_00fc8e20 == 0) {
      if (DAT_00fc8e1c == 0) {
        if (iVar1 < 9) {
          DAT_00fc8e1c = 8;
          goto LAB_0067898f;
        }
        DAT_00fc8e1c = 8;
      }
      do {
        DAT_00fc8e1c = DAT_00fc8e1c * 2;
      } while (DAT_00fc8e1c < iVar1);
    }
    else {
      for (DAT_00fc8e1c = (DAT_00fc8e24 / DAT_00fc8e20 + 1) * DAT_00fc8e20; DAT_00fc8e1c < iVar1;
          DAT_00fc8e1c = (DAT_00fc8e1c + iVar1) / 2) {
      }
    }
LAB_0067898f:
    if (DAT_00fc8e18 == (void *)0x0) {
      DAT_00fc8e18 = malloc(DAT_00fc8e1c << 2);
    }
    else {
      DAT_00fc8e18 = realloc(DAT_00fc8e18,DAT_00fc8e1c << 2);
      iVar1 = DAT_00fc8e24 + 1;
    }
  }
  iVar5 = iVar4 * 4;
  iVar4 = (iVar1 - iVar4) + -1;
  DAT_00fc8e24 = iVar1;
  _DAT_00fc8e28 = DAT_00fc8e18;
  if (0 < iVar4) {
    _V_memmove((void *)((int)DAT_00fc8e18 + iVar5 + 4),(void *)((int)DAT_00fc8e18 + iVar5),iVar4 * 4
              );
  }
  if ((undefined4 *)(iVar5 + (int)DAT_00fc8e18) != (undefined4 *)0x0) {
    *(undefined4 *)(iVar5 + (int)DAT_00fc8e18) = pcVar2;
  }
  DataMapInit<CEntityDissolve>(CEntityDissolve*)::dataDesc._708_4_ = pcVar2;
  pcVar2 = operator_new__(DAT_00fc8e14 + 0x11);
  pcVar3 = stpcpy(pcVar2,DataMapInit<CEntityDissolve>(CEntityDissolve*)::nameHolder);
  builtin_strncpy(pcVar3,"ElectrocuteThink",0x11);
  iVar4 = DAT_00fc8e24;
  iVar1 = DAT_00fc8e24 + 1;
  if ((DAT_00fc8e1c < iVar1) && (-1 < DAT_00fc8e20)) {
    if (DAT_00fc8e20 == 0) {
      if (DAT_00fc8e1c == 0) {
        if (iVar1 < 9) {
          DAT_00fc8e1c = 8;
          goto LAB_006789ff;
        }
        DAT_00fc8e1c = 8;
      }
      do {
        DAT_00fc8e1c = DAT_00fc8e1c * 2;
      } while (DAT_00fc8e1c < iVar1);
    }
    else {
      for (DAT_00fc8e1c = (DAT_00fc8e24 / DAT_00fc8e20 + 1) * DAT_00fc8e20; DAT_00fc8e1c < iVar1;
          DAT_00fc8e1c = (DAT_00fc8e1c + iVar1) / 2) {
      }
    }
LAB_006789ff:
    if (DAT_00fc8e18 == (void *)0x0) {
      DAT_00fc8e18 = malloc(DAT_00fc8e1c << 2);
    }
    else {
      DAT_00fc8e18 = realloc(DAT_00fc8e18,DAT_00fc8e1c << 2);
      iVar1 = DAT_00fc8e24 + 1;
    }
  }
  iVar5 = iVar4 * 4;
  iVar4 = (iVar1 - iVar4) + -1;
  DAT_00fc8e24 = iVar1;
  _DAT_00fc8e28 = DAT_00fc8e18;
  if (0 < iVar4) {
    _V_memmove((void *)((int)DAT_00fc8e18 + iVar5 + 4),(void *)((int)DAT_00fc8e18 + iVar5),iVar4 * 4
              );
  }
  if ((undefined4 *)(iVar5 + (int)DAT_00fc8e18) != (undefined4 *)0x0) {
    *(undefined4 *)(iVar5 + (int)DAT_00fc8e18) = pcVar2;
  }
  DataMapInit<CEntityDissolve>(CEntityDissolve*)::dataDesc._772_4_ = pcVar2;
  __cxa_guard_release(&DataMapInit<CEntityDissolve>(CEntityDissolve*)::dataDesc);
LAB_00678749:
  CEntityDissolve::m_DataMap._4_4_ = 0xd;
  CEntityDissolve::m_DataMap._0_4_ = 0xf2fba0;
  return (datamap_t *)CEntityDissolve::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)