L L4D2node

CVoxelHash::RenderAllObjectsInTree

0x001ded30 · 790 bytes · __cdecl

_ZN10CVoxelHash22RenderAllObjectsInTreeEf

Decompiled

undefined (1 param)

/* CVoxelHash::RenderAllObjectsInTree(float) */

void CVoxelHash::RenderAllObjectsInTree(float param_1)

{
  undefined4 *puVar1;
  ushort uVar2;
  int iVar3;
  undefined4 uVar4;
  int iVar5;
  undefined4 uVar6;
  char cVar7;
  int *piVar8;
  undefined4 *puVar9;
  undefined4 *puVar10;
  int iVar11;
  uint uVar12;
  int iVar13;
  undefined4 *local_74;
  CUtlHashFast<int,CUtlHashFastNoHash> local_68 [72];
  undefined4 local_20;
  
  iVar3 = *(int *)((int)param_1 + 0x1048);
  piVar8 = (int *)___tls_get_addr();
  iVar13 = *(int *)(iVar3 + 0xdc);
  uVar4 = *(undefined4 *)(iVar3 + 0x3c + *piVar8 * 4);
  puVar10 = *(undefined4 **)(iVar3 + 0xd8);
  if (puVar10 != (undefined4 *)0x0) {
    do {
      cVar7 = ThreadInterlockedAssignIf64(iVar3 + 0xd8,*puVar10,iVar13 + -1,puVar10,iVar13);
      if (cVar7 != '\0') {
        uVar2 = *(ushort *)(iVar3 + 0xd4);
        local_74 = puVar10 + 2;
        puVar9 = (undefined4 *)puVar10[4];
        if (uVar2 <= *(ushort *)(puVar10 + 2)) {
          if (puVar9 != (undefined4 *)0x0) {
            memset(puVar9,0,(uint)*(ushort *)((int)puVar10 + 10) << 2);
          }
          goto LAB_001dee0c;
        }
        uVar12 = (int)(uVar2 + 0x1f) >> 5;
        if (uVar12 == *(ushort *)((int)puVar10 + 10)) goto LAB_001def57;
        if (puVar9 == (undefined4 *)0x0) goto LAB_001defd1;
        puVar1 = puVar10 + 3;
        if (puVar9 == puVar1) {
          if (uVar12 != 1) {
            puVar9 = malloc(uVar12 * 4);
            puVar10[4] = puVar9;
            *puVar9 = puVar10[3];
            puVar9 = (undefined4 *)puVar10[4];
          }
          goto LAB_001defee;
        }
        if (uVar12 != 1) {
          puVar9 = realloc(puVar9,uVar12 * 4);
          puVar10[4] = puVar9;
          *(short *)((int)puVar10 + 10) = (short)uVar12;
          goto LAB_001def57;
        }
        puVar10[3] = *puVar9;
        free(puVar9);
        puVar10[4] = puVar1;
        puVar9 = puVar1;
        goto LAB_001defee;
      }
      puVar10 = *(undefined4 **)(iVar3 + 0xd8);
      iVar13 = *(int *)(iVar3 + 0xdc);
    } while (puVar10 != (undefined4 *)0x0);
  }
  puVar10 = operator_new(0x18);
  puVar10[2] = 0;
  local_74 = puVar10 + 2;
  puVar10[3] = 0;
  puVar10[4] = 0;
  uVar2 = *(ushort *)(iVar3 + 0xd4);
  if (*(ushort *)(puVar10 + 2) < uVar2) {
    uVar12 = (int)(uVar2 + 0x1f) >> 5;
    if (uVar12 != *(ushort *)((int)puVar10 + 10)) {
LAB_001defd1:
      if (uVar12 == 1) {
        puVar9 = puVar10 + 3;
        puVar10[4] = puVar9;
      }
      else {
        puVar9 = malloc(uVar12 * 4);
        puVar10[4] = puVar9;
      }
LAB_001defee:
      *(short *)((int)puVar10 + 10) = (short)uVar12;
LAB_001def57:
      if (puVar9 != (undefined4 *)0x0) {
        memset(puVar9,0,uVar12 << 2);
      }
    }
    *(ushort *)(puVar10 + 2) = uVar2;
  }
LAB_001dee0c:
  piVar8 = (int *)___tls_get_addr();
  *(undefined4 **)(iVar3 + 0x3c + *piVar8 * 4) = local_74;
  iVar3 = *(int *)((int)param_1 + 0x1048);
  CUtlHashFast<int,CUtlHashFastNoHash>::CUtlHashFast(local_68);
  iVar13 = 0;
  local_20 = *(undefined4 *)(iVar3 + 0x38);
  do {
    if (*(int *)((int)param_1 + 0x10 + iVar13 * 8) != 0) {
      iVar3 = *(int *)((int)param_1 + 0xc + iVar13 * 8);
      iVar11 = iVar3;
      do {
        if (iVar11 == 0) break;
        for (iVar5 = *(int *)(iVar11 + 4); iVar5 != 0; iVar5 = *(int *)(iVar5 + 8)) {
        }
        iVar11 = *(int *)(iVar11 + 0xc);
      } while (iVar3 != iVar11);
    }
    iVar13 = iVar13 + 1;
    if (iVar13 == 0x200) {
      iVar13 = *(int *)((int)param_1 + 0x1048);
      iVar3 = iVar13 + *piVar8 * 4;
      iVar11 = *(int *)(iVar3 + 0x3c);
      do {
        iVar5 = *(int *)(iVar13 + 0xdc);
        uVar6 = *(undefined4 *)(iVar13 + 0xd8);
        *(undefined4 *)(iVar11 + -8) = uVar6;
                    /* try { // try from 001deee5 to 001deee9 has its CatchHandler @ 001deff7 */
        cVar7 = ThreadInterlockedAssignIf64(iVar13 + 0xd8,iVar11 + -8,iVar5 + 0x10001,uVar6,iVar5);
      } while (cVar7 == '\0');
      *(undefined4 *)(iVar3 + 0x3c) = uVar4;
      CUtlHashFast<int,CUtlHashFastNoHash>::~CUtlHashFast(local_68);
      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)