IceKey::decrypt
0x00bbafe0 · 172 bytes · __thiscall
_ZNK6IceKey7decryptEPKhPh
Decompiled
undefined (3 params)
/* IceKey::decrypt(unsigned char const*, unsigned char*) const */
void __thiscall IceKey::decrypt(IceKey *this,uchar *param_1,uchar *param_2)
{
IceSubkey *pIVar1;
uint uVar2;
int iVar3;
uint uVar4;
uint uVar5;
IceSubkey *pIVar6;
uVar4 = (uint)*param_1 << 0x18 | (uint)param_1[1] << 0x10 | (uint)param_1[3] |
(uint)param_1[2] << 8;
uVar5 = (uint)param_1[4] << 0x18 | (uint)param_1[5] << 0x10 | (uint)param_1[7] |
(uint)param_1[6] << 8;
iVar3 = *(int *)(this + 4) + -1;
if (0 < iVar3) {
pIVar6 = (IceSubkey *)(*(int *)(this + 8) + iVar3 * 0xc);
do {
uVar2 = ice_f(uVar5,pIVar6);
pIVar1 = pIVar6 + -0xc;
pIVar6 = pIVar6 + -0x18;
uVar4 = uVar4 ^ uVar2;
uVar2 = ice_f(uVar4,pIVar1);
uVar5 = uVar5 ^ uVar2;
iVar3 = iVar3 + -2;
} while (0 < iVar3);
}
iVar3 = 4;
do {
param_2[iVar3 + -1] = (uchar)uVar5;
uVar5 = uVar5 >> 8;
param_2[iVar3 + 3] = (uchar)uVar4;
uVar4 = uVar4 >> 8;
iVar3 = iVar3 + -1;
} while (iVar3 != 0);
return;
}
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.