L L4D2node

Serialize

0x00bf2310 · 423 bytes · __cdecl

_Z9SerializeR10CUtlBufferRK8Vector2D

Decompiled

undefined (2 params)

/* Serialize(CUtlBuffer&, Vector2D const&) */

bool Serialize(CUtlBuffer *param_1,Vector2D *param_2)

{
  undefined4 uVar1;
  float fVar2;
  char cVar3;
  int iVar4;
  void *pvVar5;
  undefined1 local_18;
  undefined1 uStack_17;
  undefined1 uStack_16;
  undefined1 uStack_15;
  undefined1 local_14;
  undefined1 uStack_13;
  undefined1 uStack_12;
  undefined1 uStack_11;
  undefined1 local_10;
  undefined1 local_f;
  undefined1 local_e;
  undefined1 local_d;
  
  if (((byte)param_1[0x15] & 1) != 0) {
    SerializeFloats(param_1,2,(float *)param_2);
    return param_1[0x14] == (CUtlBuffer)0x0;
  }
  uVar1 = *(undefined4 *)param_2;
  cVar3 = CUtlBuffer::CheckPut(param_1,4);
  if (cVar3 != '\0') {
    if (((byte)param_1[0x34] & 1) == 0) {
      *(undefined4 *)(*(int *)param_1 + (*(int *)(param_1 + 0x10) - *(int *)(param_1 + 0x20))) =
           uVar1;
      iVar4 = *(int *)(param_1 + 0x10);
    }
    else {
      iVar4 = *(int *)(param_1 + 0x10);
      pvVar5 = (void *)((iVar4 - *(int *)(param_1 + 0x20)) + *(int *)param_1);
      if (pvVar5 != (void *)0x0) {
        uStack_15 = (undefined1)((uint)uVar1 >> 0x18);
        local_10 = uStack_15;
        uStack_16 = (undefined1)((uint)uVar1 >> 0x10);
        local_f = uStack_16;
        uStack_17 = (undefined1)((uint)uVar1 >> 8);
        local_e = uStack_17;
        local_18 = (undefined1)uVar1;
        local_d = local_18;
        _V_memcpy(pvVar5,&local_10,4);
        iVar4 = *(int *)(param_1 + 0x10);
      }
    }
    *(int *)(param_1 + 0x10) = iVar4 + 4;
    CUtlBuffer::AddNullTermination(param_1);
  }
  fVar2 = *(float *)(param_2 + 4);
  if (((byte)param_1[0x15] & 1) == 0) {
    cVar3 = CUtlBuffer::CheckPut(param_1,4);
    if (cVar3 != '\0') {
      if (((byte)param_1[0x34] & 1) == 0) {
        *(float *)(*(int *)param_1 + (*(int *)(param_1 + 0x10) - *(int *)(param_1 + 0x20))) = fVar2;
        iVar4 = *(int *)(param_1 + 0x10);
      }
      else {
        iVar4 = *(int *)(param_1 + 0x10);
        pvVar5 = (void *)((iVar4 - *(int *)(param_1 + 0x20)) + *(int *)param_1);
        if (pvVar5 != (void *)0x0) {
          uStack_11 = (undefined1)((uint)fVar2 >> 0x18);
          local_10 = uStack_11;
          uStack_12 = (undefined1)((uint)fVar2 >> 0x10);
          local_f = uStack_12;
          uStack_13 = (undefined1)((uint)fVar2 >> 8);
          local_e = uStack_13;
          local_14 = SUB41(fVar2,0);
          local_d = local_14;
          _V_memcpy(pvVar5,&local_10,4);
          iVar4 = *(int *)(param_1 + 0x10);
        }
      }
      *(int *)(param_1 + 0x10) = iVar4 + 4;
      CUtlBuffer::AddNullTermination(param_1);
      return param_1[0x14] == (CUtlBuffer)0x0;
    }
  }
  else {
    CUtlBuffer::Printf(param_1,"%f",(double)fVar2);
  }
  return param_1[0x14] == (CUtlBuffer)0x0;
}

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)