L L4D2node

CScriptHud::HUDFrameUpdate

0x00906c40 · 1143 bytes · __thiscall

_ZN10CScriptHud14HUDFrameUpdateEv

Decompiled

undefined (1 param)

/* CScriptHud::HUDFrameUpdate() */

void __thiscall CScriptHud::HUDFrameUpdate(CScriptHud *this)

{
  void *pvVar1;
  void *pvVar2;
  char cVar3;
  undefined4 *puVar4;
  int iVar5;
  void **ppvVar6;
  int iVar7;
  uint uVar8;
  char *pcVar9;
  int iVar10;
  undefined4 uVar11;
  longdouble lVar12;
  undefined4 uVar13;
  uint local_60;
  void *local_5c [2];
  undefined2 local_54;
  ushort local_52;
  void *local_50;
  undefined4 local_4c;
  undefined2 local_48;
  ushort local_46;
  void *local_44;
  undefined4 local_40;
  ushort local_3c;
  ushort local_3a;
  void *local_38;
  undefined4 local_34;
  undefined2 local_30;
  ushort local_2e;
  void *local_2c [2];
  undefined2 local_24;
  ushort local_22;
  void *local_1d [3];
  
  iVar5 = *(int *)this;
  if (iVar5 != -1) {
    if (0.0 < *(float *)(this + 0x10)) {
      lVar12 = (longdouble)CountdownTimer::Now();
      if ((float)lVar12 < *(float *)(this + 0x10)) {
        return;
      }
      iVar5 = *(int *)this;
    }
    local_5c[0] = (void *)0x0;
    local_54 = 0;
    local_52 = 0;
                    /* try { // try from 00906cbb to 00906cc0 has its CatchHandler @ 009070fa */
    cVar3 = (**(code **)(*g_pScriptVM + 0x90))(g_pScriptVM,iVar5,"Fields",local_5c);
    pvVar2 = local_5c[0];
    if (cVar3 == '\0') {
                    /* try { // try from 00906fbf to 00906fc3 has its CatchHandler @ 009070fa */
      DevWarning(
                "Hey, you are trying to FrameUpdate the HUD but there isn\'t a .Fields in your HUDTable\n"
                );
    }
    else {
      iVar5 = *(int *)(this + 4);
      if (iVar5 != 0) {
        local_2c[0] = (void *)0x0;
        local_24 = 0;
        pvVar1 = *(void **)this;
        local_22 = 0;
                    /* try { // try from 00906d07 to 00906d0b has its CatchHandler @ 009070da */
        puVar4 = (undefined4 *)CDirector::GetScriptScope(TheDirector,*(undefined4 *)(this + 0x18));
        local_2e = 0;
        local_34 = 0;
        local_30 = 0x20;
                    /* try { // try from 00906d5b to 00906d5d has its CatchHandler @ 00907115 */
        local_38 = pvVar1;
        iVar5 = (**(code **)(*g_pScriptVM + 0x50))(g_pScriptVM,iVar5,&local_38,1,local_2c,*puVar4,1)
        ;
        if ((local_2e & 1) != 0) {
          free(local_38);
        }
        if (iVar5 != 0) {
                    /* try { // try from 00906d80 to 00906d84 has its CatchHandler @ 009070da */
          DevWarning("Couldnt call Scripted HUD Table Update Function!\n");
        }
        if ((local_22 & 1) != 0) {
          free(local_2c[0]);
        }
      }
      local_50 = (void *)0x0;
      local_48 = 0;
      local_46 = 0;
      local_3c = 0;
      local_3a = 0;
      local_44 = (void *)0x0;
                    /* try { // try from 00906dd6 to 00906f06 has its CatchHandler @ 009070fe */
      iVar5 = (**(code **)(*g_pScriptVM + 0x88))(g_pScriptVM,pvVar2);
      ppvVar6 = local_2c;
      do {
        *(undefined1 *)ppvVar6 = 0;
        ppvVar6 = (void **)((int)ppvVar6 + 1);
      } while (ppvVar6 != local_1d);
      if (0 < iVar5) {
        iVar10 = 0;
        uVar11 = 0;
        do {
          uVar11 = (**(code **)(*g_pScriptVM + 0x8c))(g_pScriptVM,pvVar2,uVar11,&local_50,&local_44)
          ;
          if (local_3c == 0x20) {
            uVar13 = 0;
            iVar7 = HUDParseElementData((HSCRIPT__ *)this,SUB41(local_44,0));
            if (iVar7 == -1) {
              Warning("Error parsing HUD table element named %s\n",local_50,uVar13);
            }
            else if (*(char *)((int)local_2c + iVar7) == '\0') {
              *(undefined1 *)((int)local_2c + iVar7) = 1;
            }
            else {
                    /* try { // try from 00906fe2 to 009070ce has its CatchHandler @ 009070fe */
              Warning("Error: You used slot %d more than once in your HUD Table (key %s)\n",iVar7,
                      local_50);
            }
          }
          else {
            pcVar9 = "unknown_variant_type";
            if (local_3c < 0x29) {
              pcVar9 = *(char **)(CSWTCH_689 + (uint)local_3c * 4);
            }
            Warning("Your HUD Table has something in it that isnt a table! [key %s type %s]\n",
                    local_50,pcVar9);
          }
          (**(code **)(*g_pScriptVM + 0x9c))(g_pScriptVM,&local_50);
          (**(code **)(*g_pScriptVM + 0x9c))(g_pScriptVM,&local_44);
          iVar10 = iVar10 + 1;
        } while (iVar10 != iVar5);
      }
      iVar5 = 0;
      do {
        if (*(char *)((int)local_2c + iVar5) == '\0') {
          iVar10 = g_pGameRules + iVar5 * 4;
          uVar8 = *(uint *)(iVar10 + 0x518);
          if ((uVar8 & 0x4000) == 0) {
            uVar8 = uVar8 | 0x4000;
            local_60 = uVar8;
            iVar7 = memcmp((void *)(g_pGameRules + 0x518 + iVar5 * 4),&local_60,4);
            if (iVar7 != 0) {
              CGameRulesProxy::NotifyNetworkStateChanged();
              *(uint *)(iVar10 + 0x518) = uVar8;
            }
          }
        }
        iVar5 = iVar5 + 1;
      } while (iVar5 != 0xf);
      lVar12 = (longdouble)CountdownTimer::Now();
      if ((float)lVar12 + 0.2 != *(float *)(this + 0x10)) {
        (**(code **)(*(int *)(this + 8) + 4))(this + 8,this + 0x10);
        *(float *)(this + 0x10) = (float)lVar12 + 0.2;
      }
      if (*(float *)(this + 0xc) != 0.2) {
        (**(code **)(*(int *)(this + 8) + 4))(this + 8,this + 0xc);
        *(undefined4 *)(this + 0xc) = 0x3e4ccccd;
      }
      if ((local_3a & 1) != 0) {
        free(local_44);
        local_3a = local_3a & 0xfffe;
      }
      local_44 = (void *)0x0;
      local_40 = 0;
      local_3c = 0;
      if ((local_46 & 1) != 0) {
        free(local_50);
        local_46 = local_46 & 0xfffe;
      }
      local_50 = (void *)0x0;
      local_4c = 0;
      local_48 = 0;
    }
    if ((local_52 & 1) != 0) {
      free(local_5c[0]);
    }
  }
  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)