UTIL_LoadActivityRemapFile
0x003f7130 · 969 bytes · __cdecl
_Z26UTIL_LoadActivityRemapFilePKcS0_R10CUtlVectorI14CActivityRemap10CUtlMemoryIS2_iEE
Decompiled
undefined (3 params)
/* WARNING: Globals starting with '_' overlap smaller symbols at the same address */
/* UTIL_LoadActivityRemapFile(char const*, char const*, CUtlVector<CActivityRemap,
CUtlMemory<CActivityRemap, int> >&) */
void UTIL_LoadActivityRemapFile(char *param_1,char *param_2,CUtlVector *param_3)
{
char cVar1;
KeyValues *pKVar2;
IBaseFileSystem *pIVar3;
char *pcVar4;
int *piVar5;
KeyValues *this;
char *pcVar6;
int iVar7;
int iVar8;
char **in_stack_ffffff98;
int local_40;
int local_3c;
undefined4 local_38;
char *local_34;
undefined4 local_30;
undefined4 local_2c;
undefined4 local_28;
char *local_24;
undefined4 local_20;
if (param_1 != (char *)0x0) {
local_30 = 0;
local_2c = 0;
local_28 = 0;
local_24 = (char *)0x0;
local_20 = 0;
local_34 = param_1;
if (_DAT_00f72d90 != -1) {
iVar7 = _DAT_00f72d90;
do {
while( true ) {
iVar8 = iVar7 * 0x28;
in_stack_ffffff98 = (char **)(DAT_00f72d84 + 0x10 + iVar8);
/* try { // try from 003f71c5 to 003f71e5 has its CatchHandler @ 003f7520 */
cVar1 = (*m_ActivityRemapDatabase)(&local_34);
if (cVar1 != '\0') break;
in_stack_ffffff98 = &local_34;
cVar1 = (*m_ActivityRemapDatabase)(DAT_00f72d84 + iVar8 + 0x10);
if (cVar1 == '\0') {
local_24 = (char *)0x0;
CUtlMemory<CActivityRemap,int>::Purge((CUtlMemory<CActivityRemap,int> *)&local_30);
local_20 = local_30;
CUtlMemory<CActivityRemap,int>::Purge((CUtlMemory<CActivityRemap,int> *)&local_30);
if (iVar7 != -1) {
CUtlVector<CActivityRemap,CUtlMemory<CActivityRemap,int>>::AddVectorToTail
((CUtlVector<CActivityRemap,CUtlMemory<CActivityRemap,int>> *)param_3,
(CUtlVector *)(DAT_00f72d84 + iVar8 + 0x14));
return;
}
goto LAB_003f7229;
}
if ((CUtlRBTree<CUtlMap<char_const*,CActivityRemapCache,int>::Node_t,int,CUtlMap<char_const*,CActivityRemapCache,int>::CKeyLess,CUtlMemory<UtlRBTreeNode_t<CUtlMap<char_const*,CActivityRemapCache,int>::Node_t,int>,int>>
::Links(int)::s_Sentinel == '\0') &&
(iVar7 = __cxa_guard_acquire(&CUtlRBTree<CUtlMap<char_const*,CActivityRemapCache,int>::Node_t,int,CUtlMap<char_const*,CActivityRemapCache,int>::CKeyLess,CUtlMemory<UtlRBTreeNode_t<CUtlMap<char_const*,CActivityRemapCache,int>::Node_t,int>,int>>
::Links(int)::s_Sentinel), iVar7 != 0)) {
CUtlRBTree<CUtlMap<char_const*,CActivityRemapCache,int>::Node_t,int,CUtlMap<char_const*,CActivityRemapCache,int>::CKeyLess,CUtlMemory<UtlRBTreeNode_t<CUtlMap<char_const*,CActivityRemapCache,int>::Node_t,int>,int>>
::Links(int)::s_Sentinel = 0xffffffff;
DAT_00f137f8 = 0xffffffff;
DAT_00f137fc = 0xffffffff;
__cxa_guard_release(&CUtlRBTree<CUtlMap<char_const*,CActivityRemapCache,int>::Node_t,int,CUtlMap<char_const*,CActivityRemapCache,int>::CKeyLess,CUtlMemory<UtlRBTreeNode_t<CUtlMap<char_const*,CActivityRemapCache,int>::Node_t,int>,int>>
::Links(int)::s_Sentinel);
}
iVar7 = *(int *)(DAT_00f72d84 + 4 + iVar8);
if (iVar7 == -1) goto LAB_003f7209;
}
if ((CUtlRBTree<CUtlMap<char_const*,CActivityRemapCache,int>::Node_t,int,CUtlMap<char_const*,CActivityRemapCache,int>::CKeyLess,CUtlMemory<UtlRBTreeNode_t<CUtlMap<char_const*,CActivityRemapCache,int>::Node_t,int>,int>>
::Links(int)::s_Sentinel == '\0') &&
(iVar8 = __cxa_guard_acquire(&CUtlRBTree<CUtlMap<char_const*,CActivityRemapCache,int>::Node_t,int,CUtlMap<char_const*,CActivityRemapCache,int>::CKeyLess,CUtlMemory<UtlRBTreeNode_t<CUtlMap<char_const*,CActivityRemapCache,int>::Node_t,int>,int>>
::Links(int)::s_Sentinel), iVar8 != 0)) {
CUtlRBTree<CUtlMap<char_const*,CActivityRemapCache,int>::Node_t,int,CUtlMap<char_const*,CActivityRemapCache,int>::CKeyLess,CUtlMemory<UtlRBTreeNode_t<CUtlMap<char_const*,CActivityRemapCache,int>::Node_t,int>,int>>
::Links(int)::s_Sentinel = 0xffffffff;
DAT_00f137f8 = 0xffffffff;
DAT_00f137fc = 0xffffffff;
__cxa_guard_release(&CUtlRBTree<CUtlMap<char_const*,CActivityRemapCache,int>::Node_t,int,CUtlMap<char_const*,CActivityRemapCache,int>::CKeyLess,CUtlMemory<UtlRBTreeNode_t<CUtlMap<char_const*,CActivityRemapCache,int>::Node_t,int>,int>>
::Links(int)::s_Sentinel);
}
iVar7 = *(int *)(DAT_00f72d84 + iVar7 * 0x28);
} while (iVar7 != -1);
}
LAB_003f7209:
local_24 = (char *)0x0;
CUtlMemory<CActivityRemap,int>::Purge((CUtlMemory<CActivityRemap,int> *)&local_30);
local_20 = local_30;
CUtlMemory<CActivityRemap,int>::Purge((CUtlMemory<CActivityRemap,int> *)&local_30);
}
LAB_003f7229:
pKVar2 = KeyValues::operator_new((KeyValues *)0x2c,(uint)in_stack_ffffff98);
/* try { // try from 003f7251 to 003f7255 has its CatchHandler @ 003f7535 */
KeyValues::KeyValues(pKVar2,param_2,(IKeyValuesSystem *)0x0,false);
pIVar3 = (IBaseFileSystem *)0x0;
if (filesystem != 0) {
pIVar3 = (IBaseFileSystem *)(filesystem + 4);
}
cVar1 = KeyValues::LoadFromFile(pKVar2,pIVar3,param_1,(char *)0x0);
if (cVar1 == '\0') {
return;
}
pKVar2 = (KeyValues *)KeyValues::GetFirstSubKey(pKVar2);
local_34 = (char *)0x0;
local_30 = 0;
local_2c = 0;
local_28 = 0;
local_24 = (char *)0x0;
for (; pKVar2 != (KeyValues *)0x0; pKVar2 = (KeyValues *)KeyValues::GetNextKey(pKVar2)) {
/* try { // try from 003f73a9 to 003f74e8 has its CatchHandler @ 003f750e */
pcVar4 = (char *)KeyValues::GetName(pKVar2);
piVar5 = (int *)ListFromString(pcVar4);
if ((piVar5 != (int *)0x0) && (iVar7 = *piVar5, iVar7 != -1)) {
this = (KeyValues *)KeyValues::GetFirstSubKey(pKVar2);
local_38 = 0;
local_40 = iVar7;
for (; this != (KeyValues *)0x0; this = (KeyValues *)KeyValues::GetNextKey(this)) {
pcVar4 = (char *)KeyValues::GetName(this);
pcVar6 = (char *)KeyValues::GetString(this,(char *)0x0,"");
iVar7 = _V_stricmp(pcVar4,"remapactivity");
if (iVar7 == 0) {
piVar5 = (int *)ListFromString(pcVar6);
if ((piVar5 == (int *)0x0) || (iVar7 = *piVar5, *piVar5 == -1)) {
iVar7 = ActivityList_RegisterPrivateActivity(pcVar6);
}
}
else {
iVar8 = _V_stricmp(pcVar4,"extra");
iVar7 = local_3c;
if (iVar8 == 0) {
local_38 = KeyValues::MakeCopy(this);
iVar7 = local_3c;
}
}
local_3c = iVar7;
}
CUtlVector<CActivityRemap,CUtlMemory<CActivityRemap,int>>::InsertBefore
((CUtlVector<CActivityRemap,CUtlMemory<CActivityRemap,int>> *)param_3,
*(int *)(param_3 + 0xc),(CActivityRemap *)&local_40);
}
}
CUtlVector<CActivityRemap,CUtlMemory<CActivityRemap,int>>::AddVectorToTail
((CUtlVector<CActivityRemap,CUtlMemory<CActivityRemap,int>> *)&local_34,param_3);
CUtlDict<CActivityRemapCache,int>::Insert
((CUtlDict<CActivityRemapCache,int> *)&m_ActivityRemapDatabase,param_1,
(CActivityRemapCache *)&local_34);
local_28 = 0;
CUtlMemory<CActivityRemap,int>::Purge((CUtlMemory<CActivityRemap,int> *)&local_34);
local_24 = local_34;
CUtlMemory<CActivityRemap,int>::Purge((CUtlMemory<CActivityRemap,int> *)&local_34);
return;
}
SourceMod gamedata
paste intoaddons/sourcemod/gamedata/<your_plugin>.txt
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.
Type inference is best-effort from the C signature - sanity-check the DHooks types before shipping.