//
// cocos2d::ZipUtils::encryptDecryptWKey from 0x7fb550 to 0x7fb5da (138 bytes)
//
// 2 xrefs:
// > cocos2d::ZipUtils::base64DecodeEnc @ 0x7fb648
// > cocos2d::ZipUtils::base64EncodeEnc @ 0x7fb6e4
//
// This function is hookable on this platform (idp: arm, 32 bit: True, 64 bit: False!
//
// Using BromaIDA 8.3.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings
// Generated at Fri, 27 Nov 2026 12:01:15 +0000
//
int __fastcall cocos2d::ZipUtils::encryptDecryptWKey(int a1, unsigned __int8 *a2, unsigned __int8 *a3)
{
int v5; // r5
unsigned int v7; // r6
unsigned int v8; // r5
int v9; // r7
unsigned int v10; // r7
int v11; // r2
_BYTE *v12; // r10
unsigned __int8 *v13; // r3
unsigned __int8 v14; // r11
int v15; // r1
unsigned __int8 *v16; // r3
*(_DWORD *)a1 = 0;
*(_DWORD *)(a1 + 4) = 0;
*(_DWORD *)(a1 + 8) = 0;
v5 = *a2;
v7 = 0;
if ( (v5 & 1) != 0 )
v8 = *((_DWORD *)a2 + 1);
else
v8 = v5 >> 1;
std::string::resize((unsigned __int8 *)a1, v8, 0);
v9 = *a3;
if ( (v9 & 1) != 0 )
v10 = *((_DWORD *)a3 + 1);
else
v10 = v9 >> 1;
while ( v7 != v8 )
{
if ( (*(_BYTE *)a1 & 1) != 0 )
v11 = *(_DWORD *)(a1 + 8);
else
v11 = a1 + 1;
v12 = (_BYTE *)(v11 + v7);
if ( (*a2 & 1) != 0 )
v13 = *((unsigned __int8 **)a2 + 2);
else
v13 = a2 + 1;
v14 = v13[v7];
v15 = v7 % v10;
++v7;
if ( (*a3 & 1) != 0 )
v16 = *((unsigned __int8 **)a3 + 2);
else
v16 = a3 + 1;
*v12 = v14 ^ v16[v15];
}
return a1;
}