L L4D2node

CRestore::ReadBasicField

0x004a9240 · 554 bytes · __thiscall

_ZN8CRestore14ReadBasicFieldERK25SaveRestoreRecordHeader_tPvP9datamap_tP17typedescription_t

Decompiled

undefined (5 params)

/* CRestore::ReadBasicField(SaveRestoreRecordHeader_t const&, void*, datamap_t*, typedescription_t*)
    */

void __thiscall
CRestore::ReadBasicField
          (CRestore *this,SaveRestoreRecordHeader_t *param_1,void *param_2,datamap_t *param_3,
          typedescription_t *param_4)

{
  ushort uVar1;
  code *pcVar2;
  int iVar3;
  uint uVar4;
  void *local_28;
  int local_24;
  typedescription_t *local_20;
  
  switch(*(undefined4 *)param_4) {
  default:
    Warning("Bad field type\n");
    break;
  case 1:
    (**(code **)(*(int *)this + 0x44))
              (this,param_2,*(undefined2 *)(param_4 + 0xc),*(undefined2 *)param_1);
    break;
  case 2:
    (**(code **)(*(int *)this + 0x50))
              (this,param_2,*(undefined2 *)(param_4 + 0xc),*(undefined2 *)param_1);
    break;
  case 3:
    (**(code **)(*(int *)this + 0x58))
              (this,param_2,*(undefined2 *)(param_4 + 0xc),*(undefined2 *)param_1);
    break;
  case 4:
    (**(code **)(*(int *)this + 0x60))
              (this,param_2,*(undefined2 *)(param_4 + 0xc),*(undefined2 *)param_1);
    break;
  case 5:
  case 9:
    (**(code **)(*(int *)this + 0x38))
              (this,param_2,*(undefined2 *)(param_4 + 0xc),*(undefined2 *)param_1);
    return;
  case 6:
    (**(code **)(*(int *)this + 0x40))
              (this,param_2,*(undefined2 *)(param_4 + 0xc),*(undefined2 *)param_1);
    break;
  case 7:
    (**(code **)(*(int *)this + 0x34))
              (this,param_2,*(undefined2 *)(param_4 + 0xc),*(undefined2 *)param_1);
    break;
  case 8:
    (**(code **)(*(int *)this + 0x48))
              (this,param_2,*(undefined2 *)(param_4 + 0xc),*(undefined2 *)param_1);
    break;
  case 10:
    if ((((byte)param_4[0xe] & 0x40) == 0) || (param_2 = *(void **)param_2, param_2 != (void *)0x0))
    {
      uVar4 = (uint)*(ushort *)(param_4 + 0xc);
      while (uVar4 = uVar4 - 1, uVar4 != 0xffffffff) {
        (**(code **)(*(int *)this + 8))(this,param_2,*(undefined4 *)(param_4 + 0x20));
        param_2 = (void *)((int)param_2 + *(int *)(param_4 + 0x24));
      }
    }
    else {
      pcVar2 = (code *)(*(undefined4 **)this)[1];
      iVar3 = (*(code *)**(undefined4 **)this)(this);
      (*pcVar2)(this,iVar3 + (uint)*(ushort *)param_1);
      Warning("Attempted to restore FIELD_EMBEDDEDBYREF %s but there is no destination memory\n",
              *(undefined4 *)(param_4 + 4));
    }
    break;
  case 0xb:
    iVar3 = (*(code *)**(undefined4 **)this)(this);
    local_20 = param_4;
    uVar1 = *(ushort *)param_1;
    local_28 = param_2;
    local_24 = (int)param_2 - *(int *)(param_4 + 8);
    (**(code **)(**(int **)(param_4 + 0x14) + 4))(*(int **)(param_4 + 0x14),&local_28,this);
    (**(code **)(*(int *)this + 4))(this,iVar3 + (uint)uVar1);
    break;
  case 0x1d:
    break;
  }
  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)