DataMapInit<CWeaponCSBase>
0x0043fc40 · 888 bytes · __cdecl
_Z11DataMapInitI13CWeaponCSBaseEP9datamap_tPT_
Decompiled
datamap_t * (1 param)
/* WARNING: Globals starting with '_' overlap smaller symbols at the same address */
/* datamap_t* DataMapInit<CWeaponCSBase>(CWeaponCSBase*) */
datamap_t * DataMapInit<CWeaponCSBase>(CWeaponCSBase *param_1)
{
int iVar1;
char *pcVar2;
char *pcVar3;
int iVar4;
int iVar5;
if ((DataMapInit<CWeaponCSBase>(CWeaponCSBase*)::nameHolder == '\0') &&
(iVar1 = __cxa_guard_acquire(&DataMapInit<CWeaponCSBase>(CWeaponCSBase*)::nameHolder),
iVar1 != 0)) {
DataMapInit<CWeaponCSBase>(CWeaponCSBase*)::nameHolder = "CWeaponCSBase";
DAT_00f78f40 = (void *)0x0;
DAT_00f78f44 = 0;
DAT_00f78f48 = 0;
DAT_00f78f4c = 0;
_DAT_00f78f50 = (void *)0x0;
DAT_00f78f3c = 0xd;
__cxa_guard_release(&DataMapInit<CWeaponCSBase>(CWeaponCSBase*)::nameHolder);
__cxa_atexit(CDatadescGeneratedNameHolder::~CDatadescGeneratedNameHolder,
&DataMapInit<CWeaponCSBase>(CWeaponCSBase*)::nameHolder,&__dso_handle);
}
CWeaponCSBase::m_DataMap._12_4_ = CBaseCombatWeapon::m_DataMap;
if ((DataMapInit<CWeaponCSBase>(CWeaponCSBase*)::dataDesc != '\0') ||
(iVar1 = __cxa_guard_acquire(&DataMapInit<CWeaponCSBase>(CWeaponCSBase*)::dataDesc), iVar1 == 0
)) goto LAB_0043fc69;
/* try { // try from 0043fcab to 0043ff61 has its CatchHandler @ 0043ffee */
pcVar2 = operator_new__(DAT_00f78f3c + 10);
pcVar3 = stpcpy(pcVar2,DataMapInit<CWeaponCSBase>(CWeaponCSBase*)::nameHolder);
builtin_strncpy(pcVar3,"FallThink",10);
iVar4 = DAT_00f78f4c;
iVar1 = DAT_00f78f4c + 1;
if ((DAT_00f78f44 < iVar1) && (-1 < DAT_00f78f48)) {
if (DAT_00f78f48 == 0) {
if (DAT_00f78f44 == 0) {
if (iVar1 < 9) {
DAT_00f78f44 = 8;
goto LAB_0043fe9f;
}
DAT_00f78f44 = 8;
}
do {
DAT_00f78f44 = DAT_00f78f44 * 2;
} while (DAT_00f78f44 < iVar1);
}
else {
for (DAT_00f78f44 = (DAT_00f78f4c / DAT_00f78f48 + 1) * DAT_00f78f48; DAT_00f78f44 < iVar1;
DAT_00f78f44 = (DAT_00f78f44 + iVar1) / 2) {
}
}
LAB_0043fe9f:
if (DAT_00f78f40 == (void *)0x0) {
DAT_00f78f40 = malloc(DAT_00f78f44 << 2);
}
else {
DAT_00f78f40 = realloc(DAT_00f78f40,DAT_00f78f44 << 2);
iVar1 = DAT_00f78f4c + 1;
}
}
iVar5 = iVar4 * 4;
iVar4 = (iVar1 - iVar4) + -1;
DAT_00f78f4c = iVar1;
_DAT_00f78f50 = DAT_00f78f40;
if (0 < iVar4) {
_V_memmove((void *)((int)DAT_00f78f40 + iVar5 + 4),(void *)((int)DAT_00f78f40 + iVar5),iVar4 * 4
);
}
if ((undefined4 *)(iVar5 + (int)DAT_00f78f40) != (undefined4 *)0x0) {
*(undefined4 *)(iVar5 + (int)DAT_00f78f40) = pcVar2;
}
DataMapInit<CWeaponCSBase>(CWeaponCSBase*)::dataDesc._132_4_ = pcVar2;
pcVar2 = operator_new__(DAT_00f78f3c + 0xd);
pcVar3 = stpcpy(pcVar2,DataMapInit<CWeaponCSBase>(CWeaponCSBase*)::nameHolder);
builtin_strncpy(pcVar3,"RemovalThink",0xd);
iVar4 = DAT_00f78f4c;
iVar1 = DAT_00f78f4c + 1;
if ((DAT_00f78f44 < iVar1) && (-1 < DAT_00f78f48)) {
if (DAT_00f78f48 == 0) {
if (DAT_00f78f44 == 0) {
if (iVar1 < 9) {
DAT_00f78f44 = 8;
goto LAB_0043ff0f;
}
DAT_00f78f44 = 8;
}
do {
DAT_00f78f44 = DAT_00f78f44 * 2;
} while (DAT_00f78f44 < iVar1);
}
else {
for (DAT_00f78f44 = (DAT_00f78f4c / DAT_00f78f48 + 1) * DAT_00f78f48; DAT_00f78f44 < iVar1;
DAT_00f78f44 = (DAT_00f78f44 + iVar1) / 2) {
}
}
LAB_0043ff0f:
if (DAT_00f78f40 == (void *)0x0) {
DAT_00f78f40 = malloc(DAT_00f78f44 << 2);
}
else {
DAT_00f78f40 = realloc(DAT_00f78f40,DAT_00f78f44 << 2);
iVar1 = DAT_00f78f4c + 1;
}
}
iVar5 = iVar4 * 4;
iVar4 = (iVar1 - iVar4) + -1;
DAT_00f78f4c = iVar1;
_DAT_00f78f50 = DAT_00f78f40;
if (0 < iVar4) {
_V_memmove((void *)((int)DAT_00f78f40 + iVar5 + 4),(void *)((int)DAT_00f78f40 + iVar5),iVar4 * 4
);
}
if ((undefined4 *)(iVar5 + (int)DAT_00f78f40) != (undefined4 *)0x0) {
*(undefined4 *)(iVar5 + (int)DAT_00f78f40) = pcVar2;
}
DataMapInit<CWeaponCSBase>(CWeaponCSBase*)::dataDesc._196_4_ = pcVar2;
__cxa_guard_release(&DataMapInit<CWeaponCSBase>(CWeaponCSBase*)::dataDesc);
LAB_0043fc69:
CWeaponCSBase::m_DataMap._4_4_ = 3;
CWeaponCSBase::m_DataMap._0_4_ = 0xf157e0;
return (datamap_t *)CWeaponCSBase::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.