L L4D2node

DataMapInit<CBreakableSurface>

0x006b70c0 · 904 bytes · __cdecl

_Z11DataMapInitI17CBreakableSurfaceEP9datamap_tPT_

Decompiled

datamap_t * (1 param)

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

datamap_t * DataMapInit<CBreakableSurface>(CBreakableSurface *param_1)

{
  int iVar1;
  char *pcVar2;
  char *pcVar3;
  int iVar4;
  int iVar5;
  
  if ((DataMapInit<CBreakableSurface>(CBreakableSurface*)::nameHolder == '\0') &&
     (iVar1 = __cxa_guard_acquire(&DataMapInit<CBreakableSurface>(CBreakableSurface*)::nameHolder),
     iVar1 != 0)) {
    DataMapInit<CBreakableSurface>(CBreakableSurface*)::nameHolder = "CBreakableSurface";
    DAT_00fe0b58 = (void *)0x0;
    DAT_00fe0b5c = 0;
    DAT_00fe0b60 = 0;
    DAT_00fe0b64 = 0;
    _DAT_00fe0b68 = (void *)0x0;
    DAT_00fe0b54 = 0x11;
    __cxa_guard_release(&DataMapInit<CBreakableSurface>(CBreakableSurface*)::nameHolder);
    __cxa_atexit(CDatadescGeneratedNameHolder::~CDatadescGeneratedNameHolder,
                 &DataMapInit<CBreakableSurface>(CBreakableSurface*)::nameHolder,&__dso_handle);
  }
  CBreakableSurface::m_DataMap._12_4_ = CBreakable::m_DataMap;
  if ((DataMapInit<CBreakableSurface>(CBreakableSurface*)::dataDesc != '\0') ||
     (iVar1 = __cxa_guard_acquire(&DataMapInit<CBreakableSurface>(CBreakableSurface*)::dataDesc),
     iVar1 == 0)) goto LAB_006b70e9;
  DataMapInit<CBreakableSurface>(CBreakableSurface*)::dataDesc._1036_2_ = 0x100;
                    /* try { // try from 006b7137 to 006b73f1 has its CatchHandler @ 006b747e */
  pcVar2 = operator_new__(DAT_00fe0b54 + 0xb);
  pcVar3 = stpcpy(pcVar2,DataMapInit<CBreakableSurface>(CBreakableSurface*)::nameHolder);
  builtin_strncpy(pcVar3,"BreakThink",0xb);
  iVar4 = DAT_00fe0b64;
  iVar1 = DAT_00fe0b64 + 1;
  if ((DAT_00fe0b5c < iVar1) && (-1 < DAT_00fe0b60)) {
    if (DAT_00fe0b60 == 0) {
      if (DAT_00fe0b5c == 0) {
        if (iVar1 < 9) {
          DAT_00fe0b5c = 8;
          goto LAB_006b732f;
        }
        DAT_00fe0b5c = 8;
      }
      do {
        DAT_00fe0b5c = DAT_00fe0b5c * 2;
      } while (DAT_00fe0b5c < iVar1);
    }
    else {
      for (DAT_00fe0b5c = (DAT_00fe0b64 / DAT_00fe0b60 + 1) * DAT_00fe0b60; DAT_00fe0b5c < iVar1;
          DAT_00fe0b5c = (DAT_00fe0b5c + iVar1) / 2) {
      }
    }
LAB_006b732f:
    if (DAT_00fe0b58 == (void *)0x0) {
      DAT_00fe0b58 = malloc(DAT_00fe0b5c << 2);
    }
    else {
      DAT_00fe0b58 = realloc(DAT_00fe0b58,DAT_00fe0b5c << 2);
      iVar1 = DAT_00fe0b64 + 1;
    }
  }
  iVar5 = iVar4 * 4;
  iVar4 = (iVar1 - iVar4) + -1;
  DAT_00fe0b64 = iVar1;
  _DAT_00fe0b68 = DAT_00fe0b58;
  if (0 < iVar4) {
    _V_memmove((void *)((int)DAT_00fe0b58 + iVar5 + 4),(void *)((int)DAT_00fe0b58 + iVar5),iVar4 * 4
              );
  }
  if ((undefined4 *)(iVar5 + (int)DAT_00fe0b58) != (undefined4 *)0x0) {
    *(undefined4 *)(iVar5 + (int)DAT_00fe0b58) = pcVar2;
  }
  DataMapInit<CBreakableSurface>(CBreakableSurface*)::dataDesc._1156_4_ = pcVar2;
  pcVar2 = operator_new__(DAT_00fe0b54 + 0xd);
  pcVar3 = stpcpy(pcVar2,DataMapInit<CBreakableSurface>(CBreakableSurface*)::nameHolder);
  builtin_strncpy(pcVar3,"SurfaceTouch",0xd);
  iVar4 = DAT_00fe0b64;
  iVar1 = DAT_00fe0b64 + 1;
  if ((DAT_00fe0b5c < iVar1) && (-1 < DAT_00fe0b60)) {
    if (DAT_00fe0b60 == 0) {
      if (DAT_00fe0b5c == 0) {
        if (iVar1 < 9) {
          DAT_00fe0b5c = 8;
          goto LAB_006b739f;
        }
        DAT_00fe0b5c = 8;
      }
      do {
        DAT_00fe0b5c = DAT_00fe0b5c * 2;
      } while (DAT_00fe0b5c < iVar1);
    }
    else {
      for (DAT_00fe0b5c = (DAT_00fe0b64 / DAT_00fe0b60 + 1) * DAT_00fe0b60; DAT_00fe0b5c < iVar1;
          DAT_00fe0b5c = (DAT_00fe0b5c + iVar1) / 2) {
      }
    }
LAB_006b739f:
    if (DAT_00fe0b58 == (void *)0x0) {
      DAT_00fe0b58 = malloc(DAT_00fe0b5c << 2);
    }
    else {
      DAT_00fe0b58 = realloc(DAT_00fe0b58,DAT_00fe0b5c << 2);
      iVar1 = DAT_00fe0b64 + 1;
    }
  }
  iVar5 = iVar4 * 4;
  iVar4 = (iVar1 - iVar4) + -1;
  DAT_00fe0b64 = iVar1;
  _DAT_00fe0b68 = DAT_00fe0b58;
  if (0 < iVar4) {
    _V_memmove((void *)((int)DAT_00fe0b58 + iVar5 + 4),(void *)((int)DAT_00fe0b58 + iVar5),iVar4 * 4
              );
  }
  if ((undefined4 *)(iVar5 + (int)DAT_00fe0b58) != (undefined4 *)0x0) {
    *(undefined4 *)(iVar5 + (int)DAT_00fe0b58) = pcVar2;
  }
  DataMapInit<CBreakableSurface>(CBreakableSurface*)::dataDesc._1220_4_ = pcVar2;
  __cxa_guard_release(&DataMapInit<CBreakableSurface>(CBreakableSurface*)::dataDesc);
LAB_006b70e9:
  CBreakableSurface::m_DataMap._4_4_ = 0x14;
  CBreakableSurface::m_DataMap._0_4_ = 0xf39b60;
  return (datamap_t *)CBreakableSurface::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)