L L4D2node

GCSDK::CMsgBase_t<GCSDK::GCMsgHdrEx_t>::PacketDump

0x00092500 · 1121 bytes · __thiscall

_ZN5GCSDK10CMsgBase_tINS_12GCMsgHdrEx_tEE10PacketDumpEv

Decompiled

undefined (1 param)

/* GCSDK::CMsgBase_t<GCSDK::GCMsgHdrEx_t>::PacketDump() */

void __thiscall
GCSDK::CMsgBase_t<GCSDK::GCMsgHdrEx_t>::PacketDump(CMsgBase_t<GCSDK::GCMsgHdrEx_t> *this)

{
  int iVar1;
  undefined4 uVar2;
  int iVar3;
  uint uVar4;
  int iVar5;
  uint uVar6;
  uint *puVar7;
  undefined4 *puVar8;
  int in_GS_OFFSET;
  byte bVar9;
  uint local_bc;
  byte local_a4 [4];
  undefined4 local_a0 [7];
  uint local_84 [25];
  int local_20;
  
  bVar9 = 0;
  iVar5 = 0;
  local_20 = *(int *)(in_GS_OFFSET + 0x14);
  iVar3 = *(int *)(this + 0x10);
  iVar1 = *(int *)(this + 0x14);
  uVar6 = *(uint *)(this + 0xc);
  if ((uint)(iVar1 + iVar3) <= uVar6) {
    iVar5 = (uVar6 - iVar3) - iVar1;
  }
  EmitInfo("network",5,1,"Packet dump: raw size %u, header size %u, body size %u, var size %u\n",
           uVar6,iVar3,iVar1,iVar5);
  uVar2 = GCMsgHdrEx_t::GetHeaderDescription(*(GCMsgHdrEx_t **)(this + 4));
  EmitInfo("network",5,1,"Header dump: %s\n",uVar2);
  EmitInfo("network",5,1,"Struct dump: %u bytes\n",*(undefined4 *)(this + 0x14));
  puVar7 = local_84 + 1;
  for (iVar3 = 0x18; iVar3 != 0; iVar3 = iVar3 + -1) {
    *puVar7 = 0;
    puVar7 = puVar7 + (uint)bVar9 * -2 + 1;
  }
  local_84[0] = 0;
  local_a4[0] = 0;
  local_a4[1] = 0;
  local_a4[2] = 0;
  local_a4[3] = 0;
  puVar8 = local_a0;
  for (iVar3 = 7; iVar3 != 0; iVar3 = iVar3 + -1) {
    *puVar8 = 0;
    puVar8 = puVar8 + (uint)bVar9 * -2 + 1;
  }
  local_bc = 0;
  if (*(int *)(this + 0x14) != 0) {
    uVar6 = 0;
    do {
      while( true ) {
        uVar4 = uVar6 & 0xf;
        bVar9 = *(byte *)(*(int *)(this + 8) + uVar6);
        V_snprintf((char *)((int)local_84 + uVar4 * 3),8,"%02X ",(uint)bVar9);
        if ((bVar9 != 0x25) && (0x1f < bVar9)) break;
        *(undefined1 *)((int)local_a0 + (uVar4 - 4)) = 0x2e;
        if ((char)uVar4 != '\x0f') goto LAB_00092619;
LAB_00092690:
        *(undefined1 *)((int)local_a0 + (uVar4 - 3)) = 10;
        uVar6 = uVar6 + 1;
        *(undefined1 *)((int)local_a0 + (uVar4 - 2)) = 0;
        V_strncat((char *)local_84,"; ",100,-1);
        V_strncat((char *)local_84,(char *)local_a4,100,-1);
        EmitInfo("network",5,1,(char *)local_84);
        local_84[0] = local_84[0] & 0xffffff00;
        local_bc = *(uint *)(this + 0x14);
        if (local_bc <= uVar6) goto LAB_00092728;
      }
      *(byte *)((int)local_a0 + (uVar4 - 4)) = bVar9;
      if ((char)uVar4 == '\x0f') goto LAB_00092690;
LAB_00092619:
      local_bc = *(uint *)(this + 0x14);
      if (local_bc - 1 == uVar6) goto LAB_00092690;
      uVar6 = uVar6 + 1;
    } while (uVar6 < local_bc);
  }
LAB_00092728:
  if (*(uint *)(this + 0xc) < local_bc + *(int *)(this + 0x10)) {
    EmitInfo("network",5,1,"VarData dump: %u bytes\n",0);
  }
  else {
    local_bc = (*(uint *)(this + 0xc) - *(int *)(this + 0x10)) - local_bc;
    if (local_bc < 0x400) {
      EmitInfo("network",5,1,"VarData dump: %u bytes\n",local_bc);
      if (local_bc == 0) goto LAB_000928e7;
    }
    else {
      EmitInfo("network",5,1,"VarData dump: %u bytes\n",0x400);
      local_bc = 0x400;
    }
    uVar6 = 0;
    do {
      while( true ) {
        uVar4 = uVar6 & 0xf;
        bVar9 = *(byte *)(*(int *)(this + 4) + uVar6 + *(int *)(this + 0x14) + *(int *)(this + 0x10)
                         );
        V_snprintf((char *)((int)local_84 + uVar4 * 3),8,"%02X ",(uint)bVar9);
        if ((bVar9 != 0x25) && (0x1f < bVar9)) break;
        *(undefined1 *)((int)local_a0 + (uVar4 - 4)) = 0x2e;
        if ((char)uVar4 != '\x0f') goto LAB_000927c9;
LAB_00092850:
        uVar6 = uVar6 + 1;
        *(undefined1 *)((int)local_a0 + (uVar4 - 3)) = 10;
        *(undefined1 *)((int)local_a0 + (uVar4 - 2)) = 0;
        V_strncat((char *)local_84," ; ",100,-1);
        V_strncat((char *)local_84,(char *)local_a4,100,-1);
        EmitInfo("network",5,1,(char *)local_84);
        local_84[0] = local_84[0] & 0xffffff00;
        if (local_bc <= uVar6) goto LAB_000928e7;
      }
      *(byte *)((int)local_a0 + (uVar4 - 4)) = bVar9;
      if ((char)uVar4 == '\x0f') goto LAB_00092850;
LAB_000927c9:
      if (local_bc - 1 == uVar6) goto LAB_00092850;
      uVar6 = uVar6 + 1;
    } while (uVar6 < local_bc);
  }
LAB_000928e7:
  if (local_20 != *(int *)(in_GS_OFFSET + 0x14)) {
                    /* WARNING: Subroutine does not return */
    __stack_chk_fail();
  }
  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)