//
// cocos2d::ZipUtils::base64URLDecode from 0x1001e9100 to 0x1001e91c0 (192 bytes)
//
// 2 xrefs:
// > GameToolbox::extractServerPopup @ 0x1004ea0a3
// > LevelTools::base64DecodeString @ 0x100500bb7
//
// 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::base64URLDecode(std::string *this, std::string *a2)
{
unsigned int v2; // eax
std::string::pointer data; // rsi
std::string::size_type size; // rax
int v5; // eax
std::string::value_type *__s; // [rsp+8h] [rbp-18h] BYREF
v2 = (unsigned int)a2->__r_.__value_.__l.0;
if ( (v2 & 1) != 0 )
{
size = a2->__r_.__value_.__l.__size_;
if ( !size )
{
sub_10001AD30(this, a2->__r_.__value_.__l.__data_, 0);
return this;
}
__s = nullptr;
data = a2->__r_.__value_.__l.__data_;
}
else
{
if ( !*(_BYTE *)&a2->__r_.__value_.__s.0 )
{
*this = *a2;
return this;
}
__s = nullptr;
data = a2->__r_.__value_.__s.__data_;
LODWORD(size) = v2 >> 1;
}
v5 = sub_100314A00(data, (unsigned int)size, &__s, 1);
if ( v5 <= 0 )
{
if ( __s )
operator delete[](__s);
*(_WORD *)&this->__r_.__value_.__l.0 = 0;
}
else
{
*(_OWORD *)&this->__r_.__value_.__l.0 = 0;
this->__r_.__value_.__r.__words[2] = 0;
std::string::append(this, __s, (unsigned int)v5);
if ( __s )
operator delete[](__s);
}
return this;
}