DataMapInit<CFuncTrainControls>
0x00b0de10 · 542 bytes · __cdecl
_Z11DataMapInitI18CFuncTrainControlsEP9datamap_tPT_
Decompiled
datamap_t * (1 param)
/* WARNING: Globals starting with '_' overlap smaller symbols at the same address */
/* datamap_t* DataMapInit<CFuncTrainControls>(CFuncTrainControls*) */
datamap_t * DataMapInit<CFuncTrainControls>(CFuncTrainControls *param_1)
{
int iVar1;
char *__dest;
char *pcVar2;
int iVar3;
int iVar4;
if ((DataMapInit<CFuncTrainControls>(CFuncTrainControls*)::nameHolder == '\0') &&
(iVar1 = __cxa_guard_acquire(&DataMapInit<CFuncTrainControls>(CFuncTrainControls*)::nameHolder)
, iVar1 != 0)) {
DataMapInit<CFuncTrainControls>(CFuncTrainControls*)::nameHolder = "CFuncTrainControls";
DAT_01034238 = (void *)0x0;
DAT_0103423c = 0;
DAT_01034240 = 0;
DAT_01034244 = 0;
_DAT_01034248 = (void *)0x0;
_DAT_01034234 = 0x12;
__cxa_guard_release(&DataMapInit<CFuncTrainControls>(CFuncTrainControls*)::nameHolder);
__cxa_atexit(CDatadescGeneratedNameHolder::~CDatadescGeneratedNameHolder,
&DataMapInit<CFuncTrainControls>(CFuncTrainControls*)::nameHolder,&__dso_handle);
}
CFuncTrainControls::m_DataMap._12_4_ = CBaseEntity::m_DataMap;
if ((DataMapInit<CFuncTrainControls>(CFuncTrainControls*)::dataDesc != '\0') ||
(iVar1 = __cxa_guard_acquire(&DataMapInit<CFuncTrainControls>(CFuncTrainControls*)::dataDesc),
iVar1 == 0)) goto LAB_00b0de39;
/* try { // try from 00b0de7b to 00b0df99 has its CatchHandler @ 00b0e049 */
__dest = operator_new__(_DAT_01034234 + 5);
pcVar2 = stpcpy(__dest,DataMapInit<CFuncTrainControls>(CFuncTrainControls*)::nameHolder);
builtin_strncpy(pcVar2,"Find",5);
iVar3 = DAT_01034244;
iVar1 = DAT_01034244 + 1;
if ((DAT_0103423c < iVar1) && (-1 < DAT_01034240)) {
if (DAT_01034240 == 0) {
if (DAT_0103423c == 0) {
if (iVar1 < 9) {
DAT_0103423c = 8;
goto LAB_00b0dfdf;
}
DAT_0103423c = 8;
}
do {
DAT_0103423c = DAT_0103423c * 2;
} while (DAT_0103423c < iVar1);
}
else {
for (DAT_0103423c = (DAT_01034244 / DAT_01034240 + 1) * DAT_01034240; DAT_0103423c < iVar1;
DAT_0103423c = (DAT_0103423c + iVar1) / 2) {
}
}
LAB_00b0dfdf:
if (DAT_01034238 == (void *)0x0) {
DAT_01034238 = malloc(DAT_0103423c << 2);
}
else {
DAT_01034238 = realloc(DAT_01034238,DAT_0103423c << 2);
iVar1 = DAT_01034244 + 1;
}
}
iVar4 = iVar3 * 4;
iVar3 = (iVar1 - iVar3) + -1;
DAT_01034244 = iVar1;
_DAT_01034248 = DAT_01034238;
if (0 < iVar3) {
_V_memmove((void *)((int)DAT_01034238 + iVar4 + 4),(void *)((int)DAT_01034238 + iVar4),iVar3 * 4
);
}
if ((undefined4 *)(iVar4 + (int)DAT_01034238) != (undefined4 *)0x0) {
*(undefined4 *)(iVar4 + (int)DAT_01034238) = __dest;
}
DataMapInit<CFuncTrainControls>(CFuncTrainControls*)::dataDesc._68_4_ = __dest;
__cxa_guard_release(&DataMapInit<CFuncTrainControls>(CFuncTrainControls*)::dataDesc);
LAB_00b0de39:
CFuncTrainControls::m_DataMap._4_4_ = 1;
CFuncTrainControls::m_DataMap._0_4_ = 0xf61d80;
return (datamap_t *)CFuncTrainControls::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.