L L4D2node

SendTable_GenerateProxyPaths

0x00142c20 · 592 bytes · __cdecl

_Z28SendTable_GenerateProxyPathsP17CSendTablePrecalci

Decompiled

undefined (2 params)

/* SendTable_GenerateProxyPaths(CSendTablePrecalc*, int) */

void SendTable_GenerateProxyPaths(CSendTablePrecalc *param_1,int param_2)

{
  undefined2 *puVar1;
  bool bVar2;
  int iVar3;
  size_t __n;
  int local_38 [2];
  void *local_30;
  undefined4 local_2c;
  undefined4 local_28;
  int local_24;
  void *local_20;
  
  *(undefined4 *)(param_1 + 0x24) = 0;
  if (param_2 == 0) {
    local_38[0] = 0;
    __n = 0;
    local_30 = (void *)0x0;
    local_2c = 0;
    local_28 = 0;
    local_24 = 0;
    local_20 = (void *)0x0;
    goto LAB_00142c6f;
  }
  CUtlVector<CSendTablePrecalc::CProxyPath,CUtlMemory<CSendTablePrecalc::CProxyPath,int>>::
  GrowVector((CUtlVector<CSendTablePrecalc::CProxyPath,CUtlMemory<CSendTablePrecalc::CProxyPath,int>>
              *)(param_1 + 0x18),param_2);
  bVar2 = 0 < param_2;
  if (*(int *)(param_1 + 0x24) - param_2 < 1) {
    if (bVar2) {
LAB_00142d2c:
      iVar3 = 0;
      do {
        puVar1 = (undefined2 *)(*(int *)(param_1 + 0x18) + iVar3 * 4);
        iVar3 = iVar3 + 1;
        puVar1[1] = 0xffff;
        *puVar1 = 0xffff;
      } while (iVar3 != param_2);
      __n = iVar3 * 4;
      local_38[0] = 0;
      local_30 = (void *)0x0;
      local_2c = 0;
      local_28 = 0;
      local_24 = 0;
      local_20 = (void *)0x0;
      CUtlVector<int,CUtlMemory<int,int>>::GrowVector
                ((CUtlVector<int,CUtlMemory<int,int>> *)&local_30,iVar3);
      if ((bVar2) && (0 < local_24 - iVar3)) {
        _V_memmove((void *)((int)local_30 + __n),local_30,(local_24 - iVar3) * 4);
      }
      goto LAB_00142c6f;
    }
  }
  else if (bVar2) {
    _V_memmove((void *)((int)*(void **)(param_1 + 0x18) + param_2 * 4),*(void **)(param_1 + 0x18),
               (*(int *)(param_1 + 0x24) - param_2) * 4);
    goto LAB_00142d2c;
  }
  __n = param_2 * 4;
  local_38[0] = 0;
  local_30 = (void *)0x0;
  local_2c = 0;
  local_28 = 0;
  local_24 = 0;
  local_20 = (void *)0x0;
  CUtlVector<int,CUtlMemory<int,int>>::GrowVector
            ((CUtlVector<int,CUtlMemory<int,int>> *)&local_30,param_2);
LAB_00142c6f:
  memset(local_30,0,__n);
  CalcPathLengths_R((CSendNode *)(param_1 + 0x68),(CUtlVector *)&local_30,0,local_38);
  iVar3 = local_38[0];
  local_38[1] = 0;
  *(undefined4 *)(param_1 + 0x10) = 0;
  if (local_38[0] != 0) {
    CUtlVector<CSendTablePrecalc::CProxyPathEntry,CUtlMemory<CSendTablePrecalc::CProxyPathEntry,int>>
    ::GrowVector((CUtlVector<CSendTablePrecalc::CProxyPathEntry,CUtlMemory<CSendTablePrecalc::CProxyPathEntry,int>>
                  *)(param_1 + 4),local_38[0]);
    if ((0 < *(int *)(param_1 + 0x10) - iVar3) && (0 < iVar3)) {
                    /* try { // try from 00142dee to 00142e1b has its CatchHandler @ 00142e8e */
      _V_memmove((void *)((int)*(void **)(param_1 + 4) + iVar3 * 4),*(void **)(param_1 + 4),
                 (*(int *)(param_1 + 0x10) - iVar3) * 4);
    }
  }
  FillPathEntries_R(param_1,(CSendNode *)(param_1 + 0x68),(CSendNode *)0x0,local_38 + 1);
  local_24 = 0;
  CUtlMemory<int,int>::Purge((CUtlMemory<int,int> *)&local_30);
  local_20 = local_30;
  CUtlMemory<int,int>::Purge((CUtlMemory<int,int> *)&local_30);
  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)