UTIL_DecodeICE
0x00581cf0 · 250 bytes · __cdecl
_Z14UTIL_DecodeICEPhiPKh
Decompiled
undefined (3 params)
/* UTIL_DecodeICE(unsigned char*, int, unsigned char const*) */
void UTIL_DecodeICE(uchar *param_1,int param_2,uchar *param_3)
{
int iVar1;
undefined1 *puVar2;
int iVar3;
int iVar4;
IceKey *pIVar5;
int iVar6;
int in_GS_OFFSET;
int iStackY_50;
undefined1 auStack_40 [4];
uchar *local_3c;
undefined1 *local_38;
int local_34;
undefined1 *local_30;
IceKey local_2c [12];
int local_20;
pIVar5 = (IceKey *)&stack0xffffffb4;
local_3c = param_1;
local_20 = *(int *)(in_GS_OFFSET + 0x14);
if (param_3 != (uchar *)0x0) {
iStackY_50 = 0x581d2a;
IceKey::IceKey(local_2c,0);
/* try { // try from 00581d34 to 00581dc1 has its CatchHandler @ 00581de5 */
iStackY_50 = 0x581d39;
IceKey::set(local_2c,param_3);
iStackY_50 = 0x581d44;
iVar3 = IceKey::blockSize();
iVar1 = -((((iVar3 + -1 + param_2) / iVar3) * iVar3 + 0xfU & 0xfffffff0) + 0x10);
pIVar5 = local_2c + iVar1 + -0x20;
local_38 = auStack_40 + iVar1;
if (param_2 < iVar3) {
iVar4 = 0;
}
else {
local_34 = -iVar3;
local_30 = auStack_40 + iVar1;
iVar6 = param_2 - iVar3;
do {
iVar4 = iVar6;
puVar2 = local_30;
*(uchar **)(local_2c + iVar1 + -0x1c) = param_1;
*(undefined1 **)(&stack0xffffffbc + iVar1) = puVar2;
*(IceKey **)(local_2c + iVar1 + -0x20) = local_2c;
*(undefined4 *)((int)&iStackY_50 + iVar1) = 0x581d96;
IceKey::decrypt(*(IceKey **)(local_2c + iVar1 + -0x20),*(uchar **)(local_2c + iVar1 + -0x1c)
,*(uchar **)(&stack0xffffffbc + iVar1));
local_30 = local_30 + iVar3;
param_1 = param_1 + iVar3;
iVar6 = iVar4 + local_34;
} while (iVar3 <= iVar3 + iVar6);
iVar4 = param_2 - iVar4;
}
*(int *)(&stack0xffffffbc + iVar1) = iVar4;
*(undefined1 **)(local_2c + iVar1 + -0x1c) = local_38;
*(uchar **)(local_2c + iVar1 + -0x20) = local_3c;
*(undefined4 *)((int)&iStackY_50 + iVar1) = 0x581dc2;
_V_memcpy(*(void **)(local_2c + iVar1 + -0x20),*(void **)(local_2c + iVar1 + -0x1c),
*(int *)(&stack0xffffffbc + iVar1));
*(IceKey **)(local_2c + iVar1 + -0x20) = local_2c;
*(undefined4 *)((int)&iStackY_50 + iVar1) = 0x581dcd;
IceKey::~IceKey(*(IceKey **)(local_2c + iVar1 + -0x20));
}
if (local_20 == *(int *)(in_GS_OFFSET + 0x14)) {
return;
}
/* WARNING: Subroutine does not return */
*(undefined **)(pIVar5 + -4) = &UNK_00581dff;
__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.