L L4D2node

DataMapInit<CEnvGunfire>

0x006731f0 · 558 bytes · __cdecl

_Z11DataMapInitI11CEnvGunfireEP9datamap_tPT_

Decompiled

datamap_t * (1 param)

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

datamap_t * DataMapInit<CEnvGunfire>(CEnvGunfire *param_1)

{
  int iVar1;
  char *__dest;
  char *pcVar2;
  int iVar3;
  int iVar4;
  
  if ((DataMapInit<CEnvGunfire>(CEnvGunfire*)::nameHolder == '\0') &&
     (iVar1 = __cxa_guard_acquire(&DataMapInit<CEnvGunfire>(CEnvGunfire*)::nameHolder), iVar1 != 0))
  {
    DataMapInit<CEnvGunfire>(CEnvGunfire*)::nameHolder = "CEnvGunfire";
    DAT_00fc7a3c = (void *)0x0;
    DAT_00fc7a40 = 0;
    DAT_00fc7a44 = 0;
    DAT_00fc7a48 = 0;
    _DAT_00fc7a4c = (void *)0x0;
    _DAT_00fc7a38 = 0xb;
    __cxa_guard_release(&DataMapInit<CEnvGunfire>(CEnvGunfire*)::nameHolder);
    __cxa_atexit(CDatadescGeneratedNameHolder::~CDatadescGeneratedNameHolder,
                 &DataMapInit<CEnvGunfire>(CEnvGunfire*)::nameHolder,&__dso_handle);
  }
  CEnvGunfire::m_DataMap._12_4_ = CBaseEntity::m_DataMap;
  if ((DataMapInit<CEnvGunfire>(CEnvGunfire*)::dataDesc != '\0') ||
     (iVar1 = __cxa_guard_acquire(&DataMapInit<CEnvGunfire>(CEnvGunfire*)::dataDesc), iVar1 == 0))
  goto LAB_00673219;
                    /* try { // try from 0067325b to 00673389 has its CatchHandler @ 00673439 */
  __dest = operator_new__(_DAT_00fc7a38 + 0xb);
  pcVar2 = stpcpy(__dest,DataMapInit<CEnvGunfire>(CEnvGunfire*)::nameHolder);
  builtin_strncpy(pcVar2,"ShootThink",0xb);
  iVar3 = DAT_00fc7a48;
  iVar1 = DAT_00fc7a48 + 1;
  if ((DAT_00fc7a40 < iVar1) && (-1 < DAT_00fc7a44)) {
    if (DAT_00fc7a44 == 0) {
      if (DAT_00fc7a40 == 0) {
        if (iVar1 < 9) {
          DAT_00fc7a40 = 8;
          goto LAB_006733cf;
        }
        DAT_00fc7a40 = 8;
      }
      do {
        DAT_00fc7a40 = DAT_00fc7a40 * 2;
      } while (DAT_00fc7a40 < iVar1);
    }
    else {
      for (DAT_00fc7a40 = (DAT_00fc7a48 / DAT_00fc7a44 + 1) * DAT_00fc7a44; DAT_00fc7a40 < iVar1;
          DAT_00fc7a40 = (DAT_00fc7a40 + iVar1) / 2) {
      }
    }
LAB_006733cf:
    if (DAT_00fc7a3c == (void *)0x0) {
      DAT_00fc7a3c = malloc(DAT_00fc7a40 << 2);
    }
    else {
      DAT_00fc7a3c = realloc(DAT_00fc7a3c,DAT_00fc7a40 << 2);
      iVar1 = DAT_00fc7a48 + 1;
    }
  }
  iVar4 = iVar3 * 4;
  iVar3 = (iVar1 - iVar3) + -1;
  DAT_00fc7a48 = iVar1;
  _DAT_00fc7a4c = DAT_00fc7a3c;
  if (0 < iVar3) {
    _V_memmove((void *)((int)DAT_00fc7a3c + iVar4 + 4),(void *)((int)DAT_00fc7a3c + iVar4),iVar3 * 4
              );
  }
  if ((undefined4 *)(iVar4 + (int)DAT_00fc7a3c) != (undefined4 *)0x0) {
    *(undefined4 *)(iVar4 + (int)DAT_00fc7a3c) = __dest;
  }
  DataMapInit<CEnvGunfire>(CEnvGunfire*)::dataDesc._1092_4_ = __dest;
  __cxa_guard_release(&DataMapInit<CEnvGunfire>(CEnvGunfire*)::dataDesc);
LAB_00673219:
  CEnvGunfire::m_DataMap._4_4_ = 0x13;
  CEnvGunfire::m_DataMap._0_4_ = 0xf2de40;
  return (datamap_t *)CEnvGunfire::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)