//
// LeaderboardsLayer::onInfo from 0x100512c70 to 0x100512e39 (457 bytes)
//
// 1 xrefs:
// > LeaderboardsLayer::init @ 0x100512ab0
//
// 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
//
void __fastcall LeaderboardsLayer::onInfo(LeaderboardsLayer *a1, cocos2d::CCObject *a2)
{
double v2; // xmm0_8
const std::string::value_type *v3; // rsi
__int64 v4; // r14
const char *data; // r15
size_t v6; // rax
size_t v7; // r12
char *v8; // r13
char *v9; // rbx
int v10; // [rsp+8h] [rbp-78h]
std::string __src; // [rsp+10h] [rbp-70h] BYREF
_QWORD __dst[2]; // [rsp+28h] [rbp-58h] BYREF
void *__p; // [rsp+38h] [rbp-48h]
std::string v14; // [rsp+40h] [rbp-40h] BYREF
*(_WORD *)&v14.__r_.__value_.__l.0 = 0;
*(_WORD *)&__src.__r_.__value_.__l.0 = 0;
switch ( a1->m_type )
{
case Top100:
std::string::assign(&v14, "Top 100");
v3 = "The Top 100 leaderboard shows the players with the most Stars in the game. Players must be manually whitelisted by a Leaderboard Moderator to appear here, ensuring legitimate rankings.";
goto LABEL_6;
case Global:
std::string::assign(&v14, "Global");
v3 = "The Global leaderboard shows players in order of Stars.\n"
"Players banned by Leaderboard Moderators are excluded.";
goto LABEL_6;
case Creator:
std::string::assign(&v14, "Creators");
v3 = "The Creators leaderboard is sorted by amount of Creator Points. Creating a rated level rewards 1, Featured rewards 2, Epic rewards 3, Legendary rewards 4, and Mythic rewards 5.";
goto LABEL_6;
case Friends:
std::string::assign(&v14, "Friends");
v3 = "The Friends leaderboard shows your friends in order of Stars.";
LABEL_6:
std::string::assign(&__src, v3);
if ( (*(_BYTE *)&v14.__r_.__value_.__s.0 & 1) != 0 )
{
LODWORD(v4) = v14.__r_.__value_.__r.__words[2];
if ( (*(_BYTE *)&__src.__r_.__value_.__s.0 & 1) == 0 )
{
LABEL_8:
data = __src.__r_.__value_.__s.__data_;
goto LABEL_11;
}
}
else
{
v4 = (__int64)v14.__r_.__value_.__r.__words + 1;
if ( (*(_BYTE *)&__src.__r_.__value_.__s.0 & 1) == 0 )
goto LABEL_8;
}
data = __src.__r_.__value_.__l.__data_;
LABEL_11:
v6 = strlen(data);
if ( v6 >= 0xFFFFFFFFFFFFFFF8LL )
sub_100006BF0(v2);
v7 = v6;
if ( v6 >= 0x17 )
{
v10 = v4;
v4 = 26;
if ( (v6 | 7) != 0x17 )
v4 = (v6 | 7) + 1;
v8 = (char *)operator new(v4);
__p = v8;
__dst[0] = v4 | 1;
__dst[1] = v7;
LODWORD(v4) = v10;
}
else
{
LOBYTE(__dst[0]) = 2 * v6;
v8 = (char *)__dst + 1;
if ( !v6 )
goto LABEL_19;
}
memmove(v8, data, v7);
LABEL_19:
v8[v7] = 0;
v9 = FLAlertLayer::create_1((int)a1 + 416, v4, (__int64)__dst, (int)"OK", (int)"Info", COERCE_DOUBLE(1136525312));
if ( (__dst[0] & 1) != 0 )
operator delete(__p);
(*(void (__fastcall **)(char *))(*(_QWORD *)v9 + 1288LL))(v9);
if ( (*(_BYTE *)&__src.__r_.__value_.__s.0 & 1) != 0 )
operator delete(__src.__r_.__value_.__l.__data_);
LABEL_23:
if ( (*(_BYTE *)&v14.__r_.__value_.__s.0 & 1) != 0 )
operator delete(v14.__r_.__value_.__l.__data_);
return;
default:
goto LABEL_23;
}
}