//
// cocos2d::ZipUtils::base64URLEncode from 0x7fad3c to 0x7fade6 (170 bytes)
//
// 1 xrefs:
// > LevelTools::base64EncodeString @ 0x41f4c8
//
// 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:14 +0000
//
int *__fastcall cocos2d::ZipUtils::base64URLEncode(int *a1, unsigned __int8 *a2)
{
int v3; // r3
int v4; // r3
cocos2d *v5; // r0
signed int v6; // r2
int v7; // r0
int v8; // r1
int v9; // r2
void *v11; // [sp+4h] [bp-18h] BYREF
int v12; // [sp+8h] [bp-14h] BYREF
int v13; // [sp+Ch] [bp-10h]
int v14; // [sp+10h] [bp-Ch]
v3 = *a2;
if ( (v3 & 1) != 0 )
{
v4 = *((_DWORD *)a2 + 1);
if ( !v4 )
goto LABEL_5;
v5 = *((cocos2d **)a2 + 2);
v11 = nullptr;
}
else
{
v4 = v3 >> 1;
if ( !v4 )
{
LABEL_5:
std::string::basic_string(a1, (int)a2);
return a1;
}
v11 = nullptr;
v5 = (cocos2d *)(a2 + 1);
}
v6 = base64Encode(v5, (const unsigned __int8 *)v4, &v11, (_BYTE *)&dword_0 + 1);
if ( v6 <= 0 )
{
if ( v11 )
{
operator delete[](v11);
v11 = nullptr;
}
*a1 = 0;
a1[1] = 0;
a1[2] = 0;
std::string::__init(a1, &unk_B6B226, 0);
}
else
{
v12 = 0;
v13 = 0;
v14 = 0;
std::string::append(&v12, v11, v6);
if ( v11 )
{
operator delete[](v11);
v11 = nullptr;
}
v7 = v12;
v8 = v13;
v9 = v14;
v12 = 0;
v13 = 0;
v14 = 0;
*a1 = v7;
a1[1] = v8;
a1[2] = v9;
std::string::~string((int)&v12);
}
return a1;
}