L L4D2node

DataMapInit<CPropMountedGun>

0x0054e560 · 905 bytes · __cdecl

_Z11DataMapInitI15CPropMountedGunEP9datamap_tPT_

Decompiled

datamap_t * (1 param)

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

datamap_t * DataMapInit<CPropMountedGun>(CPropMountedGun *param_1)

{
  int iVar1;
  char *pcVar2;
  char *pcVar3;
  int iVar4;
  int iVar5;
  
  if ((DataMapInit<CPropMountedGun>(CPropMountedGun*)::nameHolder == '\0') &&
     (iVar1 = __cxa_guard_acquire(&DataMapInit<CPropMountedGun>(CPropMountedGun*)::nameHolder),
     iVar1 != 0)) {
    DataMapInit<CPropMountedGun>(CPropMountedGun*)::nameHolder = "CPropMountedGun";
    DAT_00fafbf4 = (void *)0x0;
    DAT_00fafbf8 = 0;
    DAT_00fafbfc = 0;
    DAT_00fafc00 = 0;
    _DAT_00fafc04 = (void *)0x0;
    DAT_00fafbf0 = 0xf;
    __cxa_guard_release(&DataMapInit<CPropMountedGun>(CPropMountedGun*)::nameHolder);
    __cxa_atexit(CDatadescGeneratedNameHolder::~CDatadescGeneratedNameHolder,
                 &DataMapInit<CPropMountedGun>(CPropMountedGun*)::nameHolder,&__dso_handle);
  }
  CPropMountedGun::m_DataMap._12_4_ = CDynamicProp::m_DataMap;
  if ((DataMapInit<CPropMountedGun>(CPropMountedGun*)::dataDesc != '\0') ||
     (iVar1 = __cxa_guard_acquire(&DataMapInit<CPropMountedGun>(CPropMountedGun*)::dataDesc),
     iVar1 == 0)) goto LAB_0054e589;
                    /* try { // try from 0054e5cb to 0054e891 has its CatchHandler @ 0054e91e */
  pcVar2 = operator_new__(DAT_00fafbf0 + 0xb);
  pcVar3 = stpcpy(pcVar2,DataMapInit<CPropMountedGun>(CPropMountedGun*)::nameHolder);
  builtin_strncpy(pcVar3,"AngleThink",0xb);
  iVar4 = DAT_00fafc00;
  iVar1 = DAT_00fafc00 + 1;
  if ((DAT_00fafbf8 < iVar1) && (-1 < DAT_00fafbfc)) {
    if (DAT_00fafbfc == 0) {
      if (DAT_00fafbf8 == 0) {
        if (iVar1 < 9) {
          DAT_00fafbf8 = 8;
          goto LAB_0054e7cf;
        }
        DAT_00fafbf8 = 8;
      }
      do {
        DAT_00fafbf8 = DAT_00fafbf8 * 2;
      } while (DAT_00fafbf8 < iVar1);
    }
    else {
      for (DAT_00fafbf8 = (DAT_00fafc00 / DAT_00fafbfc + 1) * DAT_00fafbfc; DAT_00fafbf8 < iVar1;
          DAT_00fafbf8 = (DAT_00fafbf8 + iVar1) / 2) {
      }
    }
LAB_0054e7cf:
    if (DAT_00fafbf4 == (void *)0x0) {
      DAT_00fafbf4 = malloc(DAT_00fafbf8 << 2);
    }
    else {
      DAT_00fafbf4 = realloc(DAT_00fafbf4,DAT_00fafbf8 << 2);
      iVar1 = DAT_00fafc00 + 1;
    }
  }
  iVar5 = iVar4 * 4;
  iVar4 = (iVar1 - iVar4) + -1;
  DAT_00fafc00 = iVar1;
  _DAT_00fafc04 = DAT_00fafbf4;
  if (0 < iVar4) {
    _V_memmove((void *)((int)DAT_00fafbf4 + iVar5 + 4),(void *)((int)DAT_00fafbf4 + iVar5),iVar4 * 4
              );
  }
  if ((undefined4 *)(iVar5 + (int)DAT_00fafbf4) != (undefined4 *)0x0) {
    *(undefined4 *)(iVar5 + (int)DAT_00fafbf4) = pcVar2;
  }
  DataMapInit<CPropMountedGun>(CPropMountedGun*)::dataDesc._260_4_ = pcVar2;
  pcVar2 = operator_new__(DAT_00fafbf0 + 10);
  pcVar3 = stpcpy(pcVar2,DataMapInit<CPropMountedGun>(CPropMountedGun*)::nameHolder);
  builtin_strncpy(pcVar3,"FireThink",10);
  iVar4 = DAT_00fafc00;
  iVar1 = DAT_00fafc00 + 1;
  if ((DAT_00fafbf8 < iVar1) && (-1 < DAT_00fafbfc)) {
    if (DAT_00fafbfc == 0) {
      if (DAT_00fafbf8 == 0) {
        if (iVar1 < 9) {
          DAT_00fafbf8 = 8;
          goto LAB_0054e83f;
        }
        DAT_00fafbf8 = 8;
      }
      do {
        DAT_00fafbf8 = DAT_00fafbf8 * 2;
      } while (DAT_00fafbf8 < iVar1);
    }
    else {
      for (DAT_00fafbf8 = (DAT_00fafc00 / DAT_00fafbfc + 1) * DAT_00fafbfc; DAT_00fafbf8 < iVar1;
          DAT_00fafbf8 = (DAT_00fafbf8 + iVar1) / 2) {
      }
    }
LAB_0054e83f:
    if (DAT_00fafbf4 == (void *)0x0) {
      DAT_00fafbf4 = malloc(DAT_00fafbf8 << 2);
    }
    else {
      DAT_00fafbf4 = realloc(DAT_00fafbf4,DAT_00fafbf8 << 2);
      iVar1 = DAT_00fafc00 + 1;
    }
  }
  iVar5 = iVar4 * 4;
  iVar4 = (iVar1 - iVar4) + -1;
  DAT_00fafc00 = iVar1;
  _DAT_00fafc04 = DAT_00fafbf4;
  if (0 < iVar4) {
    _V_memmove((void *)((int)DAT_00fafbf4 + iVar5 + 4),(void *)((int)DAT_00fafbf4 + iVar5),iVar4 * 4
              );
  }
  if ((undefined4 *)(iVar5 + (int)DAT_00fafbf4) != (undefined4 *)0x0) {
    *(undefined4 *)(iVar5 + (int)DAT_00fafbf4) = pcVar2;
  }
  DataMapInit<CPropMountedGun>(CPropMountedGun*)::dataDesc._404_4_ = eventFuncs;
  DataMapInit<CPropMountedGun>(CPropMountedGun*)::dataDesc._468_4_ = eventFuncs;
  DataMapInit<CPropMountedGun>(CPropMountedGun*)::dataDesc._324_4_ = pcVar2;
  __cxa_guard_release(&DataMapInit<CPropMountedGun>(CPropMountedGun*)::dataDesc);
LAB_0054e589:
  CPropMountedGun::m_DataMap._4_4_ = 7;
  CPropMountedGun::m_DataMap._0_4_ = 0xf1e080;
  return (datamap_t *)CPropMountedGun::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)