L L4D2node

CEntityDataInstantiator<StepSimulationData>::CreateDataObject

0x0047fc40 · 448 bytes · __thiscall

_ZN23CEntityDataInstantiatorI18StepSimulationDataE16CreateDataObjectEPK11CBaseEntity

Decompiled

undefined (2 params)

/* CEntityDataInstantiator<StepSimulationData>::CreateDataObject(CBaseEntity const*) */

undefined4 __thiscall
CEntityDataInstantiator<StepSimulationData>::CreateDataObject
          (CEntityDataInstantiator<StepSimulationData> *this,CBaseEntity *param_1)

{
  undefined4 *puVar1;
  char cVar2;
  uint uVar3;
  void *pvVar4;
  int *piVar5;
  int iVar6;
  CUtlVector<CEntityDataInstantiator<StepSimulationData>::HashEntry,CUtlMemory<CEntityDataInstantiator<StepSimulationData>::HashEntry,int>>
  *this_00;
  uint uVar7;
  int iVar8;
  uint local_34;
  CBaseEntity *local_24;
  undefined4 local_20;
  
  local_20 = 0;
  local_24 = param_1;
  local_34 = (**(code **)(this + 0x1c))(&local_24);
  if (this[0x20] == (CEntityDataInstantiator<StepSimulationData>)0x0) {
    local_34 = local_34 % *(uint *)(this + 0x10);
  }
  else {
    local_34 = local_34 & *(uint *)(this + 0x24);
  }
  uVar7 = 0;
  piVar5 = (int *)(*(int *)(this + 4) + local_34 * 0x14);
  uVar3 = piVar5[3];
  if ((int)uVar3 < 1) {
LAB_0047fcae:
    if ((uVar3 != uVar7) && (uVar3 = local_34 << 0x10 | uVar7, uVar3 != 0xffffffff)) {
      iVar6 = (uVar7 & 0xffff) * 8;
      iVar8 = (uVar3 >> 0x10) * 0x14;
      goto LAB_0047fcd5;
    }
  }
  else {
    do {
      cVar2 = (**(code **)(this + 0x18))(*piVar5 + uVar7 * 8,&local_24);
      if (cVar2 != '\0') goto LAB_0047fcae;
      uVar7 = uVar7 + 1;
    } while (uVar7 != uVar3);
  }
  local_34 = (**(code **)(this + 0x1c))(&local_24);
  if (this[0x20] == (CEntityDataInstantiator<StepSimulationData>)0x0) {
    local_34 = local_34 % *(uint *)(this + 0x10);
  }
  else {
    local_34 = local_34 & *(uint *)(this + 0x24);
  }
  uVar7 = 0;
  piVar5 = (int *)(*(int *)(this + 4) + local_34 * 0x14);
  uVar3 = piVar5[3];
  if ((int)uVar3 < 1) {
LAB_0047fd65:
    if (uVar3 == uVar7) goto LAB_0047fdcc;
  }
  else {
    do {
      cVar2 = (**(code **)(this + 0x18))(*piVar5 + uVar7 * 8,&local_24);
      if (cVar2 != '\0') goto LAB_0047fd65;
      uVar7 = uVar7 + 1;
    } while (uVar7 != uVar3);
LAB_0047fdcc:
    this_00 = (CUtlVector<CEntityDataInstantiator<StepSimulationData>::HashEntry,CUtlMemory<CEntityDataInstantiator<StepSimulationData>::HashEntry,int>>
               *)(local_34 * 0x14 + *(int *)(this + 4));
    uVar7 = *(uint *)(this_00 + 0xc);
    CUtlVector<CEntityDataInstantiator<StepSimulationData>::HashEntry,CUtlMemory<CEntityDataInstantiator<StepSimulationData>::HashEntry,int>>
    ::GrowVector(this_00,1);
    CUtlVector<CEntityDataInstantiator<StepSimulationData>::HashEntry,CUtlMemory<CEntityDataInstantiator<StepSimulationData>::HashEntry,int>>
    ::ShiftElementsRight(this_00,uVar7,1);
    puVar1 = (undefined4 *)(*(int *)this_00 + uVar7 * 8);
    if (puVar1 != (undefined4 *)0x0) {
      *puVar1 = local_24;
      puVar1[1] = local_20;
    }
  }
  pvVar4 = ::operator_new(0xac);
  iVar6 = (uVar7 & 0xffff) * 8;
  iVar8 = ((local_34 << 0x10 | uVar7) >> 0x10) * 0x14;
  *(void **)(*(int *)(*(int *)(this + 4) + iVar8) + 4 + iVar6) = pvVar4;
  _V_memset(*(void **)(*(int *)(*(int *)(this + 4) + iVar8) + 4 + iVar6),0,0xac);
LAB_0047fcd5:
  return *(undefined4 *)(*(int *)(*(int *)(this + 4) + iVar8) + 4 + iVar6);
}

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)