//
// cocos2d::ZipUtils::base64DecodeEnc from 0x1001e8c80 to 0x1001e8e66 (486 bytes)
//
// 7 xrefs:
// > GameLevelManager::onGetGJRewardsCompleted @ 0x10052c6c8
// > sub_10052CE00 @ 0x10052d323
// > GJGameLevel::create @ 0x100541716
// > sub_100560AF0 @ 0x100560dc1
// > GJUserMessage::create @ 0x10056840c
// > sub_100577350 @ 0x10057785d
// > MusicDownloadManager::generateCustomContentURL @ 0x10065979c
//
// This function is hookable on this platform (idp: pc, 32 bit: False, 64 bit: True!
//
// 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:26:30 +0000
//
std::string *__fastcall cocos2d::ZipUtils::base64DecodeEnc(std::string *this, unsigned __int8 *a2, __int128 *a3)
{
std::string *v5; // rbx
__int64 v6; // rsi
unsigned __int8 *v7; // rdi
__int64 v8; // rsi
int v9; // eax
unsigned __int64 size; // r14
char v11; // al
unsigned int v12; // esi
__int64 v13; // rcx
std::string::pointer data; // r10
char *v15; // rax
char v16; // al
std::string::pointer v17; // rdx
const void *v18; // rsi
unsigned __int64 v19; // rdx
std::string v21; // [rsp+0h] [rbp-60h] BYREF
__int128 v22; // [rsp+20h] [rbp-40h] BYREF
void *__p; // [rsp+30h] [rbp-30h]
std::string::value_type *__s; // [rsp+40h] [rbp-20h] BYREF
v5 = this;
v6 = *a2;
if ( (v6 & 1) != 0 )
{
v8 = *((_QWORD *)a2 + 1);
if ( !v8 )
{
v18 = *((const void **)a2 + 2);
v19 = 0;
goto LABEL_38;
}
__s = nullptr;
v7 = *((unsigned __int8 **)a2 + 2);
}
else
{
if ( !v6 )
{
LABEL_12:
v5->__r_.__value_.__r.__words[2] = *((_QWORD *)a2 + 2);
*(_OWORD *)&v5->__r_.__value_.__l.0 = *(_OWORD *)a2;
return v5;
}
__s = nullptr;
v7 = a2 + 1;
v8 = (unsigned int)v6 >> 1;
}
v9 = sub_100314A00(v7, v8, &__s, 1);
if ( v9 <= 0 )
{
if ( __s )
{
operator delete[](__s);
__s = nullptr;
}
if ( (*a2 & 1) == 0 )
goto LABEL_12;
v19 = *((_QWORD *)a2 + 1);
v18 = *((const void **)a2 + 2);
this = v5;
LABEL_38:
sub_10001AD30(this, v18, v19);
return v5;
}
memset(&v21, 0, sizeof(v21));
std::string::append(&v21, __s, (unsigned int)v9);
if ( (*(_BYTE *)a3 & 1) != 0 )
{
sub_10001AD30(&v22, *((const void **)a3 + 2), *((_QWORD *)a3 + 1));
}
else
{
__p = *((void **)a3 + 2);
v22 = *a3;
}
*(_OWORD *)&v5->__r_.__value_.__l.0 = 0;
v5->__r_.__value_.__r.__words[2] = 0;
if ( (*(_BYTE *)&v21.__r_.__value_.__s.0 & 1) != 0 )
size = v21.__r_.__value_.__l.__size_;
else
size = *(_BYTE *)&v21.__r_.__value_.__l.0 >> 1;
std::string::resize(v5, size, 0);
v11 = v22 & 1;
if ( (v22 & 1) != 0 )
{
v12 = DWORD2(v22);
if ( !size )
goto LABEL_30;
LABEL_21:
v13 = 0;
do
{
data = v21.__r_.__value_.__s.__data_;
if ( (*(_BYTE *)&v21.__r_.__value_.__s.0 & 1) != 0 )
data = v21.__r_.__value_.__l.__data_;
v15 = (char *)&v22 + 1;
if ( (v22 & 1) != 0 )
v15 = (char *)__p;
v16 = data[v13] ^ v15[(unsigned int)v13 % v12];
v17 = v5->__r_.__value_.__s.__data_;
if ( (*(_BYTE *)&v5->__r_.__value_.__s.0 & 1) != 0 )
v17 = v5->__r_.__value_.__l.__data_;
v17[v13++] = v16;
}
while ( size > (unsigned int)v13 );
v11 = v22 & 1;
goto LABEL_30;
}
v12 = (unsigned __int8)v22 >> 1;
if ( size )
goto LABEL_21;
LABEL_30:
if ( v11 )
operator delete(__p);
if ( __s )
{
operator delete[](__s);
__s = nullptr;
}
if ( (*(_BYTE *)&v21.__r_.__value_.__s.0 & 1) != 0 )
operator delete(v21.__r_.__value_.__l.__data_);
return v5;
}