L L4D2node

IceKey::encrypt

0x00270ae0 · 181 bytes · __thiscall

_ZNK6IceKey7encryptEPKhPh

Decompiled

undefined (3 params)

/* IceKey::encrypt(unsigned char const*, unsigned char*) const */

void __thiscall IceKey::encrypt(IceKey *this,uchar *param_1,uchar *param_2)

{
  IceSubkey *pIVar1;
  uint uVar2;
  int iVar3;
  IceSubkey *pIVar4;
  uint uVar5;
  uint uVar6;
  IceSubkey *pIVar7;
  
  uVar5 = (uint)*param_1 << 0x18 | (uint)param_1[1] << 0x10 | (uint)param_1[3] |
          (uint)param_1[2] << 8;
  uVar6 = (uint)param_1[4] << 0x18 | (uint)param_1[5] << 0x10 | (uint)param_1[7] |
          (uint)param_1[6] << 8;
  iVar3 = *(int *)(this + 4);
  if (0 < iVar3) {
    pIVar1 = *(IceSubkey **)(this + 8) + 0x18;
    pIVar4 = *(IceSubkey **)(this + 8);
    pIVar7 = pIVar1;
    while( true ) {
      uVar2 = ice_f(uVar6,pIVar4);
      uVar5 = uVar5 ^ uVar2;
      uVar2 = ice_f(uVar5,pIVar4 + 0xc);
      uVar6 = uVar6 ^ uVar2;
      if (pIVar7 == pIVar1 + (iVar3 - 1U >> 1) * 0x18) break;
      pIVar4 = pIVar7;
      pIVar7 = pIVar7 + 0x18;
    }
  }
  iVar3 = 4;
  do {
    param_2[iVar3 + -1] = (uchar)uVar6;
    uVar6 = uVar6 >> 8;
    param_2[iVar3 + 3] = (uchar)uVar5;
    uVar5 = uVar5 >> 8;
    iVar3 = iVar3 + -1;
  } while (iVar3 != 0);
  return;
}

SourceMod gamedata

paste into addons/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.



        

        

          

Type inference is best-effort from the C signature - sanity-check the DHooks types before shipping.

Return-type handling cheatsheet (DHookReturn)