L L4D2node

CRestore::EmptyFields

0x004a6470 · 326 bytes · __thiscall

_ZN8CRestore11EmptyFieldsEPvP17typedescription_ti

Decompiled

undefined (4 params)

/* CRestore::EmptyFields(void*, typedescription_t*, int) */

void __thiscall
CRestore::EmptyFields(CRestore *this,void *param_1,typedescription_t *param_2,int param_3)

{
  ushort uVar1;
  int iVar2;
  size_t __n;
  int __c;
  int *__s;
  int local_34;
  int *local_28;
  void *local_24;
  typedescription_t *local_20;
  
  local_34 = 0;
  if (param_3 < 1) {
    return;
  }
  do {
    while ((uVar1 = *(ushort *)(param_2 + 0xe), (uVar1 & 2) == 0 ||
           ((*(int *)(this + 0x20) != 0 && ((uVar1 & 1) != 0))))) {
LAB_004a64c0:
      local_34 = local_34 + 1;
      param_2 = param_2 + 0x40;
      if (local_34 == param_3) {
        return;
      }
    }
    iVar2 = *(int *)param_2;
    __s = (int *)((int)param_1 + *(int *)(param_2 + 8));
    if (iVar2 != 10) {
      if (iVar2 == 0xb) {
        local_24 = param_1;
        local_28 = __s;
        local_20 = param_2;
        (**(code **)(**(int **)(param_2 + 0x14) + 0xc))(*(int **)(param_2 + 0x14),&local_28);
      }
      else {
        __n = (uint)*(ushort *)(param_2 + 0xc) * *(int *)(gSizes + iVar2 * 4);
        if (*(size_t *)(param_2 + 0x24) != __n) {
          Warning("WARNING! Field %s is using the wrong FIELD_ type!\nFix this or you\'ll see a crash.\n"
                  ,*(int *)(param_2 + 4));
          iVar2 = *(int *)param_2;
          __n = (uint)*(ushort *)(param_2 + 0xc) * *(int *)(gSizes + iVar2 * 4);
        }
        __c = 0;
        if (iVar2 == 0xd) {
          __c = 0xff;
        }
        memset(__s,__c,__n);
      }
      goto LAB_004a64c0;
    }
    if ((((uVar1 & 0x40) != 0) && (__s = (int *)*__s, __s == (int *)0x0)) ||
       (iVar2 = *(ushort *)(param_2 + 0xc) - 1, iVar2 == -1)) goto LAB_004a64c0;
    do {
      iVar2 = iVar2 + -1;
      (**(code **)(*(int *)this + 0x10))
                (this,__s,**(undefined4 **)(param_2 + 0x20),(*(undefined4 **)(param_2 + 0x20))[1]);
      __s = (int *)((int)__s + *(int *)(param_2 + 0x24));
    } while (iVar2 != -1);
    local_34 = local_34 + 1;
    param_2 = param_2 + 0x40;
    if (local_34 == param_3) {
      return;
    }
  } while( true );
}

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)