DataMapInit<CBaseGrenade>
0x00413820 · 3143 bytes · __cdecl
_Z11DataMapInitI12CBaseGrenadeEP9datamap_tPT_
Decompiled
datamap_t * (1 param)
/* WARNING: Globals starting with '_' overlap smaller symbols at the same address */
/* datamap_t* DataMapInit<CBaseGrenade>(CBaseGrenade*) */
datamap_t * DataMapInit<CBaseGrenade>(CBaseGrenade *param_1)
{
int iVar1;
char *pcVar2;
char *pcVar3;
int iVar4;
int iVar5;
if ((DataMapInit<CBaseGrenade>(CBaseGrenade*)::nameHolder == '\0') &&
(iVar1 = __cxa_guard_acquire(&DataMapInit<CBaseGrenade>(CBaseGrenade*)::nameHolder), iVar1 != 0
)) {
DataMapInit<CBaseGrenade>(CBaseGrenade*)::nameHolder = "CBaseGrenade";
DAT_00f74c8c = (void *)0x0;
DAT_00f74c90 = 0;
DAT_00f74c94 = 0;
DAT_00f74c98 = 0;
_DAT_00f74c9c = (void *)0x0;
DAT_00f74c88 = 0xc;
__cxa_guard_release(&DataMapInit<CBaseGrenade>(CBaseGrenade*)::nameHolder);
__cxa_atexit(CDatadescGeneratedNameHolder::~CDatadescGeneratedNameHolder,
&DataMapInit<CBaseGrenade>(CBaseGrenade*)::nameHolder,&__dso_handle);
}
CBaseGrenade::m_DataMap._12_4_ = CBaseCombatCharacter::m_DataMap;
if ((DataMapInit<CBaseGrenade>(CBaseGrenade*)::dataDesc != '\0') ||
(iVar1 = __cxa_guard_acquire(&DataMapInit<CBaseGrenade>(CBaseGrenade*)::dataDesc), iVar1 == 0))
goto LAB_00413849;
/* try { // try from 0041388b to 004142b9 has its CatchHandler @ 0041451c */
pcVar2 = operator_new__(DAT_00f74c88 + 6);
pcVar3 = stpcpy(pcVar2,DataMapInit<CBaseGrenade>(CBaseGrenade*)::nameHolder);
builtin_strncpy(pcVar3,"Smoke",6);
iVar4 = DAT_00f74c98;
iVar1 = DAT_00f74c98 + 1;
if ((DAT_00f74c90 < iVar1) && (-1 < DAT_00f74c94)) {
if (DAT_00f74c94 == 0) {
if (DAT_00f74c90 == 0) {
if (iVar1 < 9) {
DAT_00f74c90 = 8;
goto LAB_00413e67;
}
DAT_00f74c90 = 8;
}
do {
DAT_00f74c90 = DAT_00f74c90 * 2;
} while (DAT_00f74c90 < iVar1);
}
else {
for (DAT_00f74c90 = (DAT_00f74c98 / DAT_00f74c94 + 1) * DAT_00f74c94; DAT_00f74c90 < iVar1;
DAT_00f74c90 = (DAT_00f74c90 + iVar1) / 2) {
}
}
LAB_00413e67:
if (DAT_00f74c8c == (void *)0x0) {
DAT_00f74c8c = malloc(DAT_00f74c90 << 2);
}
else {
DAT_00f74c8c = realloc(DAT_00f74c8c,DAT_00f74c90 << 2);
iVar1 = DAT_00f74c98 + 1;
}
}
iVar5 = iVar4 * 4;
iVar4 = (iVar1 - iVar4) + -1;
DAT_00f74c98 = iVar1;
_DAT_00f74c9c = DAT_00f74c8c;
if (0 < iVar4) {
_V_memmove((void *)((int)DAT_00f74c8c + iVar5 + 4),(void *)((int)DAT_00f74c8c + iVar5),iVar4 * 4
);
}
if ((undefined4 *)(iVar5 + (int)DAT_00f74c8c) != (undefined4 *)0x0) {
*(undefined4 *)(iVar5 + (int)DAT_00f74c8c) = pcVar2;
}
DataMapInit<CBaseGrenade>(CBaseGrenade*)::dataDesc._580_4_ = pcVar2;
pcVar2 = operator_new__(DAT_00f74c88 + 0xc);
pcVar3 = stpcpy(pcVar2,DataMapInit<CBaseGrenade>(CBaseGrenade*)::nameHolder);
builtin_strncpy(pcVar3,"BounceTouch",0xc);
iVar4 = DAT_00f74c98;
iVar1 = DAT_00f74c98 + 1;
if ((DAT_00f74c90 < iVar1) && (-1 < DAT_00f74c94)) {
if (DAT_00f74c94 == 0) {
if (DAT_00f74c90 == 0) {
if (iVar1 < 9) {
DAT_00f74c90 = 8;
goto LAB_00413ed7;
}
DAT_00f74c90 = 8;
}
do {
DAT_00f74c90 = DAT_00f74c90 * 2;
} while (DAT_00f74c90 < iVar1);
}
else {
for (DAT_00f74c90 = (DAT_00f74c98 / DAT_00f74c94 + 1) * DAT_00f74c94; DAT_00f74c90 < iVar1;
DAT_00f74c90 = (DAT_00f74c90 + iVar1) / 2) {
}
}
LAB_00413ed7:
if (DAT_00f74c8c == (void *)0x0) {
DAT_00f74c8c = malloc(DAT_00f74c90 << 2);
}
else {
DAT_00f74c8c = realloc(DAT_00f74c8c,DAT_00f74c90 << 2);
iVar1 = DAT_00f74c98 + 1;
}
}
iVar5 = iVar4 * 4;
iVar4 = (iVar1 - iVar4) + -1;
DAT_00f74c98 = iVar1;
_DAT_00f74c9c = DAT_00f74c8c;
if (0 < iVar4) {
_V_memmove((void *)((int)DAT_00f74c8c + iVar5 + 4),(void *)((int)DAT_00f74c8c + iVar5),iVar4 * 4
);
}
if ((undefined4 *)(iVar5 + (int)DAT_00f74c8c) != (undefined4 *)0x0) {
*(undefined4 *)(iVar5 + (int)DAT_00f74c8c) = pcVar2;
}
DataMapInit<CBaseGrenade>(CBaseGrenade*)::dataDesc._644_4_ = pcVar2;
pcVar2 = operator_new__(DAT_00f74c88 + 0xb);
pcVar3 = stpcpy(pcVar2,DataMapInit<CBaseGrenade>(CBaseGrenade*)::nameHolder);
builtin_strncpy(pcVar3,"SlideTouch",0xb);
iVar4 = DAT_00f74c98;
iVar1 = DAT_00f74c98 + 1;
if ((DAT_00f74c90 < iVar1) && (-1 < DAT_00f74c94)) {
if (DAT_00f74c94 == 0) {
if (DAT_00f74c90 == 0) {
if (iVar1 < 9) {
DAT_00f74c90 = 8;
goto LAB_00414007;
}
DAT_00f74c90 = 8;
}
do {
DAT_00f74c90 = DAT_00f74c90 * 2;
} while (DAT_00f74c90 < iVar1);
}
else {
for (DAT_00f74c90 = (DAT_00f74c98 / DAT_00f74c94 + 1) * DAT_00f74c94; DAT_00f74c90 < iVar1;
DAT_00f74c90 = (DAT_00f74c90 + iVar1) / 2) {
}
}
LAB_00414007:
if (DAT_00f74c8c == (void *)0x0) {
DAT_00f74c8c = malloc(DAT_00f74c90 << 2);
}
else {
DAT_00f74c8c = realloc(DAT_00f74c8c,DAT_00f74c90 << 2);
iVar1 = DAT_00f74c98 + 1;
}
}
iVar5 = iVar4 * 4;
iVar4 = (iVar1 - iVar4) + -1;
DAT_00f74c98 = iVar1;
_DAT_00f74c9c = DAT_00f74c8c;
if (0 < iVar4) {
_V_memmove((void *)((int)DAT_00f74c8c + iVar5 + 4),(void *)((int)DAT_00f74c8c + iVar5),iVar4 * 4
);
}
if ((undefined4 *)(iVar5 + (int)DAT_00f74c8c) != (undefined4 *)0x0) {
*(undefined4 *)(iVar5 + (int)DAT_00f74c8c) = pcVar2;
}
DataMapInit<CBaseGrenade>(CBaseGrenade*)::dataDesc._708_4_ = pcVar2;
pcVar2 = operator_new__(DAT_00f74c88 + 0xd);
pcVar3 = stpcpy(pcVar2,DataMapInit<CBaseGrenade>(CBaseGrenade*)::nameHolder);
builtin_strncpy(pcVar3,"ExplodeTouch",0xd);
iVar4 = DAT_00f74c98;
iVar1 = DAT_00f74c98 + 1;
if ((DAT_00f74c90 < iVar1) && (-1 < DAT_00f74c94)) {
if (DAT_00f74c94 == 0) {
if (DAT_00f74c90 == 0) {
if (iVar1 < 9) {
DAT_00f74c90 = 8;
goto LAB_00413f6f;
}
DAT_00f74c90 = 8;
}
do {
DAT_00f74c90 = DAT_00f74c90 * 2;
} while (DAT_00f74c90 < iVar1);
}
else {
for (DAT_00f74c90 = (DAT_00f74c98 / DAT_00f74c94 + 1) * DAT_00f74c94; DAT_00f74c90 < iVar1;
DAT_00f74c90 = (DAT_00f74c90 + iVar1) / 2) {
}
}
LAB_00413f6f:
if (DAT_00f74c8c == (void *)0x0) {
DAT_00f74c8c = malloc(DAT_00f74c90 << 2);
}
else {
DAT_00f74c8c = realloc(DAT_00f74c8c,DAT_00f74c90 << 2);
iVar1 = DAT_00f74c98 + 1;
}
}
iVar5 = iVar4 * 4;
iVar4 = (iVar1 - iVar4) + -1;
DAT_00f74c98 = iVar1;
_DAT_00f74c9c = DAT_00f74c8c;
if (0 < iVar4) {
_V_memmove((void *)((int)DAT_00f74c8c + iVar5 + 4),(void *)((int)DAT_00f74c8c + iVar5),iVar4 * 4
);
}
if ((undefined4 *)(iVar5 + (int)DAT_00f74c8c) != (undefined4 *)0x0) {
*(undefined4 *)(iVar5 + (int)DAT_00f74c8c) = pcVar2;
}
DataMapInit<CBaseGrenade>(CBaseGrenade*)::dataDesc._772_4_ = pcVar2;
pcVar2 = operator_new__(DAT_00f74c88 + 0xc);
pcVar3 = stpcpy(pcVar2,DataMapInit<CBaseGrenade>(CBaseGrenade*)::nameHolder);
builtin_strncpy(pcVar3,"DetonateUse",0xc);
iVar4 = DAT_00f74c98;
iVar1 = DAT_00f74c98 + 1;
if ((DAT_00f74c90 < iVar1) && (-1 < DAT_00f74c94)) {
if (DAT_00f74c94 == 0) {
if (DAT_00f74c90 == 0) {
if (iVar1 < 9) {
DAT_00f74c90 = 8;
goto LAB_00414267;
}
DAT_00f74c90 = 8;
}
do {
DAT_00f74c90 = DAT_00f74c90 * 2;
} while (DAT_00f74c90 < iVar1);
}
else {
for (DAT_00f74c90 = (DAT_00f74c98 / DAT_00f74c94 + 1) * DAT_00f74c94; DAT_00f74c90 < iVar1;
DAT_00f74c90 = (DAT_00f74c90 + iVar1) / 2) {
}
}
LAB_00414267:
if (DAT_00f74c8c == (void *)0x0) {
DAT_00f74c8c = malloc(DAT_00f74c90 << 2);
}
else {
DAT_00f74c8c = realloc(DAT_00f74c8c,DAT_00f74c90 << 2);
iVar1 = DAT_00f74c98 + 1;
}
}
iVar5 = iVar4 * 4;
iVar4 = (iVar1 - iVar4) + -1;
DAT_00f74c98 = iVar1;
_DAT_00f74c9c = DAT_00f74c8c;
if (0 < iVar4) {
_V_memmove((void *)((int)DAT_00f74c8c + iVar5 + 4),(void *)((int)DAT_00f74c8c + iVar5),iVar4 * 4
);
}
if ((undefined4 *)(iVar5 + (int)DAT_00f74c8c) != (undefined4 *)0x0) {
*(undefined4 *)(iVar5 + (int)DAT_00f74c8c) = pcVar2;
}
DataMapInit<CBaseGrenade>(CBaseGrenade*)::dataDesc._836_4_ = pcVar2;
pcVar2 = operator_new__(DAT_00f74c88 + 0x11);
pcVar3 = stpcpy(pcVar2,DataMapInit<CBaseGrenade>(CBaseGrenade*)::nameHolder);
builtin_strncpy(pcVar3,"DangerSoundThink",0x11);
iVar4 = DAT_00f74c98;
iVar1 = DAT_00f74c98 + 1;
if ((DAT_00f74c90 < iVar1) && (-1 < DAT_00f74c94)) {
if (DAT_00f74c94 == 0) {
if (DAT_00f74c90 == 0) {
if (iVar1 < 9) {
DAT_00f74c90 = 8;
goto LAB_004141cf;
}
DAT_00f74c90 = 8;
}
do {
DAT_00f74c90 = DAT_00f74c90 * 2;
} while (DAT_00f74c90 < iVar1);
}
else {
for (DAT_00f74c90 = (DAT_00f74c98 / DAT_00f74c94 + 1) * DAT_00f74c94; DAT_00f74c90 < iVar1;
DAT_00f74c90 = (DAT_00f74c90 + iVar1) / 2) {
}
}
LAB_004141cf:
if (DAT_00f74c8c == (void *)0x0) {
DAT_00f74c8c = malloc(DAT_00f74c90 << 2);
}
else {
DAT_00f74c8c = realloc(DAT_00f74c8c,DAT_00f74c90 << 2);
iVar1 = DAT_00f74c98 + 1;
}
}
iVar5 = iVar4 * 4;
iVar4 = (iVar1 - iVar4) + -1;
DAT_00f74c98 = iVar1;
_DAT_00f74c9c = DAT_00f74c8c;
if (0 < iVar4) {
_V_memmove((void *)((int)DAT_00f74c8c + iVar5 + 4),(void *)((int)DAT_00f74c8c + iVar5),iVar4 * 4
);
}
if ((undefined4 *)(iVar5 + (int)DAT_00f74c8c) != (undefined4 *)0x0) {
*(undefined4 *)(iVar5 + (int)DAT_00f74c8c) = pcVar2;
}
DataMapInit<CBaseGrenade>(CBaseGrenade*)::dataDesc._900_4_ = pcVar2;
pcVar2 = operator_new__(DAT_00f74c88 + 0xc);
pcVar3 = stpcpy(pcVar2,DataMapInit<CBaseGrenade>(CBaseGrenade*)::nameHolder);
builtin_strncpy(pcVar3,"PreDetonate",0xc);
iVar4 = DAT_00f74c98;
iVar1 = DAT_00f74c98 + 1;
if ((DAT_00f74c90 < iVar1) && (-1 < DAT_00f74c94)) {
if (DAT_00f74c94 == 0) {
if (DAT_00f74c90 == 0) {
if (iVar1 < 9) {
DAT_00f74c90 = 8;
goto LAB_00414137;
}
DAT_00f74c90 = 8;
}
do {
DAT_00f74c90 = DAT_00f74c90 * 2;
} while (DAT_00f74c90 < iVar1);
}
else {
for (DAT_00f74c90 = (DAT_00f74c98 / DAT_00f74c94 + 1) * DAT_00f74c94; DAT_00f74c90 < iVar1;
DAT_00f74c90 = (DAT_00f74c90 + iVar1) / 2) {
}
}
LAB_00414137:
if (DAT_00f74c8c == (void *)0x0) {
DAT_00f74c8c = malloc(DAT_00f74c90 << 2);
}
else {
DAT_00f74c8c = realloc(DAT_00f74c8c,DAT_00f74c90 << 2);
iVar1 = DAT_00f74c98 + 1;
}
}
iVar5 = iVar4 * 4;
iVar4 = (iVar1 - iVar4) + -1;
DAT_00f74c98 = iVar1;
_DAT_00f74c9c = DAT_00f74c8c;
if (0 < iVar4) {
_V_memmove((void *)((int)DAT_00f74c8c + iVar5 + 4),(void *)((int)DAT_00f74c8c + iVar5),iVar4 * 4
);
}
if ((undefined4 *)(iVar5 + (int)DAT_00f74c8c) != (undefined4 *)0x0) {
*(undefined4 *)(iVar5 + (int)DAT_00f74c8c) = pcVar2;
}
DataMapInit<CBaseGrenade>(CBaseGrenade*)::dataDesc._964_4_ = pcVar2;
pcVar2 = operator_new__(DAT_00f74c88 + 9);
pcVar3 = stpcpy(pcVar2,DataMapInit<CBaseGrenade>(CBaseGrenade*)::nameHolder);
builtin_strncpy(pcVar3,"Detonate",9);
iVar4 = DAT_00f74c98;
iVar1 = DAT_00f74c98 + 1;
if ((DAT_00f74c90 < iVar1) && (-1 < DAT_00f74c94)) {
if (DAT_00f74c94 == 0) {
if (DAT_00f74c90 == 0) {
if (iVar1 < 9) {
DAT_00f74c90 = 8;
goto LAB_0041409f;
}
DAT_00f74c90 = 8;
}
do {
DAT_00f74c90 = DAT_00f74c90 * 2;
} while (DAT_00f74c90 < iVar1);
}
else {
for (DAT_00f74c90 = (DAT_00f74c98 / DAT_00f74c94 + 1) * DAT_00f74c94; DAT_00f74c90 < iVar1;
DAT_00f74c90 = (DAT_00f74c90 + iVar1) / 2) {
}
}
LAB_0041409f:
if (DAT_00f74c8c == (void *)0x0) {
DAT_00f74c8c = malloc(DAT_00f74c90 << 2);
}
else {
DAT_00f74c8c = realloc(DAT_00f74c8c,DAT_00f74c90 << 2);
iVar1 = DAT_00f74c98 + 1;
}
}
iVar5 = iVar4 * 4;
iVar4 = (iVar1 - iVar4) + -1;
DAT_00f74c98 = iVar1;
_DAT_00f74c9c = DAT_00f74c8c;
if (0 < iVar4) {
_V_memmove((void *)((int)DAT_00f74c8c + iVar5 + 4),(void *)((int)DAT_00f74c8c + iVar5),iVar4 * 4
);
}
if ((undefined4 *)(iVar5 + (int)DAT_00f74c8c) != (undefined4 *)0x0) {
*(undefined4 *)(iVar5 + (int)DAT_00f74c8c) = pcVar2;
}
DataMapInit<CBaseGrenade>(CBaseGrenade*)::dataDesc._1028_4_ = pcVar2;
pcVar2 = operator_new__(DAT_00f74c88 + 0xc);
pcVar3 = stpcpy(pcVar2,DataMapInit<CBaseGrenade>(CBaseGrenade*)::nameHolder);
builtin_strncpy(pcVar3,"TumbleThink",0xc);
iVar4 = DAT_00f74c98;
iVar1 = DAT_00f74c98 + 1;
if ((DAT_00f74c90 < iVar1) && (-1 < DAT_00f74c94)) {
if (DAT_00f74c94 == 0) {
if (DAT_00f74c90 == 0) {
if (iVar1 < 9) {
DAT_00f74c90 = 8;
goto LAB_00413da7;
}
DAT_00f74c90 = 8;
}
do {
DAT_00f74c90 = DAT_00f74c90 * 2;
} while (DAT_00f74c90 < iVar1);
}
else {
for (DAT_00f74c90 = (DAT_00f74c98 / DAT_00f74c94 + 1) * DAT_00f74c94; DAT_00f74c90 < iVar1;
DAT_00f74c90 = (DAT_00f74c90 + iVar1) / 2) {
}
}
LAB_00413da7:
if (DAT_00f74c8c == (void *)0x0) {
DAT_00f74c8c = malloc(DAT_00f74c90 << 2);
}
else {
DAT_00f74c8c = realloc(DAT_00f74c8c,DAT_00f74c90 << 2);
iVar1 = DAT_00f74c98 + 1;
}
}
iVar5 = iVar4 * 4;
iVar4 = (iVar1 - iVar4) + -1;
DAT_00f74c98 = iVar1;
_DAT_00f74c9c = DAT_00f74c8c;
if (0 < iVar4) {
_V_memmove((void *)((int)DAT_00f74c8c + iVar5 + 4),(void *)((int)DAT_00f74c8c + iVar5),iVar4 * 4
);
}
if ((undefined4 *)(iVar5 + (int)DAT_00f74c8c) != (undefined4 *)0x0) {
*(undefined4 *)(iVar5 + (int)DAT_00f74c8c) = pcVar2;
}
DataMapInit<CBaseGrenade>(CBaseGrenade*)::dataDesc._1092_4_ = pcVar2;
__cxa_guard_release(&DataMapInit<CBaseGrenade>(CBaseGrenade*)::dataDesc);
LAB_00413849:
CBaseGrenade::m_DataMap._4_4_ = 0x11;
CBaseGrenade::m_DataMap._0_4_ = 0xf14680;
return (datamap_t *)CBaseGrenade::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.