L L4D2node

CNavMesh::PrintAllPlaces

0x007436c0 · 680 bytes · __thiscall

_ZNK8CNavMesh14PrintAllPlacesEv

Decompiled

undefined (1 param)

/* CNavMesh::PrintAllPlaces() const */

void __thiscall CNavMesh::PrintAllPlaces(CNavMesh *this)

{
  char **ppcVar1;
  char *pcVar2;
  size_t sVar3;
  int iVar4;
  char **ppcVar5;
  size_t sVar6;
  int iVar7;
  uint uVar8;
  int iVar9;
  undefined4 uVar10;
  int local_48;
  void *local_30;
  int local_2c;
  int local_28;
  size_t local_24;
  void *local_20;
  
  if (*(int *)(this + 0x454) == 0) {
    Msg("There are no entries in the Place database.\n");
    return;
  }
  local_30 = (void *)0x0;
  local_2c = 0;
  uVar8 = 0;
  local_28 = 0;
  local_24 = 0;
  local_20 = (void *)0x0;
  do {
    sVar3 = local_24;
    sVar6 = local_24 + 1;
    uVar10 = *(undefined4 *)(*(int *)(this + 0x450) + uVar8 * 4);
    if ((local_2c < (int)sVar6) && (-1 < local_28)) {
      if (local_28 == 0) {
        iVar7 = local_2c;
        if (local_2c == 0) {
          if ((int)sVar6 < 9) {
            local_2c = 8;
            goto LAB_0074378f;
          }
          iVar7 = 8;
        }
        do {
          local_2c = iVar7 * 2;
          if ((int)sVar6 <= local_2c) break;
          local_2c = iVar7 * 4;
          iVar7 = local_2c;
        } while (local_2c < (int)sVar6);
      }
      else {
        for (local_2c = ((int)local_24 / local_28 + 1) * local_28; local_2c < (int)sVar6;
            local_2c = (int)(local_2c + sVar6) / 2) {
        }
      }
LAB_0074378f:
      if (local_30 == (void *)0x0) {
        local_30 = malloc(local_2c << 2);
      }
      else {
        local_30 = realloc(local_30,local_2c << 2);
        sVar6 = local_24 + 1;
      }
    }
    iVar9 = sVar3 * 4;
    iVar7 = (sVar6 - sVar3) + -1;
    local_24 = sVar6;
    local_20 = local_30;
    if (0 < iVar7) {
                    /* try { // try from 007437cd to 007438db has its CatchHandler @ 00743995 */
      _V_memmove((void *)((int)local_30 + iVar9 + 4),(void *)((int)local_30 + iVar9),iVar7 * 4);
    }
    if ((undefined4 *)(iVar9 + (int)local_30) != (undefined4 *)0x0) {
      *(undefined4 *)(iVar9 + (int)local_30) = uVar10;
    }
    uVar8 = uVar8 + 1;
    if (*(uint *)(this + 0x454) <= uVar8) {
      if (1 < (int)local_24) {
        if (local_30 == (void *)0x0) {
          local_48 = local_24 - 1;
          do {
            if (0 < local_48) {
              iVar9 = 0;
              iVar7 = 1;
              do {
                while( true ) {
                  ppcVar1 = (char **)((int)local_30 + iVar7 * 4);
                  ppcVar5 = (char **)((int)local_30 + iVar9);
                  iVar4 = StringSort(ppcVar5,ppcVar1);
                  if (-1 < iVar4) break;
                  iVar7 = iVar7 + 1;
                  pcVar2 = *ppcVar5;
                  iVar9 = iVar9 + 4;
                  *ppcVar5 = *ppcVar1;
                  *ppcVar1 = pcVar2;
                  if (local_48 + 1 == iVar7) goto LAB_0074397c;
                }
                iVar7 = iVar7 + 1;
                iVar9 = iVar9 + 4;
              } while (local_48 + 1 != iVar7);
            }
LAB_0074397c:
            local_48 = local_48 + -1;
          } while (local_48 != -1);
        }
        else {
          qsort(local_30,local_24,4,StringSort);
        }
      }
      uVar8 = 0;
      while (uVar8 < local_24) {
        iVar7 = NameToPlace(this,*(char **)((int)local_30 + uVar8 * 4));
        uVar10 = *(undefined4 *)((int)local_30 + uVar8 * 4);
        if (iVar7 == *(int *)(this + 0x460)) {
          Msg("--> %-26s",uVar10);
        }
        else {
          Msg("%-30s",uVar10);
        }
        uVar8 = uVar8 + 1;
        if (uVar8 == (uVar8 / 3) * 3) {
          Msg(&DAT_00cff71e,uVar10);
        }
      }
      Msg(&DAT_00cff71e);
      local_24 = 0;
      CUtlMemory<char_const*,int>::Purge((CUtlMemory<char_const*,int> *)&local_30);
      local_20 = local_30;
      CUtlMemory<char_const*,int>::Purge((CUtlMemory<char_const*,int> *)&local_30);
      return;
    }
  } while( true );
}

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)