L L4D2node

CRestore::ScanAheadForHammerID

0x004a6820 · 238 bytes · __thiscall

_ZN8CRestore20ScanAheadForHammerIDEv

Decompiled

undefined (1 param)

/* CRestore::ScanAheadForHammerID() */

undefined4 __thiscall CRestore::ScanAheadForHammerID(CRestore *this)

{
  int *piVar1;
  int iVar2;
  char *pcVar3;
  int iVar4;
  undefined4 uVar5;
  int iVar6;
  int iVar7;
  ushort local_20;
  ushort local_1e;
  
  iVar7 = 0;
  iVar6 = *(int *)(*(int *)(this + 0x18) + 8);
  (**(code **)(*(int *)this + 0x30))(this);
  (**(code **)(*(int *)this + 0x30))(this);
  iVar2 = (**(code **)(*(int *)this + 0x3c))(this);
  if (0 < iVar2) {
    do {
      (**(code **)(*(int *)this + 0x24))(this,&local_20);
      pcVar3 = "<<illegal>>";
      if ((int)(uint)local_1e < *(int *)(*(int *)(this + 0x18) + 0x10)) {
        pcVar3 = *(char **)(*(int *)(*(int *)(this + 0x18) + 0x14) + (uint)local_1e * 4);
      }
      iVar4 = _V_stricmp("m_iHammerID",pcVar3);
      if (iVar4 == 0) {
        iVar7 = *(int *)(this + 0x18);
        iVar4 = *(int *)(iVar7 + 8);
        iVar2 = *(int *)(iVar7 + 0xc);
        if (iVar4 == iVar2) goto LAB_004a68e6;
        if (iVar2 - iVar4 < 4) {
          *(int *)(iVar7 + 8) = iVar2;
          uVar5 = 0xffffffff;
          iVar7 = *(int *)(this + 0x18);
          iVar4 = *(int *)(iVar7 + 8);
        }
        else {
          uVar5 = **(undefined4 **)(iVar7 + 4);
          *(int *)(iVar7 + 8) = iVar4 + 4;
          *(undefined4 **)(iVar7 + 4) = *(undefined4 **)(iVar7 + 4) + 1;
          iVar7 = *(int *)(this + 0x18);
          iVar4 = *(int *)(iVar7 + 8);
        }
        goto LAB_004a68eb;
      }
      iVar4 = *(int *)(this + 0x18);
      iVar7 = iVar7 + 1;
      piVar1 = (int *)(iVar4 + 4);
      *piVar1 = *piVar1 + (uint)local_20;
      piVar1 = (int *)(iVar4 + 8);
      *piVar1 = *piVar1 + (uint)local_20;
    } while (iVar7 != iVar2);
  }
  iVar7 = *(int *)(this + 0x18);
  iVar4 = *(int *)(iVar7 + 8);
LAB_004a68e6:
  uVar5 = 0xffffffff;
LAB_004a68eb:
  iVar6 = iVar4 - iVar6;
  if (iVar4 < iVar6) {
    iVar6 = iVar4;
  }
  *(int *)(iVar7 + 4) = *(int *)(iVar7 + 4) - iVar6;
  *(int *)(iVar7 + 8) = iVar4 - iVar6;
  return uVar5;
}

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)