L L4D2node

rr2::CResponseDB::FindBestMatch

0x00bd82a0 · 640 bytes · __cdecl

_ZN3rr211CResponseDB13FindBestMatchERNS_14CResponseQueryEPNS_11IResponseDB20MatchProfilingData_tE

Decompiled

undefined (2 params)

/* WARNING: Globals starting with '_' overlap smaller symbols at the same address */
/* rr2::CResponseDB::FindBestMatch(rr2::CResponseQuery&, rr2::IResponseDB::MatchProfilingData_t*) */

CResponseQuery *
rr2::CResponseDB::FindBestMatch(CResponseQuery *param_1,MatchProfilingData_t *param_2)

{
  int iVar1;
  undefined8 uVar2;
  undefined8 uVar3;
  undefined8 uVar4;
  undefined8 uVar5;
  char cVar6;
  int iVar7;
  longdouble lVar8;
  CResponseQuery *in_stack_0000000c;
  int *in_stack_00000010;
  undefined4 local_3c;
  undefined4 local_38;
  undefined4 local_34;
  undefined4 local_30;
  int local_2c;
  undefined4 local_28;
  undefined4 local_24;
  undefined4 local_20;
  
  local_3c = 0;
  local_38 = 0;
  if (___atan2f_finite == 0) {
    local_2c = 0;
  }
  else {
    (**(code **)(___atan2f_finite + 0x50))
              (___atan2f_finite,&local_3c,0,0,0,0,"/data/src/responselib/responsedb.cpp",0x58,
               &FindBestMatch(rr2::CResponseQuery&,rr2::IResponseDB::MatchProfilingData_t*)::tm_fmt,
               "(%s)%s","Unaccounted","CResponseDB::FindBestMatch");
    local_2c = ___atan2f_finite;
  }
  iVar1 = _DAT_0105db00;
  local_34 = local_3c;
  local_30 = local_38;
                    /* try { // try from 00bd84c6 to 00bd8514 has its CatchHandler @ 00bd8554 */
  if (((_DAT_0105d154 != 0) || (DAT_0105d158 == '\0')) &&
     (iVar7 = ThreadGetCurrentId(), iVar1 == iVar7)) {
    if ((char *)*_DAT_0105d15c != "CResponseDB::FindBestMatch") {
      _DAT_0105d15c =
           (int *)CVProfNode::GetSubNode((char *)_DAT_0105d15c,0xd56f30,(char *)0x1,0xbfafa1);
    }
    CVProfNode::EnterScope();
    DAT_0105d158 = '\0';
  }
  *(undefined4 *)param_1 = 0xcf000000;
  *(undefined2 *)(param_1 + 6) = 0;
  *(undefined2 *)(param_1 + 4) = 0;
  *(undefined4 *)(param_1 + 8) = 0;
  uVar2 = rdtsc();
                    /* try { // try from 00bd837a to 00bd83d2 has its CatchHandler @ 00bd8533 */
  CResponseQuery::Sort(in_stack_0000000c);
  uVar3 = rdtsc();
  iVar1 = *(int *)(param_2 + 0x48);
  uVar4 = rdtsc();
  iVar7 = 0;
  if (0 < iVar1) {
    do {
      lVar8 = (longdouble)
              CRule::Match((CRule *)(iVar7 * 100 + *(int *)(param_2 + 0x3c)),in_stack_0000000c,
                           (MatchInfo_t *)&local_28);
      if (*(float *)param_1 <= (float)lVar8) {
        *(undefined4 *)param_1 = local_28;
        *(undefined4 *)(param_1 + 4) = local_24;
        *(undefined4 *)(param_1 + 8) = local_20;
      }
      iVar7 = iVar7 + 1;
    } while (iVar7 != iVar1);
  }
  uVar5 = rdtsc();
  if (in_stack_00000010 != (int *)0x0) {
    iVar1 = *(int *)(in_stack_0000000c + 0xc);
    *in_stack_00000010 = (uint)uVar5 - (uint)uVar4;
    in_stack_00000010[1] =
         ((int)((ulonglong)uVar5 >> 0x20) - (int)((ulonglong)uVar4 >> 0x20)) -
         (uint)((uint)uVar5 < (uint)uVar4);
    in_stack_00000010[4] = iVar1;
    in_stack_00000010[5] = iVar7;
    in_stack_00000010[2] = (uint)uVar3 - (uint)uVar2;
    in_stack_00000010[3] =
         ((int)((ulonglong)uVar3 >> 0x20) - (int)((ulonglong)uVar2 >> 0x20)) -
         (uint)((uint)uVar3 < (uint)uVar2);
  }
  iVar1 = _DAT_0105db00;
  if (((DAT_0105d158 == '\0') || (_DAT_0105d154 != 0)) &&
     (iVar7 = ThreadGetCurrentId(), iVar1 == iVar7)) {
    cVar6 = CVProfNode::ExitScope();
    if (cVar6 != '\0') {
      _DAT_0105d15c = (int *)_DAT_0105d15c[0x19];
    }
    DAT_0105d158 = _DAT_0105d15c == (int *)0x105d160;
  }
  if (local_2c != 0) {
    (**(code **)(local_2c + 0x54))(local_2c,local_34,local_30,0,0,0);
  }
  return param_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)