L L4D2node

CPropDoorRotatingBreakable::Spawn

0x007fcc30 · 677 bytes · __thiscall

_ZN26CPropDoorRotatingBreakable5SpawnEv

Decompiled

undefined (1 param)

/* CPropDoorRotatingBreakable::Spawn() */

void __thiscall CPropDoorRotatingBreakable::Spawn(CPropDoorRotatingBreakable *this)

{
  code *pcVar1;
  char cVar2;
  KeyValues *this_00;
  undefined4 uVar3;
  char *pcVar4;
  char *pcVar5;
  KeyValues *this_01;
  int iVar6;
  int iVar7;
  int in_GS_OFFSET;
  uint in_stack_ffffff58;
  undefined4 uVar8;
  KeyValues *local_94;
  string_t local_80 [4];
  undefined **local_7c;
  undefined1 local_78;
  char local_77 [83];
  undefined4 local_24;
  int local_20;
  
  local_20 = *(int *)(in_GS_OFFSET + 0x14);
  this[0x17d1] = (CPropDoorRotatingBreakable)0x1;
  CPropDoorRotating::Spawn((CPropDoorRotating *)this);
  PrecacheBreakables(this);
  *(undefined4 *)(this + 0x17e4) = 0;
  *(undefined4 *)(this + 0x17d4) = 0xffffffff;
  this_00 = KeyValues::operator_new((KeyValues *)0x2c,in_stack_ffffff58);
                    /* try { // try from 007fcc9e to 007fcca2 has its CatchHandler @ 007fcedd */
  KeyValues::KeyValues(this_00,"",(IKeyValuesSystem *)0x0,false);
  pcVar1 = *(code **)(*modelinfo + 0x54);
  uVar3 = CBaseEntity::GetModel((CBaseEntity *)this);
  pcVar4 = (char *)(*pcVar1)(modelinfo,uVar3);
  pcVar1 = *(code **)(*modelinfo + 0x10);
  uVar3 = CBaseEntity::GetModel((CBaseEntity *)this);
  pcVar5 = (char *)(*pcVar1)(modelinfo,uVar3);
  uVar8 = 0;
  uVar3 = 0;
  cVar2 = KeyValues::LoadFromBuffer(this_00,pcVar5,pcVar4,(IBaseFileSystem *)0x0,(char *)0x0);
  if ((cVar2 != '\0') &&
     (this_01 = (KeyValues *)KeyValues::FindKey(this_00,"door_options",false),
     this_01 != (KeyValues *)0x0)) {
    local_7c = &PTR_InitQuietTruncation_00cc5b10;
    local_78 = 1;
    local_77[0] = '\0';
    local_24 = 0;
    pcVar4 = (char *)CFmtStrN<80>::sprintf
                               ((CFmtStrN<80> *)&local_7c,"skin%d",*(undefined4 *)(this + 0x458));
    local_94 = (KeyValues *)KeyValues::FindKey(this_01,pcVar4,false);
    if ((local_94 != (KeyValues *)0x0) ||
       (local_94 = (KeyValues *)KeyValues::FindKey(this_01,"defaults",false),
       local_94 != (KeyValues *)0x0)) {
      iVar6 = 1;
      while( true ) {
        pcVar4 = (char *)CFmtStrN<80>::sprintf
                                   ((CFmtStrN<80> *)&local_7c,"damage%d",iVar6,uVar3,uVar8,this_00);
        iVar7 = KeyValues::GetString(local_94,pcVar4,(char *)0x0);
        if (iVar7 == 0) break;
        CFmtStrN<80>::sprintf((CFmtStrN<80> *)&local_7c,"models/%s.mdl",iVar7);
        V_FixSlashes(local_77,'/');
        CBaseEntity::PrecacheModel(local_77);
        AllocPooledString((char *)local_80);
        CUtlVector<string_t,CUtlMemory<string_t,int>>::InsertBefore
                  ((CUtlVector<string_t,CUtlMemory<string_t,int>> *)(this + 0x17d8),
                   *(int *)(this + 0x17e4),local_80);
        iVar6 = iVar6 + 1;
      }
    }
  }
  KeyValues::deleteThis();
  *(undefined4 *)(this + 0x17cc) = 0;
  this[0x17d0] = (CPropDoorRotatingBreakable)(((byte)(*(uint *)(this + 0x148) >> 0x13) ^ 1) & 1);
  if (*(int *)(this + 0x15f4) == 0) {
    (**(code **)(*(int *)this + 0x478))(this);
    this_00 = (KeyValues *)this;
  }
  if (local_20 != *(int *)(in_GS_OFFSET + 0x14)) {
                    /* WARNING: Subroutine does not return */
    __stack_chk_fail(this_00);
  }
  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)