L L4D2node

CEntityDataInstantiator<ModelScale>::CreateDataObject

0x004800c0 · 468 bytes · __thiscall

_ZN23CEntityDataInstantiatorI10ModelScaleE16CreateDataObjectEPK11CBaseEntity

Decompiled

undefined (2 params)

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

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

{
  undefined4 *puVar1;
  char cVar2;
  uint uVar3;
  void *pvVar4;
  int iVar5;
  int *piVar6;
  int iVar7;
  CUtlVector<CEntityDataInstantiator<ModelScale>::HashEntry,CUtlMemory<CEntityDataInstantiator<ModelScale>::HashEntry,int>>
  *this_00;
  uint uVar8;
  int iVar9;
  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<ModelScale>)0x0) {
    local_34 = local_34 % *(uint *)(this + 0x10);
  }
  else {
    local_34 = local_34 & *(uint *)(this + 0x24);
  }
  uVar8 = 0;
  piVar6 = (int *)(*(int *)(this + 4) + local_34 * 0x14);
  uVar3 = piVar6[3];
  if ((int)uVar3 < 1) {
LAB_0048012e:
    if ((uVar3 != uVar8) && (uVar3 = local_34 << 0x10 | uVar8, uVar3 != 0xffffffff)) {
      iVar7 = (uVar8 & 0xffff) * 8;
      iVar9 = (uVar3 >> 0x10) * 0x14;
      goto LAB_00480155;
    }
  }
  else {
    do {
      cVar2 = (**(code **)(this + 0x18))(*piVar6 + uVar8 * 8,&local_24);
      if (cVar2 != '\0') goto LAB_0048012e;
      uVar8 = uVar8 + 1;
    } while (uVar8 != uVar3);
  }
  local_34 = (**(code **)(this + 0x1c))(&local_24);
  if (this[0x20] == (CEntityDataInstantiator<ModelScale>)0x0) {
    local_34 = local_34 % *(uint *)(this + 0x10);
  }
  else {
    local_34 = local_34 & *(uint *)(this + 0x24);
  }
  uVar8 = 0;
  iVar5 = *(int *)(this + 4);
  piVar6 = (int *)(local_34 * 0x14 + iVar5);
  uVar3 = piVar6[3];
  if ((int)uVar3 < 1) {
LAB_004801e8:
    if (uVar3 == uVar8) goto LAB_00480256;
    uVar8 = local_34 << 0x10 | uVar8;
  }
  else {
    do {
      cVar2 = (**(code **)(this + 0x18))(*piVar6 + uVar8 * 8,&local_24);
      if (cVar2 != '\0') {
        iVar5 = *(int *)(this + 4);
        goto LAB_004801e8;
      }
      uVar8 = uVar8 + 1;
    } while (uVar8 != uVar3);
    iVar5 = *(int *)(this + 4);
LAB_00480256:
    this_00 = (CUtlVector<CEntityDataInstantiator<ModelScale>::HashEntry,CUtlMemory<CEntityDataInstantiator<ModelScale>::HashEntry,int>>
               *)(local_34 * 0x14 + iVar5);
    uVar8 = *(uint *)(this_00 + 0xc);
    CUtlVector<CEntityDataInstantiator<ModelScale>::HashEntry,CUtlMemory<CEntityDataInstantiator<ModelScale>::HashEntry,int>>
    ::GrowVector(this_00,1);
    CUtlVector<CEntityDataInstantiator<ModelScale>::HashEntry,CUtlMemory<CEntityDataInstantiator<ModelScale>::HashEntry,int>>
    ::ShiftElementsRight(this_00,uVar8,1);
    puVar1 = (undefined4 *)(*(int *)this_00 + uVar8 * 8);
    if (puVar1 != (undefined4 *)0x0) {
      *puVar1 = local_24;
      puVar1[1] = local_20;
    }
    iVar5 = *(int *)(this + 4);
    uVar8 = local_34 << 0x10 | uVar8;
  }
  iVar7 = (uVar8 & 0xffff) * 8;
  iVar9 = (uVar8 >> 0x10) * 0x14;
  iVar5 = *(int *)(iVar5 + iVar9);
  pvVar4 = ::operator_new(0x10);
  *(void **)(iVar5 + iVar7 + 4) = pvVar4;
  _V_memset(*(void **)(*(int *)(*(int *)(this + 4) + iVar9) + 4 + iVar7),0,0x10);
LAB_00480155:
  return *(undefined4 *)(*(int *)(*(int *)(this + 4) + iVar9) + 4 + iVar7);
}

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)