L L4D2node

CMatchEventsSubscription::BroadcastEvent

0x0005cb70 · 534 bytes · __thiscall

_ZN24CMatchEventsSubscription14BroadcastEventEP9KeyValues

Decompiled

undefined (2 params)

/* CMatchEventsSubscription::BroadcastEvent(KeyValues*) */

void __thiscall
CMatchEventsSubscription::BroadcastEvent(CMatchEventsSubscription *this,KeyValues *param_1)

{
  int *piVar1;
  undefined4 *puVar2;
  undefined4 uVar3;
  KeyValues *pKVar4;
  char *pcVar5;
  int iVar6;
  int iVar7;
  int local_20 [4];
  
  pcVar5 = (char *)KeyValues::GetName(param_1);
  iVar6 = _V_stricmp("OnNetLanConnectionlessPacket",pcVar5);
  if ((iVar6 == 0) && (iVar6 = KeyValues::GetPtr(param_1,"rawpkt",(void *)0x0), iVar6 != 0)) {
    KeyValues::deleteThis();
    (**(code **)(*(int *)g_pConnectionlessLanMgr + 8))(g_pConnectionlessLanMgr,iVar6);
    return;
  }
  pKVar4 = param_1;
  if ((this[0x40] != (CMatchEventsSubscription)0x0) && (this[0x41] == (CMatchEventsSubscription)0x0)
     ) {
    CUtlVector<KeyValues*,CUtlMemory<KeyValues*,int>>::InsertBefore
              ((CUtlVector<KeyValues*,CUtlMemory<KeyValues*,int>> *)(this + 0x44),
               *(int *)(this + 0x50),&param_1);
    return;
  }
  this[0x40] = (CMatchEventsSubscription)0x1;
                    /* try { // try from 0005cbd0 to 0005cc7c has its CatchHandler @ 0005cd93 */
  CUtlVector<KeyValues*,CUtlMemory<KeyValues*,int>>::InsertBefore
            ((CUtlVector<KeyValues*,CUtlMemory<KeyValues*,int>> *)(this + 0x6c),0,&param_1);
  (**(code **)(*(int *)g_pMMF + 0x40))(g_pMMF,param_1);
  local_20[0] = 0;
  CUtlVector<int,CUtlMemory<int,int>>::InsertBefore
            ((CUtlVector<int,CUtlMemory<int,int>> *)(this + 0x2c),*(int *)(this + 0x38),local_20);
  iVar6 = *(int *)(this + 0x38) + -1;
  iVar7 = *(int *)(*(int *)(this + 0x2c) + iVar6 * 4);
  if (iVar7 < *(int *)(this + 0x10)) {
    do {
      puVar2 = *(undefined4 **)(*(int *)(this + 4) + iVar7 * 4);
      (**(code **)*puVar2)(puVar2,param_1);
      piVar1 = (int *)(*(int *)(this + 0x2c) + -4 + *(int *)(this + 0x38) * 4);
      *piVar1 = *piVar1 + 1;
      iVar6 = *(int *)(this + 0x38) + -1;
      iVar7 = *(int *)(*(int *)(this + 0x2c) + iVar6 * 4);
    } while (iVar7 < *(int *)(this + 0x10));
  }
  *(int *)(this + 0x38) = iVar6;
  this[0x40] = (CMatchEventsSubscription)0x0;
  if (*(int *)(this + 0x50) < 1) {
    if (0 < *(int *)(this + 100)) {
      iVar6 = 0;
      do {
                    /* try { // try from 0005ccb1 to 0005ccb5 has its CatchHandler @ 0005cd93 */
        KeyValues::deleteThis();
        iVar6 = iVar6 + 1;
      } while (iVar6 < *(int *)(this + 100));
    }
    *(undefined4 *)(this + 100) = 0;
    CUtlMemory<KeyValues*,int>::Purge((CUtlMemory<KeyValues*,int> *)(this + 0x58));
    *(undefined4 *)(this + 0x78) = 0;
    *(undefined4 *)(this + 0x68) = *(undefined4 *)(this + 0x58);
    CUtlMemory<KeyValues*,int>::Purge((CUtlMemory<KeyValues*,int> *)(this + 0x6c));
    *(undefined4 *)(this + 0x7c) = *(undefined4 *)(this + 0x6c);
    if (pKVar4 != (KeyValues *)0x0) {
      KeyValues::deleteThis();
      return;
    }
  }
  else {
    puVar2 = *(undefined4 **)(this + 0x44);
    iVar6 = 0;
    iVar7 = *(int *)(this + 0x50) + -1;
    uVar3 = *puVar2;
    if (iVar7 != 0) {
                    /* try { // try from 0005cd83 to 0005cd87 has its CatchHandler @ 0005cd93 */
      _V_memmove(puVar2,puVar2 + 1,iVar7 * 4);
      iVar6 = *(int *)(this + 0x50) + -1;
    }
    *(int *)(this + 0x50) = iVar6;
    (**(code **)(*(int *)this + 8))(this,uVar3);
    if (pKVar4 != (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)