ReadWaveFile
0x000efb80 · 373 bytes · __cdecl
_Z12ReadWaveFilePKcRPcRiS3_S3_S3_
Decompiled
undefined (6 params)
/* ReadWaveFile(char const*, char*&, int&, int&, int&, int&) */
undefined4
ReadWaveFile(char *param_1,char **param_2,int *param_3,int *param_4,int *param_5,int *param_6)
{
FILE *__stream;
char *__ptr;
undefined4 local_30;
uint local_20 [4];
__stream = (FILE *)__wrap_fopen(param_1,&DAT_002a3e98);
local_30 = 0;
if (__stream != (FILE *)0x0) {
local_30 = 0;
fseek(__stream,0x16,0);
fread(local_20,2,1,__stream);
*param_5 = local_20[0] & 0xffff;
fread(local_20,4,1,__stream);
*param_6 = local_20[0];
fseek(__stream,0x22,0);
fread(local_20,2,1,__stream);
*param_4 = local_20[0] & 0xffff;
fseek(__stream,0x28,0);
fread(local_20,4,1,__stream);
*param_3 = local_20[0];
fread(local_20,4,1,__stream);
__ptr = operator_new__(*param_3);
*param_2 = __ptr;
if (__ptr == (char *)0x0) {
fclose(__stream);
}
else {
fread(__ptr,*param_3,1,__stream);
fclose(__stream);
local_30 = 1;
}
}
return local_30;
}
SourceMod gamedata
paste intoaddons/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.
Signatures + Functions block. The plugin uses
DHookCreateFromConf - DHooks reads return type, this-type,
calling convention, and argument types straight from the gamedata. Less
boilerplate in the plugin, types travel with the gamedata.
Gamedata KeyValues
DHooks plugin example
Type inference is best-effort from the C signature - sanity-check the DHooks types before shipping.