FormatZipMessageZ
0x000eeff0 · 708 bytes · __cdecl
_Z17FormatZipMessageZjPcj
Decompiled
undefined (3 params)
/* FormatZipMessageZ(unsigned int, char*, unsigned int) */
int FormatZipMessageZ(uint param_1,char *param_2,uint param_3)
{
char *pcVar1;
uint *puVar2;
int iVar3;
int iVar4;
if (param_1 == 1) {
puVar2 = (uint *)___tls_get_addr();
param_1 = *puVar2;
}
if (param_1 == 0x20000) {
iVar3 = 0x2f;
pcVar1 = "Caller: can only get memory of a memory zipfile";
goto LAB_000ef060;
}
if (param_1 < 0x20001) {
if (param_1 == 0x400) {
iVar3 = 0x15;
pcVar1 = "Error writing to file";
goto LAB_000ef060;
}
if (param_1 < 0x401) {
if (param_1 == 0x100) {
iVar3 = 0x18;
pcVar1 = "Culdn\'t duplicate handle";
goto LAB_000ef060;
}
if (param_1 < 0x101) {
iVar3 = 7;
pcVar1 = "Success";
if (param_1 == 0) goto LAB_000ef060;
}
else {
iVar3 = 0x19;
pcVar1 = "Couldn\'t create/open file";
if ((param_1 == 0x200) || (pcVar1 = "Failed to allocate memory", param_1 == 0x300))
goto LAB_000ef060;
}
}
else {
if (param_1 == 0x700) {
iVar3 = 0x23;
pcVar1 = "Zipfile is corrupt or not a zipfile";
goto LAB_000ef060;
}
if (param_1 < 0x701) {
if (param_1 == 0x500) {
iVar3 = 0x1d;
pcVar1 = "File not found in the zipfile";
goto LAB_000ef060;
}
iVar3 = 0x18;
pcVar1 = "Still more data to unzip";
if (param_1 == 0x600) goto LAB_000ef060;
}
else {
if (param_1 == 0x800) {
iVar3 = 0x12;
pcVar1 = "Error reading file";
goto LAB_000ef060;
}
iVar3 = 0x18;
pcVar1 = "Caller: faulty arguments";
if (param_1 == 0x10000) goto LAB_000ef060;
}
}
}
else {
if (param_1 == 0x70000) {
iVar3 = 0x34;
pcVar1 = "Caller: the file had already been partially unzipped";
goto LAB_000ef060;
}
if (param_1 < 0x70001) {
if (param_1 == 0x40000) {
iVar3 = 0x22;
pcVar1 = "Caller: there was a previous error";
goto LAB_000ef060;
}
if (param_1 < 0x40001) {
iVar3 = 0x35;
pcVar1 = "Caller: not enough space allocated for memory zipfile";
if (param_1 == 0x30000) goto LAB_000ef060;
}
else {
if (param_1 == 0x50000) {
iVar3 = 0x34;
pcVar1 = "Caller: additions to the zip have already been ended";
goto LAB_000ef060;
}
iVar3 = 0x2e;
pcVar1 = "Zip-bug: the anticipated size turned out wrong";
if (param_1 == 0x60000) goto LAB_000ef060;
}
}
else {
if (param_1 == 0x2000000) {
iVar3 = 0x26;
pcVar1 = "Zip-bug: trying to seek the unseekable";
goto LAB_000ef060;
}
if (param_1 < 0x2000001) {
if (param_1 == 0x80000) {
iVar3 = 0x2a;
pcVar1 = "Caller: mixing creation and opening of zip";
goto LAB_000ef060;
}
iVar3 = 0x2e;
pcVar1 = "Zip-bug: internal initialisation not completed";
if (param_1 == 0x1000000) goto LAB_000ef060;
}
else {
if (param_1 == 0x4000000) {
iVar3 = 0x2e;
pcVar1 = "Zip-bug: tried to change mind, but not allowed";
goto LAB_000ef060;
}
iVar3 = 0x29;
pcVar1 = "Zip-bug: an internal error during flation";
if (param_1 == 0x5000000) goto LAB_000ef060;
}
}
}
iVar3 = 0x17;
pcVar1 = "unknown zip result code";
LAB_000ef060:
if ((param_2 != (char *)0x0) && (param_3 != 0)) {
iVar4 = param_3 - 1;
if (iVar3 + 1U <= param_3) {
iVar4 = iVar3;
}
V_strncpy(param_2,pcVar1,iVar4);
param_2[iVar4] = '\0';
}
return iVar3;
}
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.