L L4D2node

DataTable_SetupReceiveTableFromSendTable

0x00144fe0 · 684 bytes · __cdecl

_Z40DataTable_SetupReceiveTableFromSendTableP9SendTableb

Decompiled

undefined (2 params)

/* DataTable_SetupReceiveTableFromSendTable(SendTable*, bool) */

undefined4 DataTable_SetupReceiveTableFromSendTable(SendTable *param_1,bool param_2)

{
  uint uVar1;
  CClientSendTable *this;
  undefined4 uVar2;
  uint uVar3;
  uint *puVar4;
  int *piVar5;
  int iVar6;
  char *pcVar7;
  CRecvDecoder *this_00;
  RecvTable *pRVar8;
  SendProp *pSVar9;
  int iVar10;
  int iVar11;
  SendProp *this_01;
  int iVar12;
  int iVar13;
  int local_34;
  CClientSendTable *local_24;
  CRecvDecoder *local_20 [4];
  
  this = operator_new(0x28);
                    /* try { // try from 00145000 to 00145004 has its CatchHandler @ 001452ab */
  CClientSendTable::CClientSendTable(this);
  local_24 = this;
  CUtlLinkedList<CClientSendTable*,unsigned_short,false,unsigned_short,CUtlMemory<UtlLinkedListElem_t<CClientSendTable*,unsigned_short>,unsigned_short>>
  ::InsertBefore((CUtlLinkedList<CClientSendTable*,unsigned_short,false,unsigned_short,CUtlMemory<UtlLinkedListElem_t<CClientSendTable*,unsigned_short>,unsigned_short>>
                  *)&g_ClientSendTables,0xffff,&local_24);
  uVar2 = COM_StringCopy(*(char **)(param_1 + 8));
  *(undefined4 *)(this + 8) = uVar2;
  if (param_2) {
    this_00 = operator_new(0x14c);
                    /* try { // try from 00145219 to 0014521d has its CatchHandler @ 00145302 */
    CRecvDecoder::CRecvDecoder(this_00);
    local_20[0] = this_00;
    CUtlLinkedList<CRecvDecoder*,unsigned_short,false,unsigned_short,CUtlMemory<UtlLinkedListElem_t<CRecvDecoder*,unsigned_short>,unsigned_short>>
    ::InsertBefore((CUtlLinkedList<CRecvDecoder*,unsigned_short,false,unsigned_short,CUtlMemory<UtlLinkedListElem_t<CRecvDecoder*,unsigned_short>,unsigned_short>>
                    *)&g_RecvDecoders,0xffff,local_20);
    pRVar8 = (RecvTable *)FindRecvTable(*(char **)(this + 8));
    if (pRVar8 == (RecvTable *)0x0) {
      DataTable_Warning("No matching RecvTable for SendTable \'%s\'.\n",*(undefined4 *)(this + 8));
      return 0;
    }
    *(CRecvDecoder **)(pRVar8 + 8) = local_20[0];
    *(RecvTable **)local_20[0] = pRVar8;
    *(CClientSendTable **)(local_20[0] + 4) = local_24;
    *(CClientSendTable **)(local_20[0] + 0x94) = local_24;
    *(CRecvDecoder **)(local_24 + 0xc) = local_20[0] + 8;
    SetupArrayProps_R<RecvTable,RecvProp>(pRVar8);
    uVar1 = *(uint *)(param_1 + 4);
    *(uint *)(this + 4) = uVar1;
  }
  else {
    uVar1 = *(uint *)(param_1 + 4);
    *(uint *)(this + 4) = uVar1;
  }
  if (uVar1 == 0) {
    iVar10 = 0;
    pSVar9 = (SendProp *)0x0;
  }
  else {
    uVar3 = 0xffffffff;
    if (uVar1 < 0x1840001) {
      uVar3 = uVar1 * 0x54 + 4;
    }
    iVar10 = uVar1 - 1;
    puVar4 = operator_new__(uVar3);
    *puVar4 = uVar1;
    pSVar9 = (SendProp *)(puVar4 + 1);
    this_01 = pSVar9;
    do {
                    /* try { // try from 00145083 to 00145087 has its CatchHandler @ 001452c0 */
      SendProp::SendProp(this_01);
      iVar10 = iVar10 + -1;
      this_01 = this_01 + 0x54;
    } while (iVar10 != -1);
    iVar10 = *(int *)(this + 4);
  }
  iVar12 = 0;
  *(SendProp **)this = pSVar9;
  CUtlVector<CClientSendProp,CUtlMemory<CClientSendProp,int>>::SetCount
            ((CUtlVector<CClientSendProp,CUtlMemory<CClientSendProp,int>> *)(local_24 + 0x14),iVar10
            );
  local_34 = 0;
  if (0 < *(int *)(this + 4)) {
    do {
      iVar10 = *(int *)(local_24 + 0x14);
      iVar11 = *(int *)this + iVar12;
      iVar13 = *(int *)param_1 + iVar12;
      *(undefined4 *)(iVar11 + 8) = *(undefined4 *)(iVar13 + 8);
      uVar2 = COM_StringCopy(*(char **)(iVar13 + 0x30));
      *(undefined4 *)(iVar11 + 0x30) = uVar2;
      *(undefined4 *)(iVar11 + 0x3c) = *(undefined4 *)(iVar13 + 0x3c);
      *(undefined1 *)(iVar11 + 0x38) = *(undefined1 *)(iVar13 + 0x38);
      piVar5 = (int *)CommandLine_Tier0();
      iVar6 = (**(code **)(*piVar5 + 0x28))(piVar5,&DAT_002ad780);
      if ((iVar6 != 0) && (*(char **)(iVar13 + 0x2c) != (char *)0x0)) {
        uVar2 = COM_StringCopy(*(char **)(iVar13 + 0x2c));
        *(undefined4 *)(iVar11 + 0x2c) = uVar2;
      }
      if (*(int *)(iVar11 + 8) == 6) {
        pcVar7 = *(char **)(iVar13 + 0x28);
        if (*(int *)(iVar13 + 0x48) != 0) {
          pcVar7 = *(char **)(*(int *)(iVar13 + 0x48) + 8);
        }
        uVar2 = COM_StringCopy(pcVar7);
        *(undefined4 *)(iVar10 + local_34 * 4) = uVar2;
        *(undefined4 *)(iVar11 + 0x44) = *(undefined4 *)(iVar13 + 0x44);
        *(undefined4 *)(iVar11 + 0x4c) = *(undefined4 *)(iVar13 + 0x4c);
      }
      else if ((*(byte *)(iVar11 + 0x3c) & 0x40) == 0) {
        if (*(int *)(iVar11 + 8) == 5) {
          *(undefined4 *)(iVar11 + 0x20) = *(undefined4 *)(iVar13 + 0x20);
        }
        else {
          *(undefined4 *)(iVar11 + 0x10) = *(undefined4 *)(iVar13 + 0x10);
          *(undefined4 *)(iVar11 + 0x14) = *(undefined4 *)(iVar13 + 0x14);
          *(undefined4 *)(iVar11 + 0xc) = *(undefined4 *)(iVar13 + 0xc);
        }
      }
      else {
        uVar2 = COM_StringCopy(*(char **)(iVar13 + 0x28));
        *(undefined4 *)(iVar11 + 0x28) = uVar2;
      }
      local_34 = local_34 + 1;
      iVar12 = iVar12 + 0x54;
    } while (local_34 < *(int *)(this + 4));
  }
  return 1;
}

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)