L L4D2node

CDirector::PlayerAvatarSet

0x0088b180 · 335 bytes · __cdecl

_ZN9CDirector15PlayerAvatarSetEyP9KeyValues

Decompiled

undefined (2 params)

/* CDirector::PlayerAvatarSet(unsigned long long, KeyValues*) */

void CDirector::PlayerAvatarSet(ulonglong param_1,KeyValues *param_2)

{
  ushort uVar1;
  CUtlRBTree<CUtlMap<unsigned_long_long,KeyValues*,unsigned_short>::Node_t,unsigned_short,CUtlMap<unsigned_long_long,KeyValues*,unsigned_short>::CKeyLess,CUtlMemory<UtlRBTreeNode_t<CUtlMap<unsigned_long_long,KeyValues*,unsigned_short>::Node_t,unsigned_short>,unsigned_short>>
  *this;
  undefined4 uVar2;
  int iVar3;
  KeyValues *in_stack_00000010;
  KeyValues *local_44;
  undefined4 local_34;
  KeyValues *local_30;
  undefined4 local_2c;
  undefined4 local_28;
  KeyValues *local_24;
  
  this = (CUtlRBTree<CUtlMap<unsigned_long_long,KeyValues*,unsigned_short>::Node_t,unsigned_short,CUtlMap<unsigned_long_long,KeyValues*,unsigned_short>::CKeyLess,CUtlMemory<UtlRBTreeNode_t<CUtlMap<unsigned_long_long,KeyValues*,unsigned_short>::Node_t,unsigned_short>,unsigned_short>>
          *)((int)param_1 + 0x11c);
  local_28 = param_1._4_4_;
  local_24 = param_2;
  uVar1 = CUtlRBTree<CUtlMap<unsigned_long_long,KeyValues*,unsigned_short>::Node_t,unsigned_short,CUtlMap<unsigned_long_long,KeyValues*,unsigned_short>::CKeyLess,CUtlMemory<UtlRBTreeNode_t<CUtlMap<unsigned_long_long,KeyValues*,unsigned_short>::Node_t,unsigned_short>,unsigned_short>>
          ::Find(this,(Node_t *)&local_28);
  if (uVar1 == 0xffff) {
    if (in_stack_00000010 == (KeyValues *)0x0) {
      return;
    }
    local_44 = (KeyValues *)0x0;
  }
  else {
    iVar3 = (uint)uVar1 * 0x14;
    local_44 = *(KeyValues **)(*(int *)((int)param_1 + 0x120) + 0x10 + iVar3);
    if (in_stack_00000010 == (KeyValues *)0x0) {
      CUtlRBTree<CUtlMap<unsigned_long_long,KeyValues*,unsigned_short>::Node_t,unsigned_short,CUtlMap<unsigned_long_long,KeyValues*,unsigned_short>::CKeyLess,CUtlMemory<UtlRBTreeNode_t<CUtlMap<unsigned_long_long,KeyValues*,unsigned_short>::Node_t,unsigned_short>,unsigned_short>>
      ::Unlink(this,uVar1);
      *(ushort *)(*(int *)((int)param_1 + 0x120) + iVar3) = uVar1;
      *(undefined2 *)(*(int *)((int)param_1 + 0x120) + 2 + iVar3) =
           *(undefined2 *)((int)param_1 + 0x130);
      *(short *)((int)param_1 + 0x12e) = *(short *)((int)param_1 + 0x12e) + -1;
      *(ushort *)((int)param_1 + 0x130) = uVar1;
      goto LAB_0088b21d;
    }
  }
                    /* try { // try from 0088b1e3 to 0088b23a has its CatchHandler @ 0088b2d8 */
  uVar2 = KeyValues::MakeCopy(in_stack_00000010);
  local_28 = param_1._4_4_;
  local_24 = param_2;
  uVar1 = CUtlRBTree<CUtlMap<unsigned_long_long,KeyValues*,unsigned_short>::Node_t,unsigned_short,CUtlMap<unsigned_long_long,KeyValues*,unsigned_short>::CKeyLess,CUtlMemory<UtlRBTreeNode_t<CUtlMap<unsigned_long_long,KeyValues*,unsigned_short>::Node_t,unsigned_short>,unsigned_short>>
          ::Find(this,(Node_t *)&local_28);
  if (uVar1 == 0xffff) {
    local_34 = param_1._4_4_;
    local_30 = param_2;
    local_2c = uVar2;
                    /* try { // try from 0088b27e to 0088b282 has its CatchHandler @ 0088b2d8 */
    CUtlRBTree<CUtlMap<unsigned_long_long,KeyValues*,unsigned_short>::Node_t,unsigned_short,CUtlMap<unsigned_long_long,KeyValues*,unsigned_short>::CKeyLess,CUtlMemory<UtlRBTreeNode_t<CUtlMap<unsigned_long_long,KeyValues*,unsigned_short>::Node_t,unsigned_short>,unsigned_short>>
    ::Insert(this,(Node_t *)&local_34);
  }
  else {
    *(undefined4 *)((uint)uVar1 * 0x14 + *(int *)((int)param_1 + 0x120) + 0x10) = uVar2;
  }
LAB_0088b21d:
  OnPlayerAvatarUpdated(param_1,param_2,local_44);
  if (local_44 != (KeyValues *)0x0) {
    KeyValues::deleteThis();
  }
  return;
}

SourceMod gamedata

paste into addons/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.



        

        

          

Type inference is best-effort from the C signature - sanity-check the DHooks types before shipping.

Return-type handling cheatsheet (DHookReturn)