CLZSS::Uncompress
0x002548e0 · 239 bytes · __thiscall
_ZN5CLZSS10UncompressEPhS0_
Decompiled
undefined (3 params)
/* CLZSS::Uncompress(unsigned char*, unsigned char*) */
int __thiscall CLZSS::Uncompress(CLZSS *this,uchar *param_1,uchar *param_2)
{
byte bVar1;
byte bVar2;
uint uVar3;
int iVar4;
int iVar5;
byte *pbVar6;
byte *pbVar7;
byte *pbVar8;
uint uVar9;
int local_24;
int local_1c;
uint local_18;
local_24 = 0;
if (((param_1 != (uchar *)0x0) && (*(int *)param_1 == 0x53535a4c)) &&
(local_24 = *(int *)(param_1 + 4), local_24 != 0)) {
pbVar7 = param_1 + 8;
uVar9 = 0;
local_18 = 0;
local_1c = 0;
do {
pbVar8 = pbVar7;
if (uVar9 == 0) {
local_18 = (uint)*pbVar7;
pbVar8 = pbVar7 + 1;
}
uVar9 = uVar9 + 1 & 7;
if ((local_18 & 1) == 0) {
pbVar6 = param_2 + 1;
pbVar7 = pbVar8 + 1;
local_1c = local_1c + 1;
*param_2 = *pbVar8;
}
else {
bVar1 = pbVar8[1];
pbVar7 = pbVar8 + 2;
bVar2 = *pbVar8;
uVar3 = bVar1 & 0xf;
iVar5 = uVar3 + 1;
if (iVar5 == 1) {
iVar5 = 0;
if (local_1c == local_24) {
iVar5 = local_24;
}
return iVar5;
}
iVar4 = 0;
do {
param_2[iVar4] = param_2[iVar4 + ~((int)(uint)bVar1 >> 4 | (uint)bVar2 << 4)];
iVar4 = iVar4 + 1;
} while (iVar4 < iVar5);
local_1c = local_1c + iVar5;
pbVar6 = param_2 + uVar3 + 1;
}
local_18 = (int)local_18 >> 1;
param_2 = pbVar6;
} while( true );
}
return local_24;
}
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.