L L4D2node

CBasePlayer::DumpPerfToRecipient

0x007ad940 · 1105 bytes · __thiscall

_ZN11CBasePlayer19DumpPerfToRecipientEPS_i

Decompiled

undefined (3 params)

/* CBasePlayer::DumpPerfToRecipient(CBasePlayer*, int) */

void __thiscall CBasePlayer::DumpPerfToRecipient(CBasePlayer *this,CBasePlayer *param_1,int param_2)

{
  uint uVar1;
  int iVar2;
  int iVar3;
  int iVar4;
  float *pfVar5;
  int iVar6;
  char *pcVar7;
  int in_GS_OFFSET;
  double dVar8;
  float fVar9;
  float fVar10;
  float fVar11;
  float fVar12;
  int local_1b4;
  char local_1a0 [128];
  char local_120 [256];
  int local_20;
  
  local_20 = *(int *)(in_GS_OFFSET + 0x14);
  if (param_1 != (CBasePlayer *)0x0) {
    pcVar7 = local_120;
    for (iVar3 = 0x40; iVar3 != 0; iVar3 = iVar3 + -1) {
      pcVar7[0] = '\0';
      pcVar7[1] = '\0';
      pcVar7[2] = '\0';
      pcVar7[3] = '\0';
      pcVar7 = pcVar7 + 4;
    }
    uVar1 = (uint)*(ushort *)(this + 0x22f6);
    if (uVar1 != 0xffff) {
      fVar12 = 0.0;
      fVar9 = 0.0;
      iVar3 = *(int *)(this + 0x22e8);
      iVar6 = 0;
      iVar4 = 0;
      fVar10 = fVar9;
      fVar11 = fVar12;
      do {
        pfVar5 = (float *)(iVar3 + uVar1 * 0x28);
        fVar10 = fVar10 - pfVar5[3];
        if ((iVar6 < 1) || (fVar10 <= 0.0)) {
          dVar8 = 0.0;
        }
        else {
          dVar8 = (double)(SQRT((pfVar5[7] - fVar9) * (pfVar5[7] - fVar9) +
                                (pfVar5[6] - fVar12) * (pfVar5[6] - fVar12) +
                                (pfVar5[8] - fVar11) * (pfVar5[8] - fVar11)) / fVar10);
        }
        iVar2 = V_snprintf(local_1a0,0x80,"%.3f %d %d %.3f %.3f %.3f [vel %.2f]\n",(double)*pfVar5,
                           pfVar5[1],pfVar5[2],(double)pfVar5[3],(double)pfVar5[4],(double)pfVar5[5]
                           ,dVar8);
        if (iVar4 + iVar2 < 0xc9) {
          iVar3 = 0x100 - iVar4;
          iVar2 = iVar4 + iVar2;
        }
        else {
          ClientPrint(param_1,2,local_120,(char *)0x0,(char *)0x0,(char *)0x0,(char *)0x0);
          iVar4 = 0;
          local_120[0] = '\0';
          iVar3 = 0x100;
        }
        iVar6 = iVar6 + 1;
        V_strncpy(local_120 + iVar4,local_1a0,iVar3);
        if ((param_2 <= iVar6) && (param_2 != -1)) break;
        fVar12 = pfVar5[6];
        fVar9 = pfVar5[7];
        fVar11 = pfVar5[8];
        fVar10 = pfVar5[3];
        iVar3 = *(int *)(this + 0x22e8);
        uVar1 = (uint)*(ushort *)(iVar3 + 0x24 + uVar1 * 0x28);
        iVar4 = iVar2;
      } while (uVar1 != 0xffff);
      if (0 < iVar2) {
        ClientPrint(param_1,2,local_120,(char *)0x0,(char *)0x0,(char *)0x0,(char *)0x0);
      }
    }
    uVar1 = (uint)*(ushort *)(this + 0x2312);
    if (uVar1 != 0xffff) {
      iVar3 = *(int *)(this + 0x2304);
      local_1b4 = 0;
      iVar4 = 0;
      do {
        pfVar5 = (float *)(iVar3 + uVar1 * 0x10);
        iVar3 = V_snprintf(local_1a0,0x80,"%.3f %d %d\n",(double)*pfVar5,pfVar5[1],pfVar5[2]);
        iVar6 = iVar4 + iVar3;
        if (iVar6 < 0xc9) {
          iVar2 = 0x100 - iVar4;
        }
        else {
          ClientPrint(param_1,2,local_120,(char *)0x0,(char *)0x0,(char *)0x0,(char *)0x0);
          iVar4 = 0;
          local_120[0] = '\0';
          iVar2 = 0x100;
          iVar6 = iVar3;
        }
        V_strncpy(local_120 + iVar4,local_1a0,iVar2);
        local_1b4 = local_1b4 + 1;
        if ((param_2 != -1) && (param_2 <= local_1b4)) break;
        iVar3 = *(int *)(this + 0x2304);
        uVar1 = (uint)*(ushort *)(iVar3 + 0xc + uVar1 * 0x10);
        iVar4 = iVar6;
      } while (uVar1 != 0xffff);
      if (0 < iVar6) {
        ClientPrint(param_1,2,local_120,(char *)0x0,(char *)0x0,(char *)0x0,(char *)0x0);
      }
    }
  }
  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)