//
// BF_ecb_encrypt from 0xe73630 to 0xe736e4 (180 bytes)
//
// 2 xrefs:
// > sub_E604E8 @ 0xe60554
// > ??> @ 0xa0860
//
// This function is hookable on this platform!
//
// Using BromaIDA 8.0.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit ba9f177b at Thu Jul 16 22:52:06 2026 from https://github.com/geode-sdk/bindings
//
__int64 __fastcall BF_ecb_encrypt(unsigned __int8 *a1, _BYTE *a2, __int64 a3, int a4)
{
int v5; // w6
int v6; // w4
int v7; // w7
int v8; // w0
int v9; // w1
unsigned int v10; // w0
unsigned int v11; // w3
unsigned int v12; // w2
__int64 result; // x0
int v14; // [xsp+28h] [xbp+28h] BYREF
int v15; // [xsp+2Ch] [xbp+2Ch]
v5 = a1[2];
v6 = a1[6];
v7 = a1[3] | (*a1 << 24) | (a1[1] << 16);
v8 = a1[7] | (a1[4] << 24) | (a1[5] << 16);
v14 = v7 | (v5 << 8);
v15 = v8 | (v6 << 8);
if ( a4 )
BF_encrypt(&v14, a3);
else
BF_decrypt(&v14, a3);
v9 = v14;
v10 = v15;
a2[3] = v14;
a2[7] = v10;
v11 = HIBYTE(v10);
v12 = HIWORD(v10);
*a2 = HIBYTE(v9);
a2[1] = BYTE2(v9);
result = v10 >> 8;
a2[2] = BYTE1(v9);
a2[4] = v11;
a2[5] = v12;
a2[6] = result;
return result;
}