L L4D2node

SweepBoxToStudio

0x00b947c0 · 624 bytes · __cdecl

_Z16SweepBoxToStudioP20IPhysicsSurfacePropsRK5Ray_tP10CStudioHdrP18mstudiohitboxset_tPP11matrix3x4_tiR10CGameTrace

Decompiled

undefined (7 params)

/* SweepBoxToStudio(IPhysicsSurfaceProps*, Ray_t const&, CStudioHdr*, mstudiohitboxset_t*,
   matrix3x4_t**, int, CGameTrace&) */

undefined4
SweepBoxToStudio(IPhysicsSurfaceProps *param_1,Ray_t *param_2,CStudioHdr *param_3,
                mstudiohitboxset_t *param_4,matrix3x4_t **param_5,int param_6,CGameTrace *param_7)

{
  undefined4 uVar1;
  char cVar2;
  int iVar3;
  mstudiohitboxset_t *pmVar4;
  int iVar5;
  Ray_t *pRVar6;
  int local_d8;
  Ray_t local_cc [16];
  float local_bc;
  float local_b8;
  float local_b4;
  undefined4 local_70;
  undefined4 local_6c;
  undefined4 local_68;
  undefined4 local_64;
  undefined4 local_60;
  undefined4 local_5c;
  undefined4 local_58;
  undefined4 local_54;
  undefined4 local_50;
  undefined4 local_4c;
  CGameTrace local_48;
  CGameTrace local_47;
  undefined2 local_46;
  float local_44;
  CGameTrace local_3a;
  CGameTrace local_39;
  
  local_d8 = -1;
  *(undefined4 *)(param_7 + 0x2c) = 0x3f800000;
  param_7[0x37] = (CGameTrace)0x0;
  pRVar6 = local_cc;
  for (iVar3 = 0x14; iVar3 != 0; iVar3 = iVar3 + -1) {
    *(undefined4 *)pRVar6 = *(undefined4 *)param_2;
    param_2 = param_2 + 4;
    pRVar6 = pRVar6 + 4;
  }
  iVar3 = 0;
  if (0 < *(int *)(param_4 + 4)) {
    do {
      while( true ) {
        iVar5 = iVar3;
        pmVar4 = param_4 + iVar5 * 0x44 + *(int *)(param_4 + 8);
        if (((param_6 &
             *(uint *)(*(int *)param_3 + 0xb4 +
                      *(int *)pmVar4 * 0xd8 + *(int *)(*(int *)param_3 + 0xa0))) != 0) &&
           (cVar2 = IntersectRayWithOBB(local_cc,param_5[*(int *)pmVar4],(Vector *)(pmVar4 + 8),
                                        (Vector *)(pmVar4 + 0x14),0.0,(CBaseTrace *)&local_70),
           cVar2 != '\0')) break;
        iVar3 = iVar5 + 1;
        if (*(int *)(param_4 + 4) <= iVar5 + 1) goto LAB_00b94990;
      }
      *(undefined4 *)param_7 = local_70;
      *(undefined4 *)(param_7 + 4) = local_6c;
      param_7[0x28] = local_48;
      *(undefined4 *)(param_7 + 8) = local_68;
      *(undefined4 *)(param_7 + 0xc) = local_64;
      param_7[0x29] = local_47;
      *(undefined4 *)(param_7 + 0x10) = local_60;
      param_7[0x36] = local_3a;
      *(undefined4 *)(param_7 + 0x14) = local_5c;
      *(undefined2 *)(param_7 + 0x2a) = local_46;
      *(undefined4 *)(param_7 + 0x18) = local_58;
      *(undefined4 *)(param_7 + 0x1c) = local_54;
      param_7[0x37] = local_39;
      *(undefined4 *)(param_7 + 0x20) = local_50;
      *(undefined4 *)(param_7 + 0x24) = local_4c;
      *(float *)(param_7 + 0x2c) = *(float *)(param_7 + 0x2c) * local_44;
      local_bc = local_bc * local_44;
      local_b8 = local_b8 * local_44;
      local_b4 = local_44 * local_b4;
      local_d8 = iVar5;
      if (local_39 != (CGameTrace)0x0) goto LAB_00b9499f;
      iVar3 = iVar5 + 1;
    } while (iVar5 + 1 < *(int *)(param_4 + 4));
LAB_00b94990:
    if (local_d8 != -1) {
LAB_00b9499f:
      uVar1 = *(undefined4 *)(param_4 + *(int *)(param_4 + 8) + local_d8 * 0x44 + 4);
      *(int *)(param_7 + 0x50) = local_d8;
      *(undefined4 *)(param_7 + 0x44) = uVar1;
      iVar3 = *(int *)(param_4 + *(int *)(param_4 + 8) + local_d8 * 0x44) * 0xd8 +
              *(int *)(*(int *)param_3 + 0xa0) + *(int *)param_3;
      *(uint *)(param_7 + 0x30) = *(uint *)(iVar3 + 0xb4) | 0x40000000;
      uVar1 = *(undefined4 *)(iVar3 + 0xac);
      *(undefined **)(param_7 + 0x3c) = &DAT_00c5994b;
      *(undefined2 *)(param_7 + 0x42) = 0x8000;
      *(short *)(param_7 + 0x48) = (short)uVar1;
      *(short *)(param_7 + 0x40) = (short)*(undefined4 *)(iVar3 + 0xb8);
      return 1;
    }
  }
  return 0;
}

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)