L L4D2node

DTI_HookRecvDecoder

0x0014b070 · 413 bytes · __cdecl

_Z19DTI_HookRecvDecoderP12CRecvDecoder

Decompiled

undefined (1 param)

/* DTI_HookRecvDecoder(CRecvDecoder*) */

void DTI_HookRecvDecoder(CRecvDecoder *param_1)

{
  int *piVar1;
  int iVar2;
  CUtlString *this;
  char *pcVar3;
  int iVar4;
  int iVar5;
  int in_GS_OFFSET;
  CUtlString *local_124;
  char local_120 [256];
  int local_20;
  
  local_20 = *(int *)(in_GS_OFFSET + 0x14);
  if (g_bDTIEnabled != '\0') {
    piVar1 = (int *)CommandLine_Tier0();
    iVar2 = (**(code **)(*piVar1 + 0x28))(piVar1,&DAT_002ad780);
    this = operator_new(0x28);
                    /* try { // try from 0014b0dc to 0014b0e0 has its CatchHandler @ 0014b213 */
    CUtlString::CUtlString(this);
    *(undefined4 *)(this + 0x10) = 0;
    *(undefined4 *)(this + 0x14) = 0;
    *(undefined4 *)(this + 0x18) = 0;
    *(undefined4 *)(this + 0x1c) = 0;
    *(undefined4 *)(this + 0x20) = 0;
    this[0x24] = (CUtlString)0x0;
    local_124 = this;
    CUtlString::Set(this,*(char **)(*(int *)param_1 + 0xc));
    CUtlVector<CDTIProp,CUtlMemory<CDTIProp,int>>::SetCount
              ((CUtlVector<CDTIProp,CUtlMemory<CDTIProp,int>> *)(local_124 + 0x10),
               *(int *)(param_1 + 300));
    iVar4 = 0;
    if (0 < *(int *)(local_124 + 0x1c)) {
LAB_0014b1aa:
      do {
        iVar5 = *(int *)(*(int *)(param_1 + 0x34) + iVar4 * 4);
        if (iVar2 < 1) {
          pcVar3 = *(char **)(iVar5 + 0x30);
        }
        else {
          pcVar3 = *(char **)(iVar5 + 0x30);
          if (*(int *)(iVar5 + 0x2c) != 0) {
            V_snprintf(local_120,0x100,"%s:%s",*(int *)(iVar5 + 0x2c),pcVar3);
            iVar5 = iVar4 * 0x20;
            iVar4 = iVar4 + 1;
            CUtlString::Set((CUtlString *)(iVar5 + *(int *)(local_124 + 0x10)),local_120);
            if (*(int *)(local_124 + 0x1c) <= iVar4) break;
            goto LAB_0014b1aa;
          }
        }
        iVar5 = iVar4 + 1;
        CUtlString::Set((CUtlString *)(iVar4 * 0x20 + *(int *)(local_124 + 0x10)),pcVar3);
        iVar4 = iVar5;
      } while (iVar5 < *(int *)(local_124 + 0x1c));
    }
    CUtlLinkedList<CDTIRecvTable*,int,false,int,CUtlMemory<UtlLinkedListElem_t<CDTIRecvTable*,int>,int>>
    ::InsertBefore((CUtlLinkedList<CDTIRecvTable*,int,false,int,CUtlMemory<UtlLinkedListElem_t<CDTIRecvTable*,int>,int>>
                    *)&g_DTIRecvTables,-1,(CDTIRecvTable **)&local_124);
    *(CUtlString **)(param_1 + 0x148) = local_124;
  }
  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)