Host_BuildUserInfoUpdateMessage
0x00179630 · 528 bytes · __cdecl
_Z31Host_BuildUserInfoUpdateMessageiR10CUtlVectorI16NetMessageCvar_t10CUtlMemoryIS0_iEEb
Decompiled
undefined (3 params)
/* Host_BuildUserInfoUpdateMessage(int, CUtlVector<NetMessageCvar_t, CUtlMemory<NetMessageCvar_t,
int> >&, bool) */
void Host_BuildUserInfoUpdateMessage(int param_1,CUtlVector *param_2,bool param_3)
{
char cVar1;
int iVar2;
int *piVar3;
ConVar *this;
char *pcVar4;
int iVar5;
int in_GS_OFFSET;
char *local_230;
NetMessageCvar_t local_228 [260];
char local_124 [260];
int local_20;
local_20 = *(int *)(in_GS_OFFSET + 0x14);
iVar5 = (-(uint)(param_1 == 0) & 0xfffc0000) + 0x40200;
iVar2 = Host_CountVariablesWithFlags(iVar5,param_3);
if (0 < iVar2) {
piVar3 = (int *)(**(code **)(*g_pCVar + 0x98))(g_pCVar);
/* try { // try from 001796b6 to 0017982a has its CatchHandler @ 0017984f */
(**(code **)(*piVar3 + 8))(piVar3);
while (cVar1 = (**(code **)(*piVar3 + 0x10))(piVar3), cVar1 != '\0') {
this = (ConVar *)(**(code **)(*piVar3 + 0x14))(piVar3);
cVar1 = (**(code **)(*(int *)this + 8))(this);
if (((cVar1 == '\0') && (cVar1 = (**(code **)(*(int *)this + 0xc))(this,iVar5), cVar1 != '\0')
) && (cVar1 = (**(code **)(*(int *)this + 0xc))
(this,(-(uint)(param_1 == 0) & 0x38000) + 0x8000), cVar1 == '\0'))
{
if (param_3) {
local_230 = "FCVAR_NEVER_AS_STRING";
if ((((byte)this[0x15] & 0x10) == 0) &&
(local_230 = *(char **)(*(int *)(this + 0x1c) + 0x24), local_230 == (char *)0x0)) {
local_230 = "";
}
pcVar4 = (char *)ConVar::GetDefault(this);
iVar2 = V_strcasecmp(pcVar4,local_230);
if (iVar2 == 0) goto LAB_001796c0;
}
iVar2 = (**(code **)(*(int *)this + 0x38))(this);
if (param_1 == iVar2) {
pcVar4 = (char *)(**(code **)(*(int *)this + 0x34))(this);
V_strncpy((char *)local_228,pcVar4,0x104);
pcVar4 = "FCVAR_NEVER_AS_STRING";
if (((byte)this[0x15] & 0x10) == 0) {
pcVar4 = "";
if (*(char **)(*(int *)(this + 0x1c) + 0x24) != (char *)0x0) {
pcVar4 = *(char **)(*(int *)(this + 0x1c) + 0x24);
}
}
pcVar4 = (char *)Host_CleanupConVarStringValue(pcVar4);
V_strncpy(local_124,pcVar4,0x104);
CUtlVector<NetMessageCvar_t,CUtlMemory<NetMessageCvar_t,int>>::InsertBefore
((CUtlVector<NetMessageCvar_t,CUtlMemory<NetMessageCvar_t,int>> *)param_2,
*(int *)(param_2 + 0xc),local_228);
}
}
LAB_001796c0:
(**(code **)(*piVar3 + 0xc))(piVar3);
}
if (0xff < *(int *)(param_2 + 0xc)) {
Sys_Error("Engine only supports 255 ConVars marked %i\n",0x200);
}
(**(code **)(*piVar3 + 4))(piVar3);
}
if (local_20 != *(int *)(in_GS_OFFSET + 0x14)) {
/* WARNING: Subroutine does not return */
__stack_chk_fail();
}
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.