L L4D2node

CStudioHdr::GroupStudioHdr

0x0059d2d0 · 382 bytes · __thiscall

_ZN10CStudioHdr14GroupStudioHdrEi

Decompiled

undefined (2 params)

/* CStudioHdr::GroupStudioHdr(int) */

int __thiscall CStudioHdr::GroupStudioHdr(CStudioHdr *this,int param_1)

{
  CStudioHdr *pCVar1;
  uint uVar2;
  char cVar3;
  uint uVar4;
  int iVar5;
  char *pcVar6;
  
  if ((this == (CStudioHdr *)0x0) && (GroupStudioHdr(int)::__executeCount < 5)) {
    GroupStudioHdr(int)::__executeCount = GroupStudioHdr(int)::__executeCount + 1;
    Warning("Call to NULL CStudioHdr::GroupStudioHdr()\n");
  }
  if (*(int *)(this + 0x1c) == **(int **)(this + 0x20)) goto LAB_0059d35e;
  uVar4 = ThreadGetCurrentId();
  pCVar1 = this + 0x24;
  if (uVar4 == *(uint *)(this + 0x24)) {
LAB_0059d30e:
    *(int *)(this + 0x28) = *(int *)(this + 0x28) + 1;
  }
  else {
    LOCK();
    uVar2 = *(uint *)pCVar1;
    if (uVar2 == 0) {
      *(uint *)pCVar1 = uVar4;
    }
    UNLOCK();
    if (uVar2 == 0) goto LAB_0059d30e;
    CThreadFastMutex::Lock((uint)pCVar1,uVar4);
  }
  if (**(int **)(this + 0x20) != *(int *)(this + 0x1c)) {
    memset(*(void **)(this + 8),0,*(int *)(this + 0x14) * 4);
    *(undefined4 *)(this + 0x1c) = **(undefined4 **)(this + 0x20);
  }
  *(int *)(this + 0x28) = *(int *)(this + 0x28) + -1;
  if (*(int *)(this + 0x28) == 0) {
    LOCK();
    *(uint *)pCVar1 = 0;
    UNLOCK();
  }
LAB_0059d35e:
  if ((param_1 < 0) || (*(int *)(this + 0x14) <= param_1)) {
    pcVar6 = "<<null>>";
    if (*(int *)this != 0) {
      pcVar6 = (char *)(*(int *)this + 0xc);
    }
    if (GroupStudioHdr(int)::__executeCount < 5) {
      GroupStudioHdr(int)::__executeCount = GroupStudioHdr(int)::__executeCount + 1;
      Warning("Invalid index passed to CStudioHdr(%s)::GroupStudioHdr(): %d [%d]\n",pcVar6,param_1,
              *(undefined4 *)(this + 0x14));
      cVar3 = Plat_IsInDebugSession(0);
    }
    else {
      cVar3 = Plat_IsInDebugSession(0);
    }
    if (cVar3 != '\0') {
      raise(5);
    }
    iVar5 = *(int *)this;
  }
  else {
    iVar5 = *(int *)(*(int *)(this + 8) + param_1 * 4);
    if (iVar5 == 0) {
      iVar5 = virtualgroup_t::GetStudioHdr
                        ((virtualgroup_t *)(param_1 * 0x90 + *(int *)(*(int *)(this + 4) + 0x58)));
      *(int *)(*(int *)(this + 8) + param_1 * 4) = iVar5;
    }
  }
  return iVar5;
}

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)