DecompressBZipToDisk
0x0013c360 · 751 bytes · __regparm3
_ZL20DecompressBZipToDiskPKcS0_Pci
Decompiled
undefined (4 params)
/* DecompressBZipToDisk(char const*, char const*, char*, int) */
bool __regparm3 DecompressBZipToDisk(char *param_1,char *param_2,char *param_3,int param_4)
{
int iVar1;
char cVar2;
int iVar3;
int iVar4;
undefined4 uVar5;
int iVar6;
int in_GS_OFFSET;
bool bStack_10235;
char acStack_10228 [260];
char acStack_10124 [260];
undefined1 auStack_10020 [65552];
iVar1 = *(int *)(in_GS_OFFSET + 0x14);
V_strncpy(acStack_10228,param_1,0x104);
V_RemoveDotSlashes(acStack_10228,'/');
cVar2 = (**(code **)(g_pFileSystem[1] + 0x28))(g_pFileSystem + 1,acStack_10228,0);
if ((cVar2 != '\0') ||
(bStack_10235 = param_3 == (char *)0x0 || param_4 < 1, param_3 == (char *)0x0 || param_4 < 1))
{
LAB_0013c3e2:
bStack_10235 = false;
}
else {
COM_CreatePath(acStack_10228);
V_MakeAbsolutePath(acStack_10124,0x104,param_2,com_gamedir);
cVar2 = (**(code **)(g_pFileSystem[1] + 0x28))(g_pFileSystem + 1,acStack_10124,0);
if (cVar2 == '\0') {
iVar3 = (**(code **)(g_pFileSystem[1] + 8))(g_pFileSystem + 1,acStack_10124,&DAT_002a5c80,0);
if (iVar3 == 0) goto LAB_0013c3e2;
iVar4 = (**(code **)(g_pFileSystem[1] + 4))(g_pFileSystem + 1,param_3,param_4,iVar3);
(**(code **)(g_pFileSystem[1] + 0xc))(g_pFileSystem + 1,iVar3);
if (param_4 == iVar4) goto LAB_0013c500;
}
else {
LAB_0013c500:
iVar3 = (**(code **)(g_pFileSystem[1] + 8))(g_pFileSystem + 1,acStack_10228,&DAT_002a5c80,0);
if (iVar3 != 0) {
uVar5 = BZ2_bzopen(acStack_10124,&DAT_002a3e98);
do {
iVar4 = BZ2_bzread(uVar5,auStack_10020,0x10000);
if (iVar4 < 0) break;
if (iVar4 == 0) {
(**(code **)(g_pFileSystem[1] + 0xc))(g_pFileSystem + 1,iVar3);
BZ2_bzclose(uVar5);
(**(code **)(*g_pFileSystem + 0x40))(g_pFileSystem,param_2,0);
bStack_10235 = true;
goto LAB_0013c3e9;
}
iVar6 = (**(code **)(g_pFileSystem[1] + 4))(g_pFileSystem + 1,auStack_10020,iVar4,iVar3);
} while (iVar4 == iVar6);
(**(code **)(g_pFileSystem[1] + 0xc))(g_pFileSystem + 1,iVar3);
BZ2_bzclose(uVar5);
(**(code **)(*g_pFileSystem + 0x40))(g_pFileSystem,param_2,0);
(**(code **)(*g_pFileSystem + 0x40))(g_pFileSystem,acStack_10228,0);
goto LAB_0013c3e9;
}
}
(**(code **)(*g_pFileSystem + 0x40))(g_pFileSystem,param_2,0);
}
LAB_0013c3e9:
if (iVar1 == *(int *)(in_GS_OFFSET + 0x14)) {
return bStack_10235;
}
/* WARNING: Subroutine does not return */
__stack_chk_fail();
}
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.