L L4D2node

CWorkshop::AddItemFile

0x0023d850 · 155 bytes · __thiscall

_ZN9CWorkshop11AddItemFileERK19PublishedFileInfo_t

Decompiled

undefined (2 params)

/* CWorkshop::AddItemFile(PublishedFileInfo_t const&) */

undefined4 __thiscall CWorkshop::AddItemFile(CWorkshop *this,PublishedFileInfo_t *param_1)

{
  int iVar1;
  int *piVar2;
  int iVar3;
  undefined4 uVar4;
  
  iVar1 = *(int *)(this + 0x108);
  if (0 < iVar1) {
    piVar2 = *(int **)(this + 0xfc);
    if (piVar2[1] != *(int *)(param_1 + 4) || *piVar2 != *(int *)param_1) {
      iVar3 = 0;
      do {
        iVar3 = iVar3 + 1;
        if (iVar3 == iVar1) goto LAB_0023d8a7;
      } while (piVar2[iVar3 * 2 + 1] != *(int *)(param_1 + 4) ||
               piVar2[iVar3 * 2] != *(int *)param_1);
      if (iVar3 == -1) goto LAB_0023d8a7;
    }
    return 1;
  }
LAB_0023d8a7:
  CUtlVector<unsigned_long_long,CUtlMemory<unsigned_long_long,int>>::InsertBefore
            ((CUtlVector<unsigned_long_long,CUtlMemory<unsigned_long_long,int>> *)(this + 0xfc),
             iVar1,(ulonglong *)param_1);
  uVar4 = CreateItemFileRequest(this,param_1);
  return uVar4;
}

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)