L L4D2node

CDmxAttribute::SerializeElement

0x00bdfc50 · 1049 bytes · __thiscall

_ZNK13CDmxAttribute16SerializeElementEiR10CUtlBuffer

Decompiled

undefined (3 params)

/* CDmxAttribute::SerializeElement(int, CUtlBuffer&) const */

undefined4 __thiscall
CDmxAttribute::SerializeElement(CDmxAttribute *this,int param_1,CUtlBuffer *param_2)

{
  undefined4 uVar1;
  int in_GS_OFFSET;
  uint local_54 [16];
  Color local_14;
  undefined1 local_13;
  undefined1 local_12;
  undefined1 local_11;
  int local_10;
  
  local_10 = *(int *)(in_GS_OFFSET + 0x14);
  if (0xd < *(int *)this - 0xfU) {
switchD_00bdfc7b_default:
    uVar1 = 0;
    goto LAB_00bdfc8a;
  }
  switch(*(int *)this) {
  case 0x10:
    if (*(int **)(this + 8) == (int *)0x0) {
      local_54[0] = 0;
      uVar1 = ::Serialize(param_2,(int *)local_54);
    }
    else {
      uVar1 = ::Serialize(param_2,(int *)(**(int **)(this + 8) + param_1 * 4));
    }
    break;
  case 0x11:
    if (*(int **)(this + 8) == (int *)0x0) {
      local_54[0] = 0;
      uVar1 = ::Serialize((CUtlBuffer *)local_54,(float *)this);
    }
    else {
      uVar1 = ::Serialize((CUtlBuffer *)(**(int **)(this + 8) + param_1 * 4),(float *)this);
    }
    break;
  case 0x12:
    if (*(int **)(this + 8) == (int *)0x0) {
      local_54[0] = local_54[0] & 0xffffff00;
      uVar1 = ::Serialize(param_2,(bool *)local_54);
    }
    else {
      uVar1 = ::Serialize(param_2,(bool *)(**(int **)(this + 8) + param_1));
    }
    break;
  case 0x13:
    if (*(int **)(this + 8) != (int *)0x0) {
      uVar1 = ::Serialize(param_2,(CUtlString *)(param_1 * 0x10 + **(int **)(this + 8)));
      break;
    }
    CUtlString::CUtlString((CUtlString *)local_54);
                    /* try { // try from 00be0091 to 00be00a1 has its CatchHandler @ 00be00bb */
    CUtlString::Set((CUtlString *)local_54,(char *)0x0);
    uVar1 = ::Serialize(param_2,(CUtlString *)local_54);
    goto LAB_00be0068;
  case 0x14:
    if (*(int **)(this + 8) != (int *)0x0) {
      uVar1 = ::Serialize(param_2,(CUtlBinaryBlock *)(param_1 * 0x10 + **(int **)(this + 8)));
      break;
    }
    CUtlBinaryBlock::CUtlBinaryBlock((CUtlBinaryBlock *)local_54,0,0);
                    /* try { // try from 00be0057 to 00be0067 has its CatchHandler @ 00be00a9 */
    CUtlBinaryBlock::Set((CUtlBinaryBlock *)local_54,(void *)0x0,0);
    uVar1 = ::Serialize(param_2,(CUtlBinaryBlock *)local_54);
LAB_00be0068:
    CUtlMemory<unsigned_char,int>::Purge((CUtlMemory<unsigned_char,int> *)local_54);
    break;
  case 0x15:
    if (*(int **)(this + 8) == (int *)0x0) {
      local_54[0] = 0;
      uVar1 = ::Serialize(param_2,(DmeTime_t *)local_54);
    }
    else {
      uVar1 = ::Serialize(param_2,(DmeTime_t *)(**(int **)(this + 8) + param_1 * 4));
    }
    break;
  case 0x16:
    if (*(int **)(this + 8) == (int *)0x0) {
      local_14 = 0;
      local_13 = 0;
      local_12 = 0;
      local_11 = 0xff;
      uVar1 = ::Serialize(param_2,&local_14);
    }
    else {
      uVar1 = ::Serialize(param_2,(Color *)(**(int **)(this + 8) + param_1 * 4));
    }
    break;
  case 0x17:
    if (*(int **)(this + 8) == (int *)0x0) {
      local_54[0] = 0;
      local_54[1] = 0;
      uVar1 = ::Serialize(param_2,(Vector2D *)local_54);
    }
    else {
      uVar1 = ::Serialize(param_2,(Vector2D *)(**(int **)(this + 8) + param_1 * 8));
    }
    break;
  case 0x18:
    if (*(int **)(this + 8) == (int *)0x0) {
      local_54[0] = 0;
      local_54[1] = 0;
      local_54[2] = 0;
      uVar1 = ::Serialize(param_2,(Vector *)local_54);
    }
    else {
      uVar1 = ::Serialize(param_2,(Vector *)(**(int **)(this + 8) + param_1 * 0xc));
    }
    break;
  case 0x19:
    if (*(int **)(this + 8) == (int *)0x0) {
      local_54[0] = 0;
      local_54[1] = 0;
      local_54[2] = 0;
      local_54[3] = 0;
      uVar1 = ::Serialize(param_2,(Vector4D *)local_54);
    }
    else {
      uVar1 = ::Serialize(param_2,(Vector4D *)(param_1 * 0x10 + **(int **)(this + 8)));
    }
    break;
  case 0x1a:
    if (*(int **)(this + 8) == (int *)0x0) {
      local_54[0] = 0;
      local_54[1] = 0;
      local_54[2] = 0;
      uVar1 = ::Serialize(param_2,(QAngle *)local_54);
    }
    else {
      uVar1 = ::Serialize(param_2,(QAngle *)(**(int **)(this + 8) + param_1 * 0xc));
    }
    break;
  case 0x1b:
    if (*(int **)(this + 8) == (int *)0x0) {
      local_54[0] = 0;
      local_54[1] = 0;
      local_54[2] = 0;
      local_54[3] = 0x3f800000;
      uVar1 = ::Serialize(param_2,(Quaternion *)local_54);
    }
    else {
      uVar1 = ::Serialize(param_2,(Quaternion *)(param_1 * 0x10 + **(int **)(this + 8)));
    }
    break;
  case 0x1c:
    if (*(int **)(this + 8) == (int *)0x0) {
      MatrixSetIdentity((VMatrix *)local_54);
      uVar1 = ::Serialize(param_2,(VMatrix *)local_54);
    }
    else {
      uVar1 = ::Serialize(param_2,(VMatrix *)(param_1 * 0x40 + **(int **)(this + 8)));
    }
    break;
  default:
    goto switchD_00bdfc7b_default;
  }
LAB_00bdfc8a:
  if (local_10 != *(int *)(in_GS_OFFSET + 0x14)) {
                    /* WARNING: Subroutine does not return */
    __stack_chk_fail();
  }
  return uVar1;
}

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)