L L4D2node

DataMapInit<CButtonTimed>

0x00638ba0 · 891 bytes · __cdecl

_Z11DataMapInitI12CButtonTimedEP9datamap_tPT_

Decompiled

datamap_t * (1 param)

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

datamap_t * DataMapInit<CButtonTimed>(CButtonTimed *param_1)

{
  int iVar1;
  char *pcVar2;
  char *pcVar3;
  int iVar4;
  int iVar5;
  
  if ((DataMapInit<CButtonTimed>(CButtonTimed*)::nameHolder == '\0') &&
     (iVar1 = __cxa_guard_acquire(&DataMapInit<CButtonTimed>(CButtonTimed*)::nameHolder), iVar1 != 0
     )) {
    DataMapInit<CButtonTimed>(CButtonTimed*)::nameHolder = "CButtonTimed";
    DAT_00fc2478 = (void *)0x0;
    DAT_00fc247c = 0;
    DAT_00fc2480 = 0;
    DAT_00fc2484 = 0;
    _DAT_00fc2488 = (void *)0x0;
    DAT_00fc2474 = 0xc;
    __cxa_guard_release(&DataMapInit<CButtonTimed>(CButtonTimed*)::nameHolder);
    __cxa_atexit(CDatadescGeneratedNameHolder::~CDatadescGeneratedNameHolder,
                 &DataMapInit<CButtonTimed>(CButtonTimed*)::nameHolder,&__dso_handle);
  }
  CButtonTimed::m_DataMap._12_4_ = CBaseButton::m_DataMap;
  if ((DataMapInit<CButtonTimed>(CButtonTimed*)::dataDesc != '\0') ||
     (iVar1 = __cxa_guard_acquire(&DataMapInit<CButtonTimed>(CButtonTimed*)::dataDesc), iVar1 == 0))
  goto LAB_00638bc9;
                    /* try { // try from 00638c0b to 00638ec1 has its CatchHandler @ 00638f4e */
  pcVar2 = operator_new__(DAT_00fc2474 + 9);
  pcVar3 = stpcpy(pcVar2,DataMapInit<CButtonTimed>(CButtonTimed*)::nameHolder);
  builtin_strncpy(pcVar3,"UseTimed",9);
  iVar4 = DAT_00fc2484;
  iVar1 = DAT_00fc2484 + 1;
  if ((DAT_00fc247c < iVar1) && (-1 < DAT_00fc2480)) {
    if (DAT_00fc2480 == 0) {
      if (DAT_00fc247c == 0) {
        if (iVar1 < 9) {
          DAT_00fc247c = 8;
          goto LAB_00638dff;
        }
        DAT_00fc247c = 8;
      }
      do {
        DAT_00fc247c = DAT_00fc247c * 2;
      } while (DAT_00fc247c < iVar1);
    }
    else {
      for (DAT_00fc247c = (DAT_00fc2484 / DAT_00fc2480 + 1) * DAT_00fc2480; DAT_00fc247c < iVar1;
          DAT_00fc247c = (DAT_00fc247c + iVar1) / 2) {
      }
    }
LAB_00638dff:
    if (DAT_00fc2478 == (void *)0x0) {
      DAT_00fc2478 = malloc(DAT_00fc247c << 2);
    }
    else {
      DAT_00fc2478 = realloc(DAT_00fc2478,DAT_00fc247c << 2);
      iVar1 = DAT_00fc2484 + 1;
    }
  }
  iVar5 = iVar4 * 4;
  iVar4 = (iVar1 - iVar4) + -1;
  DAT_00fc2484 = iVar1;
  _DAT_00fc2488 = DAT_00fc2478;
  if (0 < iVar4) {
    _V_memmove((void *)((int)DAT_00fc2478 + iVar5 + 4),(void *)((int)DAT_00fc2478 + iVar5),iVar4 * 4
              );
  }
  if ((undefined4 *)(iVar5 + (int)DAT_00fc2478) != (undefined4 *)0x0) {
    *(undefined4 *)(iVar5 + (int)DAT_00fc2478) = pcVar2;
  }
  DataMapInit<CButtonTimed>(CButtonTimed*)::dataDesc._324_4_ = pcVar2;
  pcVar2 = operator_new__(DAT_00fc2474 + 9);
  pcVar3 = stpcpy(pcVar2,DataMapInit<CButtonTimed>(CButtonTimed*)::nameHolder);
  builtin_strncpy(pcVar3,"UseThink",9);
  iVar4 = DAT_00fc2484;
  iVar1 = DAT_00fc2484 + 1;
  if ((DAT_00fc247c < iVar1) && (-1 < DAT_00fc2480)) {
    if (DAT_00fc2480 == 0) {
      if (DAT_00fc247c == 0) {
        if (iVar1 < 9) {
          DAT_00fc247c = 8;
          goto LAB_00638e6f;
        }
        DAT_00fc247c = 8;
      }
      do {
        DAT_00fc247c = DAT_00fc247c * 2;
      } while (DAT_00fc247c < iVar1);
    }
    else {
      for (DAT_00fc247c = (DAT_00fc2484 / DAT_00fc2480 + 1) * DAT_00fc2480; DAT_00fc247c < iVar1;
          DAT_00fc247c = (DAT_00fc247c + iVar1) / 2) {
      }
    }
LAB_00638e6f:
    if (DAT_00fc2478 == (void *)0x0) {
      DAT_00fc2478 = malloc(DAT_00fc247c << 2);
    }
    else {
      DAT_00fc2478 = realloc(DAT_00fc2478,DAT_00fc247c << 2);
      iVar1 = DAT_00fc2484 + 1;
    }
  }
  iVar5 = iVar4 * 4;
  iVar4 = (iVar1 - iVar4) + -1;
  DAT_00fc2484 = iVar1;
  _DAT_00fc2488 = DAT_00fc2478;
  if (0 < iVar4) {
    _V_memmove((void *)((int)DAT_00fc2478 + iVar5 + 4),(void *)((int)DAT_00fc2478 + iVar5),iVar4 * 4
              );
  }
  if ((undefined4 *)(iVar5 + (int)DAT_00fc2478) != (undefined4 *)0x0) {
    *(undefined4 *)(iVar5 + (int)DAT_00fc2478) = pcVar2;
  }
  DataMapInit<CButtonTimed>(CButtonTimed*)::dataDesc._596_4_ = eventFuncs;
  DataMapInit<CButtonTimed>(CButtonTimed*)::dataDesc._660_4_ = eventFuncs;
  DataMapInit<CButtonTimed>(CButtonTimed*)::dataDesc._388_4_ = pcVar2;
  __cxa_guard_release(&DataMapInit<CButtonTimed>(CButtonTimed*)::dataDesc);
LAB_00638bc9:
  CButtonTimed::m_DataMap._4_4_ = 10;
  CButtonTimed::m_DataMap._0_4_ = 0xf28ec0;
  return (datamap_t *)CButtonTimed::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)