L L4D2node

Script_StringToFile

0x00b43220 · 260 bytes · __cdecl

_ZL19Script_StringToFilePKcS0_

Decompiled

undefined (2 params)

/* Script_StringToFile(char const*, char const*) */

bool Script_StringToFile(char *param_1,char *param_2)

{
  code *pcVar1;
  bool bVar2;
  int iVar3;
  int iVar4;
  int in_GS_OFFSET;
  char local_124 [260];
  int local_20;
  
  local_20 = *(int *)(in_GS_OFFSET + 0x14);
  bVar2 = CreateAndValidateFileLocation<260u>(local_124,param_1);
  if (bVar2) {
    iVar3 = (**(code **)(*(int *)(g_pFullFileSystem + 4) + 8))
                      (g_pFullFileSystem + 4,local_124,&DAT_00bf9593,"DEFAULT_WRITE_PATH");
    if (iVar3 - 1U < 0xfffffffe) {
      pcVar1 = *(code **)(*(int *)(g_pFullFileSystem + 4) + 4);
      iVar4 = _V_strlen(param_2);
      (*pcVar1)(g_pFullFileSystem + 4,param_2,iVar4 + 1,iVar3);
      (**(code **)(*(int *)(g_pFullFileSystem + 4) + 0xc))(g_pFullFileSystem + 4,iVar3);
    }
    else {
      bVar2 = false;
      Warning("Couldn\'t open %s (as %x) to write out the table\n",local_124,param_1);
    }
  }
  if (local_20 == *(int *)(in_GS_OFFSET + 0x14)) {
    return bVar2;
  }
                    /* WARNING: Subroutine does not return */
  __stack_chk_fail();
}

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)