DataMapInit<CGibShooter>
0x0066f980 · 558 bytes · __cdecl
_Z11DataMapInitI11CGibShooterEP9datamap_tPT_
Decompiled
datamap_t * (1 param)
/* WARNING: Globals starting with '_' overlap smaller symbols at the same address */
/* datamap_t* DataMapInit<CGibShooter>(CGibShooter*) */
datamap_t * DataMapInit<CGibShooter>(CGibShooter *param_1)
{
int iVar1;
char *__dest;
char *pcVar2;
int iVar3;
int iVar4;
if ((DataMapInit<CGibShooter>(CGibShooter*)::nameHolder == '\0') &&
(iVar1 = __cxa_guard_acquire(&DataMapInit<CGibShooter>(CGibShooter*)::nameHolder), iVar1 != 0))
{
DataMapInit<CGibShooter>(CGibShooter*)::nameHolder = "CGibShooter";
DAT_00fc8698 = (void *)0x0;
DAT_00fc869c = 0;
DAT_00fc86a0 = 0;
DAT_00fc86a4 = 0;
_DAT_00fc86a8 = (void *)0x0;
_DAT_00fc8694 = 0xb;
__cxa_guard_release(&DataMapInit<CGibShooter>(CGibShooter*)::nameHolder);
__cxa_atexit(CDatadescGeneratedNameHolder::~CDatadescGeneratedNameHolder,
&DataMapInit<CGibShooter>(CGibShooter*)::nameHolder,&__dso_handle);
}
CGibShooter::m_DataMap._12_4_ = CBaseEntity::m_DataMap;
if ((DataMapInit<CGibShooter>(CGibShooter*)::dataDesc != '\0') ||
(iVar1 = __cxa_guard_acquire(&DataMapInit<CGibShooter>(CGibShooter*)::dataDesc), iVar1 == 0))
goto LAB_0066f9a9;
/* try { // try from 0066f9eb to 0066fb19 has its CatchHandler @ 0066fbc9 */
__dest = operator_new__(_DAT_00fc8694 + 0xb);
pcVar2 = stpcpy(__dest,DataMapInit<CGibShooter>(CGibShooter*)::nameHolder);
builtin_strncpy(pcVar2,"ShootThink",0xb);
iVar3 = DAT_00fc86a4;
iVar1 = DAT_00fc86a4 + 1;
if ((DAT_00fc869c < iVar1) && (-1 < DAT_00fc86a0)) {
if (DAT_00fc86a0 == 0) {
if (DAT_00fc869c == 0) {
if (iVar1 < 9) {
DAT_00fc869c = 8;
goto LAB_0066fb5f;
}
DAT_00fc869c = 8;
}
do {
DAT_00fc869c = DAT_00fc869c * 2;
} while (DAT_00fc869c < iVar1);
}
else {
for (DAT_00fc869c = (DAT_00fc86a4 / DAT_00fc86a0 + 1) * DAT_00fc86a0; DAT_00fc869c < iVar1;
DAT_00fc869c = (DAT_00fc869c + iVar1) / 2) {
}
}
LAB_0066fb5f:
if (DAT_00fc8698 == (void *)0x0) {
DAT_00fc8698 = malloc(DAT_00fc869c << 2);
}
else {
DAT_00fc8698 = realloc(DAT_00fc8698,DAT_00fc869c << 2);
iVar1 = DAT_00fc86a4 + 1;
}
}
iVar4 = iVar3 * 4;
iVar3 = (iVar1 - iVar3) + -1;
DAT_00fc86a4 = iVar1;
_DAT_00fc86a8 = DAT_00fc8698;
if (0 < iVar3) {
_V_memmove((void *)((int)DAT_00fc8698 + iVar4 + 4),(void *)((int)DAT_00fc8698 + iVar4),iVar3 * 4
);
}
if ((undefined4 *)(iVar4 + (int)DAT_00fc8698) != (undefined4 *)0x0) {
*(undefined4 *)(iVar4 + (int)DAT_00fc8698) = __dest;
}
DataMapInit<CGibShooter>(CGibShooter*)::dataDesc._1092_4_ = __dest;
__cxa_guard_release(&DataMapInit<CGibShooter>(CGibShooter*)::dataDesc);
LAB_0066f9a9:
CGibShooter::m_DataMap._4_4_ = 0x11;
CGibShooter::m_DataMap._0_4_ = 0xf2f100;
return (datamap_t *)CGibShooter::m_DataMap;
}
SourceMod gamedata
paste intoaddons/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.
Signatures + Functions block. The plugin uses
DHookCreateFromConf - DHooks reads return type, this-type,
calling convention, and argument types straight from the gamedata. Less
boilerplate in the plugin, types travel with the gamedata.
Gamedata KeyValues
DHooks plugin example
Type inference is best-effort from the C signature - sanity-check the DHooks types before shipping.