DataMapInit<CMomentaryRotButton>
0x00637780 · 1579 bytes · __cdecl
_Z11DataMapInitI19CMomentaryRotButtonEP9datamap_tPT_
Decompiled
datamap_t * (1 param)
/* WARNING: Globals starting with '_' overlap smaller symbols at the same address */
/* datamap_t* DataMapInit<CMomentaryRotButton>(CMomentaryRotButton*) */
datamap_t * DataMapInit<CMomentaryRotButton>(CMomentaryRotButton *param_1)
{
int iVar1;
char *pcVar2;
char *pcVar3;
int iVar4;
int iVar5;
if ((DataMapInit<CMomentaryRotButton>(CMomentaryRotButton*)::nameHolder == '\0') &&
(iVar1 = __cxa_guard_acquire(&DataMapInit<CMomentaryRotButton>(CMomentaryRotButton*)::
nameHolder), iVar1 != 0)) {
DataMapInit<CMomentaryRotButton>(CMomentaryRotButton*)::nameHolder = "CMomentaryRotButton";
DAT_00fc2494 = (void *)0x0;
DAT_00fc2498 = 0;
DAT_00fc249c = 0;
DAT_00fc24a0 = 0;
_DAT_00fc24a4 = (void *)0x0;
DAT_00fc2490 = 0x13;
__cxa_guard_release(&DataMapInit<CMomentaryRotButton>(CMomentaryRotButton*)::nameHolder);
__cxa_atexit(CDatadescGeneratedNameHolder::~CDatadescGeneratedNameHolder,
&DataMapInit<CMomentaryRotButton>(CMomentaryRotButton*)::nameHolder,&__dso_handle);
}
CMomentaryRotButton::m_DataMap._12_4_ = CBaseButton::m_DataMap;
if ((DataMapInit<CMomentaryRotButton>(CMomentaryRotButton*)::dataDesc != '\0') ||
(iVar1 = __cxa_guard_acquire(&DataMapInit<CMomentaryRotButton>(CMomentaryRotButton*)::dataDesc)
, iVar1 == 0)) goto LAB_006377a9;
/* try { // try from 006377eb to 00637cf1 has its CatchHandler @ 00637e02 */
pcVar2 = operator_new__(DAT_00fc2490 + 0xc);
pcVar3 = stpcpy(pcVar2,DataMapInit<CMomentaryRotButton>(CMomentaryRotButton*)::nameHolder);
builtin_strncpy(pcVar3,"UseMoveDone",0xc);
iVar4 = DAT_00fc24a0;
iVar1 = DAT_00fc24a0 + 1;
if ((DAT_00fc2498 < iVar1) && (-1 < DAT_00fc249c)) {
if (DAT_00fc249c == 0) {
if (DAT_00fc2498 == 0) {
if (iVar1 < 9) {
DAT_00fc2498 = 8;
goto LAB_00637aff;
}
DAT_00fc2498 = 8;
}
do {
DAT_00fc2498 = DAT_00fc2498 * 2;
} while (DAT_00fc2498 < iVar1);
}
else {
for (DAT_00fc2498 = (DAT_00fc24a0 / DAT_00fc249c + 1) * DAT_00fc249c; DAT_00fc2498 < iVar1;
DAT_00fc2498 = (DAT_00fc2498 + iVar1) / 2) {
}
}
LAB_00637aff:
if (DAT_00fc2494 == (void *)0x0) {
DAT_00fc2494 = malloc(DAT_00fc2498 << 2);
}
else {
DAT_00fc2494 = realloc(DAT_00fc2494,DAT_00fc2498 << 2);
iVar1 = DAT_00fc24a0 + 1;
}
}
iVar5 = iVar4 * 4;
iVar4 = (iVar1 - iVar4) + -1;
DAT_00fc24a0 = iVar1;
_DAT_00fc24a4 = DAT_00fc2494;
if (0 < iVar4) {
_V_memmove((void *)((int)DAT_00fc2494 + iVar5 + 4),(void *)((int)DAT_00fc2494 + iVar5),iVar4 * 4
);
}
if ((undefined4 *)(iVar5 + (int)DAT_00fc2494) != (undefined4 *)0x0) {
*(undefined4 *)(iVar5 + (int)DAT_00fc2494) = pcVar2;
}
DataMapInit<CMomentaryRotButton>(CMomentaryRotButton*)::dataDesc._708_4_ = pcVar2;
pcVar2 = operator_new__(DAT_00fc2490 + 0xf);
pcVar3 = stpcpy(pcVar2,DataMapInit<CMomentaryRotButton>(CMomentaryRotButton*)::nameHolder);
builtin_strncpy(pcVar3,"ReturnMoveDone",0xf);
iVar4 = DAT_00fc24a0;
iVar1 = DAT_00fc24a0 + 1;
if ((DAT_00fc2498 < iVar1) && (-1 < DAT_00fc249c)) {
if (DAT_00fc249c == 0) {
if (DAT_00fc2498 == 0) {
if (iVar1 < 9) {
DAT_00fc2498 = 8;
goto LAB_00637b6f;
}
DAT_00fc2498 = 8;
}
do {
DAT_00fc2498 = DAT_00fc2498 * 2;
} while (DAT_00fc2498 < iVar1);
}
else {
for (DAT_00fc2498 = (DAT_00fc24a0 / DAT_00fc249c + 1) * DAT_00fc249c; DAT_00fc2498 < iVar1;
DAT_00fc2498 = (DAT_00fc2498 + iVar1) / 2) {
}
}
LAB_00637b6f:
if (DAT_00fc2494 == (void *)0x0) {
DAT_00fc2494 = malloc(DAT_00fc2498 << 2);
}
else {
DAT_00fc2494 = realloc(DAT_00fc2494,DAT_00fc2498 << 2);
iVar1 = DAT_00fc24a0 + 1;
}
}
iVar5 = iVar4 * 4;
iVar4 = (iVar1 - iVar4) + -1;
DAT_00fc24a0 = iVar1;
_DAT_00fc24a4 = DAT_00fc2494;
if (0 < iVar4) {
_V_memmove((void *)((int)DAT_00fc2494 + iVar5 + 4),(void *)((int)DAT_00fc2494 + iVar5),iVar4 * 4
);
}
if ((undefined4 *)(iVar5 + (int)DAT_00fc2494) != (undefined4 *)0x0) {
*(undefined4 *)(iVar5 + (int)DAT_00fc2494) = pcVar2;
}
DataMapInit<CMomentaryRotButton>(CMomentaryRotButton*)::dataDesc._772_4_ = pcVar2;
pcVar2 = operator_new__(DAT_00fc2490 + 0x14);
pcVar3 = stpcpy(pcVar2,DataMapInit<CMomentaryRotButton>(CMomentaryRotButton*)::nameHolder);
builtin_strncpy(pcVar3,"SetPositionMoveDone",0x14);
iVar4 = DAT_00fc24a0;
iVar1 = DAT_00fc24a0 + 1;
if ((DAT_00fc2498 < iVar1) && (-1 < DAT_00fc249c)) {
if (DAT_00fc249c == 0) {
if (DAT_00fc2498 == 0) {
if (iVar1 < 9) {
DAT_00fc2498 = 8;
goto LAB_00637c9f;
}
DAT_00fc2498 = 8;
}
do {
DAT_00fc2498 = DAT_00fc2498 * 2;
} while (DAT_00fc2498 < iVar1);
}
else {
for (DAT_00fc2498 = (DAT_00fc24a0 / DAT_00fc249c + 1) * DAT_00fc249c; DAT_00fc2498 < iVar1;
DAT_00fc2498 = (DAT_00fc2498 + iVar1) / 2) {
}
}
LAB_00637c9f:
if (DAT_00fc2494 == (void *)0x0) {
DAT_00fc2494 = malloc(DAT_00fc2498 << 2);
}
else {
DAT_00fc2494 = realloc(DAT_00fc2494,DAT_00fc2498 << 2);
iVar1 = DAT_00fc24a0 + 1;
}
}
iVar5 = iVar4 * 4;
iVar4 = (iVar1 - iVar4) + -1;
DAT_00fc24a0 = iVar1;
_DAT_00fc24a4 = DAT_00fc2494;
if (0 < iVar4) {
_V_memmove((void *)((int)DAT_00fc2494 + iVar5 + 4),(void *)((int)DAT_00fc2494 + iVar5),iVar4 * 4
);
}
if ((undefined4 *)(iVar5 + (int)DAT_00fc2494) != (undefined4 *)0x0) {
*(undefined4 *)(iVar5 + (int)DAT_00fc2494) = pcVar2;
}
DataMapInit<CMomentaryRotButton>(CMomentaryRotButton*)::dataDesc._836_4_ = pcVar2;
pcVar2 = operator_new__(DAT_00fc2490 + 0xc);
pcVar3 = stpcpy(pcVar2,DataMapInit<CMomentaryRotButton>(CMomentaryRotButton*)::nameHolder);
builtin_strncpy(pcVar3,"UpdateThink",0xc);
iVar4 = DAT_00fc24a0;
iVar1 = DAT_00fc24a0 + 1;
if ((DAT_00fc2498 < iVar1) && (-1 < DAT_00fc249c)) {
if (DAT_00fc249c == 0) {
if (DAT_00fc2498 == 0) {
if (iVar1 < 9) {
DAT_00fc2498 = 8;
goto LAB_00637c07;
}
DAT_00fc2498 = 8;
}
do {
DAT_00fc2498 = DAT_00fc2498 * 2;
} while (DAT_00fc2498 < iVar1);
}
else {
for (DAT_00fc2498 = (DAT_00fc24a0 / DAT_00fc249c + 1) * DAT_00fc249c; DAT_00fc2498 < iVar1;
DAT_00fc2498 = (DAT_00fc2498 + iVar1) / 2) {
}
}
LAB_00637c07:
if (DAT_00fc2494 == (void *)0x0) {
DAT_00fc2494 = malloc(DAT_00fc2498 << 2);
}
else {
DAT_00fc2494 = realloc(DAT_00fc2494,DAT_00fc2498 << 2);
iVar1 = DAT_00fc24a0 + 1;
}
}
iVar5 = iVar4 * 4;
iVar4 = (iVar1 - iVar4) + -1;
DAT_00fc24a0 = iVar1;
_DAT_00fc24a4 = DAT_00fc2494;
if (0 < iVar4) {
_V_memmove((void *)((int)DAT_00fc2494 + iVar5 + 4),(void *)((int)DAT_00fc2494 + iVar5),iVar4 * 4
);
}
if ((undefined4 *)(iVar5 + (int)DAT_00fc2494) != (undefined4 *)0x0) {
*(undefined4 *)(iVar5 + (int)DAT_00fc2494) = pcVar2;
}
DataMapInit<CMomentaryRotButton>(CMomentaryRotButton*)::dataDesc._1236_4_ = eventFuncs;
DataMapInit<CMomentaryRotButton>(CMomentaryRotButton*)::dataDesc._1300_4_ = eventFuncs;
DataMapInit<CMomentaryRotButton>(CMomentaryRotButton*)::dataDesc._1364_4_ = eventFuncs;
DataMapInit<CMomentaryRotButton>(CMomentaryRotButton*)::dataDesc._1428_4_ = eventFuncs;
DataMapInit<CMomentaryRotButton>(CMomentaryRotButton*)::dataDesc._1492_4_ = eventFuncs;
DataMapInit<CMomentaryRotButton>(CMomentaryRotButton*)::dataDesc._900_4_ = pcVar2;
__cxa_guard_release(&DataMapInit<CMomentaryRotButton>(CMomentaryRotButton*)::dataDesc);
LAB_006377a9:
CMomentaryRotButton::m_DataMap._4_4_ = 0x1a;
CMomentaryRotButton::m_DataMap._0_4_ = 0xf29180;
return (datamap_t *)CMomentaryRotButton::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.