//
// LeaderboardsLayer::onInfo from 0x100513ca0 to 0x100513e69 (457 bytes)
//
// 1 xrefs:
// > LeaderboardsLayer::init @ 0x100513ae3
//
// 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:31:37 +0000
//
void __fastcall LeaderboardsLayer::onInfo(__int64 a1)
{
const std::string::value_type *v1; // rsi
__int64 v2; // r14
const char *data; // r15
size_t v4; // rax
size_t v5; // r12
char *v6; // r13
char *v7; // rbx
int v8; // [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 v12; // [rsp+40h] [rbp-40h] BYREF
*(_WORD *)&v12.__r_.__value_.__l.0 = 0;
*(_WORD *)&__src.__r_.__value_.__l.0 = 0;
switch ( *(_DWORD *)(a1 + 440) )
{
case 1:
std::string::assign(&v12, "Top 100");
v1 = "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 2:
std::string::assign(&v12, "Global");
v1 = "The Global leaderboard shows players in order of Stars.\n"
"Players banned by Leaderboard Moderators are excluded.";
goto LABEL_6;
case 3:
std::string::assign(&v12, "Creators");
v1 = "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 4:
std::string::assign(&v12, "Friends");
v1 = "The Friends leaderboard shows your friends in order of Stars.";
LABEL_6:
std::string::assign(&__src, v1);
if ( (*(_BYTE *)&v12.__r_.__value_.__s.0 & 1) != 0 )
{
LODWORD(v2) = v12.__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
{
v2 = (__int64)v12.__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:
v4 = strlen(data);
if ( v4 >= 0xFFFFFFFFFFFFFFF8LL )
sub_100003630();
v5 = v4;
if ( v4 >= 0x17 )
{
v8 = v2;
v2 = 26;
if ( (v4 | 7) != 0x17 )
v2 = (v4 | 7) + 1;
v6 = (char *)operator new(v2);
__p = v6;
__dst[0] = v2 | 1;
__dst[1] = v5;
LODWORD(v2) = v8;
}
else
{
LOBYTE(__dst[0]) = 2 * v4;
v6 = (char *)__dst + 1;
if ( !v4 )
goto LABEL_19;
}
memmove(v6, data, v5);
LABEL_19:
v6[v5] = 0;
v7 = FLAlertLayer::create_1((int)a1 + 416, v2, (__int64)__dst, (int)"OK", (int)"Info", 380.0);
if ( (__dst[0] & 1) != 0 )
operator delete(__p);
(*(void (__fastcall **)(char *))(*(_QWORD *)v7 + 1312LL))(v7);
if ( (*(_BYTE *)&__src.__r_.__value_.__s.0 & 1) != 0 )
operator delete(__src.__r_.__value_.__l.__data_);
LABEL_23:
if ( (*(_BYTE *)&v12.__r_.__value_.__s.0 & 1) != 0 )
operator delete(v12.__r_.__value_.__l.__data_);
return;
default:
goto LABEL_23;
}
}