RemoveVProfDataListener
0x0022ff80 · 410 bytes · __cdecl
_Z23RemoveVProfDataListenerj
Decompiled
undefined (1 param)
/* RemoveVProfDataListener(unsigned int) */
void RemoveVProfDataListener(uint param_1)
{
CUtlMemory<unsigned_char,int> *pCVar1;
uint *puVar2;
int iVar3;
int iVar4;
int local_44;
int local_40;
int local_30 [8];
local_30[0] = 0;
local_30[1] = 0;
local_30[2] = 0;
local_30[3] = 0;
local_30[4] = 0;
if (0 < DAT_003f0074) {
puVar2 = s_VProfListeners;
if (param_1 == *s_VProfListeners) {
local_40 = 0;
local_44 = 0;
}
else {
local_44 = 0;
do {
puVar2 = puVar2 + 7;
local_44 = local_44 + 1;
if (local_44 == DAT_003f0074) goto LAB_0022fff8;
local_40 = (int)puVar2 - (int)s_VProfListeners;
} while (param_1 != *puVar2);
if (local_44 == -1) goto LAB_0022fff8;
}
iVar4 = puVar2[5] - 1;
iVar3 = iVar4 * 0x10;
if (-1 < iVar4) {
do {
iVar4 = iVar4 + -1;
pCVar1 = (CUtlMemory<unsigned_char,int> *)(puVar2[2] + iVar3);
iVar3 = iVar3 + -0x10;
CUtlMemory<unsigned_char,int>::Purge(pCVar1);
} while (iVar4 != -1);
}
puVar2[5] = 0;
CUtlMemory<CUtlString,int>::Purge((CUtlMemory<CUtlString,int> *)(puVar2 + 2));
puVar2[6] = puVar2[2];
CUtlMemory<CUtlString,int>::Purge((CUtlMemory<CUtlString,int> *)(puVar2 + 2));
iVar4 = (DAT_003f0074 - local_44) + -1;
if (0 < iVar4) {
/* try { // try from 00230103 to 00230107 has its CatchHandler @ 00230125 */
_V_memmove((void *)((int)s_VProfListeners + local_40),s_VProfListeners + (local_44 + 1) * 7,
iVar4 * 0x1c);
}
DAT_003f0074 = DAT_003f0074 + -1;
g_VProfExport._24_4_ = g_VProfExport._24_4_ + -1;
if (g_VProfExport._24_4_ == 0) {
g_VProfExport[0x21] = 1;
}
iVar4 = local_30[3] + -1;
if (-1 < iVar4) {
iVar3 = iVar4 * 0x10;
do {
iVar4 = iVar4 + -1;
pCVar1 = (CUtlMemory<unsigned_char,int> *)(local_30[0] + iVar3);
iVar3 = iVar3 + -0x10;
CUtlMemory<unsigned_char,int>::Purge(pCVar1);
} while (iVar4 != -1);
}
}
LAB_0022fff8:
local_30[3] = 0;
CUtlMemory<CUtlString,int>::Purge((CUtlMemory<CUtlString,int> *)local_30);
local_30[4] = local_30[0];
CUtlMemory<CUtlString,int>::Purge((CUtlMemory<CUtlString,int> *)local_30);
return;
}
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.