L L4D2node

CCommentaryDummy::Spawn

0x003e1520 · 534 bytes · __thiscall

_ZN16CCommentaryDummy5SpawnEv

Decompiled

undefined (1 param)

/* CCommentaryDummy::Spawn() */

void __thiscall CCommentaryDummy::Spawn(CCommentaryDummy *this)

{
  byte bVar1;
  code *pcVar2;
  undefined1 *puVar3;
  uint *puVar4;
  byte *pbVar5;
  int iVar6;
  int iVar7;
  uint uVar8;
  byte *pbVar9;
  int *piVar10;
  int *piVar11;
  char *pcVar12;
  undefined1 *puVar13;
  byte *pbVar14;
  int in_GS_OFFSET;
  bool bVar15;
  undefined1 **local_50;
  undefined1 **local_48;
  size_t sStack_44;
  byte abStack_40 [4];
  uint local_3c;
  int local_38;
  byte *local_34;
  undefined1 *local_30;
  undefined1 *local_2c;
  undefined4 local_28;
  float local_24;
  int local_20;
  
  piVar11 = (int *)&stack0xffffffb4;
  local_20 = *(int *)(in_GS_OFFSET + 0x14);
  local_50 = (undefined1 **)0x3e1544;
  CBaseCombatCharacter::Spawn((CBaseCombatCharacter *)this);
  local_48 = &local_2c;
  local_24 = (float)*(int *)(this + 0x1a3c);
  local_2c = (undefined1 *)0x0;
  local_28 = 0;
  local_50 = (undefined1 **)0x3e1573;
  (**(code **)(*(int *)this + 0x254))();
  pcVar12 = "";
  if (*(char **)(this + 0x1a60) != (char *)0x0) {
    pcVar12 = *(char **)(this + 0x1a60);
  }
  if (*pcVar12 != '\0') {
    local_50 = (undefined1 **)0x3e1608;
    iVar7 = _V_strlen(pcVar12);
    iVar6 = -((iVar7 + 0x10U & 0xfffffff0) + 0x10);
    piVar10 = (int *)(&stack0xffffffb4 + iVar6);
    piVar11 = (int *)(&stack0xffffffb4 + iVar6);
    *(int *)(abStack_40 + iVar6 + -4) = iVar7 + 1;
    *(char **)((int)&stack0xffffffb8 + iVar6) = pcVar12;
    *(byte **)(&stack0xffffffb4 + iVar6) = abStack_40 + iVar6;
    local_34 = abStack_40 + iVar6;
    *(undefined4 *)((int)&local_50 + iVar6) = 0x3e1630;
    memcpy(*(void **)(&stack0xffffffb4 + iVar6),*(void **)((int)&stack0xffffffb8 + iVar6),
           *(size_t *)(abStack_40 + iVar6 + -4));
    pbVar9 = local_34;
    bVar15 = local_34 < local_34 + iVar7 + 1;
    local_34 = local_34 + iVar7 + 1;
    pbVar5 = pbVar9;
    if (bVar15) {
      do {
        pbVar14 = pbVar5 + 1;
        bVar1 = *pbVar5;
        piVar11 = piVar10;
        if (((bVar1 == 0x2c) || (bVar1 == 0x3b)) || ((bVar1 & 0xdf) == 0)) {
          *pbVar5 = 0;
          *piVar10 = (int)pbVar9;
          piVar10[2] = 1;
          piVar10[1] = -1;
          piVar10[-1] = 0x3e167a;
          iVar6 = CreateEntityByName((char *)*piVar10,piVar10[1],SUB41(piVar10[2],0));
          pbVar9 = pbVar14;
          if (iVar6 != 0) {
            iVar7 = *(int *)this;
            local_38 = iVar6;
            *piVar10 = (int)&local_2c;
            piVar10[1] = (int)this;
            pcVar2 = *(code **)(iVar7 + 0x234);
            piVar10[-1] = 0x3e1699;
            (*pcVar2)();
            iVar6 = local_38;
            piVar11 = piVar10 + -1;
            *piVar10 = (int)&local_2c;
            piVar10[-1] = iVar6;
            piVar10[-2] = 0x3e16ae;
            CBaseEntity::SetLocalOrigin((CBaseEntity *)piVar10[-1],(Vector *)*piVar10);
            uVar8 = *(uint *)(local_38 + 0x148) | 0x40000000;
            iVar6 = local_38;
            if (*(uint *)(local_38 + 0x148) != uVar8) {
              if (*(char *)(local_38 + 0x6c) == '\0') {
                puVar4 = *(uint **)(local_38 + 0x30);
                if (puVar4 != (uint *)0x0) {
                  *puVar4 = *puVar4 | 0x101;
                  piVar10[-1] = (int)puVar4;
                  local_3c = uVar8;
                  piVar10[-2] = 0x3e16e4;
                  iVar6 = CBaseEdict::GetChangeAccessor((CBaseEdict *)piVar10[-1]);
                  *(undefined2 *)(iVar6 + 2) = 0;
                  uVar8 = local_3c;
                }
              }
              else {
                *(byte *)(local_38 + 0x70) = *(byte *)(local_38 + 0x70) | 1;
              }
              *(uint *)(local_38 + 0x148) = uVar8;
              iVar6 = local_38;
            }
            piVar10[-1] = iVar6;
            *piVar10 = 1;
            local_38 = iVar6;
            piVar10[-2] = 0x3e1709;
            DispatchSpawn((CBaseEntity *)piVar10[-1],SUB41(*piVar10,0));
            iVar7 = local_38;
            iVar6 = *(int *)this;
            piVar10[-1] = (int)this;
            *piVar10 = iVar7;
            pcVar2 = *(code **)(iVar6 + 0x468);
            piVar10[-2] = 0x3e171b;
            (*pcVar2)();
          }
        }
        piVar10 = piVar11;
        pbVar5 = pbVar14;
      } while (pbVar14 < local_34);
    }
  }
  iVar6 = *(int *)this;
  piVar11[1] = (int)this;
  *piVar11 = (int)&local_30;
  pcVar2 = *(code **)(iVar6 + 0x20);
  piVar11[-1] = 0x3e1597;
  (*pcVar2)();
  if (local_30 == (undefined1 *)0x0) {
    local_30 = &DAT_00d539c2;
  }
  piVar11[-1] = (int)local_30;
  piVar11[-2] = 0x3e15aa;
  CBaseEntity::PrecacheModel((char *)piVar11[-1]);
  iVar6 = *(int *)this;
  piVar11[-1] = (int)this;
  pcVar2 = *(code **)(iVar6 + 0x6c);
  piVar11[-2] = 0x3e15b2;
  (*pcVar2)();
  iVar6 = *(int *)this;
  *piVar11 = (int)local_30;
  piVar11[-1] = (int)this;
  pcVar2 = *(code **)(iVar6 + 0x70);
  piVar11[-2] = 0x3e15be;
  (*pcVar2)();
  puVar3 = *(undefined1 **)(this + 0x1a5c);
  piVar11[-1] = (int)this;
  puVar13 = &DAT_00d539c2;
  if (puVar3 != (undefined1 *)0x0) {
    puVar13 = puVar3;
  }
  *piVar11 = (int)puVar13;
  piVar11[-2] = 0x3e15d5;
  iVar6 = CBaseAnimating::LookupSequence((CBaseAnimating *)piVar11[-1],(char *)*piVar11);
  if (-1 < iVar6) {
    *piVar11 = iVar6;
    piVar11[-1] = (int)this;
    piVar11[-2] = 0x3e15e5;
    CBaseAnimating::ResetSequence((CBaseAnimating *)piVar11[-1],*piVar11);
  }
  if (local_20 != *(int *)(in_GS_OFFSET + 0x14)) {
                    /* WARNING: Subroutine does not return */
    piVar11[-2] = (int)&UNK_003e173b;
    __stack_chk_fail();
  }
  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)