L L4D2node

WriteWaveFile

0x000efd00 · 654 bytes · __cdecl

_Z13WriteWaveFilePKcS0_iiii

Decompiled

undefined (6 params)

/* WriteWaveFile(char const*, char const*, int, int, int, int) */

undefined4
WriteWaveFile(char *param_1,char *param_2,int param_3,int param_4,int param_5,int param_6)

{
  FILE *__s;
  undefined4 uVar1;
  long lVar2;
  int iVar3;
  undefined2 local_3c;
  short local_3a;
  short local_38;
  undefined2 local_36;
  undefined4 local_34;
  undefined4 local_30;
  int local_2c;
  int local_28;
  int local_24;
  int local_20 [4];
  
  __s = (FILE *)__wrap_fopen(param_1,&DAT_002a5c80);
  uVar1 = 0;
  if (__s != (FILE *)0x0) {
    fwrite(&DAT_002a5c83,4,1,__s);
    local_34 = 0;
    fwrite(&local_34,4,1,__s);
    fwrite(&DAT_002a5c88,4,1,__s);
    fwrite(&DAT_002a5c8d,4,1,__s);
    local_30 = 0x10;
    fwrite(&local_30,4,1,__s);
    local_3c = 1;
    fwrite(&local_3c,2,1,__s);
    local_3a = (short)param_5;
    fwrite(&local_3a,2,1,__s);
    local_2c = param_6;
    fwrite(&local_2c,4,1,__s);
    iVar3 = param_4 + 7;
    if (-1 < param_4) {
      iVar3 = param_4;
    }
    local_28 = param_5 * (iVar3 >> 3) * param_6;
    fwrite(&local_28,4,1,__s);
    local_38 = (short)(iVar3 >> 3) * (short)param_5;
    fwrite(&local_38,2,1,__s);
    local_36 = (undefined2)param_4;
    fwrite(&local_36,2,1,__s);
    fwrite("data",4,1,__s);
    local_24 = param_3;
    fwrite(&local_24,4,1,__s);
    fwrite(param_2,param_3,1,__s);
    lVar2 = ftell(__s);
    fseek(__s,4,0);
    local_20[0] = lVar2 + -8;
    fwrite(local_20,4,1,__s);
    fclose(__s);
    uVar1 = 1;
  }
  return uVar1;
}

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)