L L4D2node

GetFileFromRemoteStorage

0x00179a40 · 274 bytes · __cdecl

_Z24GetFileFromRemoteStorageP19ISteamRemoteStoragePKcS2_

Decompiled

undefined (3 params)

/* GetFileFromRemoteStorage(ISteamRemoteStorage*, char const*, char const*) */

undefined4 GetFileFromRemoteStorage(ISteamRemoteStorage *param_1,char *param_2,char *param_3)

{
  size_t __size;
  size_t sVar1;
  int iVar2;
  undefined4 uVar3;
  void *local_28;
  size_t local_24;
  undefined4 local_20;
  
  __size = (**(code **)(*(int *)param_1 + 0x3c))(param_1,param_2);
  if ((int)__size < 1) {
    return 0;
  }
  local_20 = 0;
  local_24 = __size;
  local_28 = malloc(__size);
                    /* try { // try from 00179a8b to 00179b5b has its CatchHandler @ 00179b61 */
  sVar1 = (**(code **)(*(int *)param_1 + 4))(param_1,param_2,local_28,__size);
  if (__size == sVar1) {
    iVar2 = (**(code **)(*(int *)(g_pFileSystem + 4) + 8))
                      (g_pFileSystem + 4,param_3,&DAT_002a5c80,&DAT_002a0772);
    if (iVar2 != 0) {
      sVar1 = (**(code **)(*(int *)(g_pFileSystem + 4) + 4))
                        (g_pFileSystem + 4,local_28,__size,iVar2);
      (**(code **)(*(int *)(g_pFileSystem + 4) + 0xc))(g_pFileSystem + 4,iVar2);
      if (__size == sVar1) {
        DevMsg("[Cloud]: SUCCEESS retrieved %s from remote storage into %s\n",param_2,param_3);
        uVar3 = 1;
        goto LAB_00179a94;
      }
      DevMsg("[Cloud]: FAILED retrieved %s from remote storage into %s\n",param_2,param_3);
    }
  }
  uVar3 = 0;
LAB_00179a94:
  CUtlMemory<char,int>::Purge((CUtlMemory<char,int> *)&local_28);
  return uVar3;
}

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)