//
// LevelTools::getLevel from 0x42092c to 0x4213d4 (2728 bytes)
//
// 5 xrefs:
// > LevelTools::getLevel @ 0x4212de
// > GameLevelManager::getMainLevel @ 0x4b30e8
// > GameLevelManager::getMainLevel @ 0x4b30f4
// > GameLevelManager::getStarLevelsString @ 0x4d5ede
// > GameLevelManager::getStarLevelsString @ 0x4d5f3c
//
// 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 11:48:01 +0000
//
int __fastcall LevelTools::getLevel(LevelTools *this, int a2, int a3, int a4)
{
int v6; // r0
bool v7; // r2
int v8; // r4
unsigned __int8 *v9; // r10
unsigned __int8 *v10; // r9
unsigned __int8 *v11; // r10
unsigned __int8 *v12; // r10
LocalLevelManager *v13; // r0
int result; // r0
LocalLevelManager *v15; // r0
unsigned int v16; // s15
int v17; // s15
LevelTools *v18; // [sp+0h] [bp-10h] BYREF
int v19; // [sp+4h] [bp-Ch]
int v20; // [sp+8h] [bp-8h]
int v21; // [sp+Ch] [bp-4h]
v18 = this;
v19 = a2;
v20 = a3;
v21 = a4;
v6 = GJGameLevel::create(this);
v8 = v6;
if ( this == (LevelTools *)&byte_9[5] )
{
LevelTools::getAudioTitle((LevelTools *)&v18, 13);
std::string::operator=((unsigned __int8 *)(v8 + 280), (unsigned __int8 *)&v18);
std::string::~string((int)&v18);
*(_DWORD *)(v8 + 432) = 13;
*(_DWORD *)(v8 + 428) = 6;
GJGameLevel::setStars((GJGameLevel *)v8, 14);
*(_DWORD *)(v8 + 920) = 10;
GJGameLevel::setDemon((GJGameLevel *)v8, 1);
v18 = nullptr;
v19 = 0;
v20 = 0;
std::string::__init((int *)&v18, "29_237_29_54_29_29_29_132_29_29_98_29_132_29_29_29", 0x32u);
std::string::operator=((unsigned __int8 *)(v8 + 972), (unsigned __int8 *)&v18);
goto LABEL_58;
}
if ( (int)this <= 14 )
{
if ( this == (LevelTools *)&byte_7 )
{
LevelTools::getAudioTitle((LevelTools *)&v18, 6);
std::string::operator=((unsigned __int8 *)(v8 + 280), (unsigned __int8 *)&v18);
std::string::~string((int)&v18);
*(_DWORD *)(v8 + 432) = 6;
*(_DWORD *)(v8 + 428) = 4;
GJGameLevel::setStars((GJGameLevel *)v8, 7);
v18 = nullptr;
v19 = 0;
v20 = 0;
std::string::__init((int *)&v18, "29_98_29_40_29_29_29_29_29_29_98_29_98_29_29_29", 0x2Fu);
std::string::operator=((unsigned __int8 *)(v8 + 972), (unsigned __int8 *)&v18);
goto LABEL_58;
}
if ( (int)this <= 7 )
{
if ( this == (LevelTools *)((char *)&dword_0 + 3) )
{
LevelTools::getAudioTitle((LevelTools *)&v18, 2);
std::string::operator=((unsigned __int8 *)(v8 + 280), (unsigned __int8 *)&v18);
std::string::~string((int)&v18);
*(_DWORD *)(v8 + 432) = 2;
*(_DWORD *)(v8 + 428) = 2;
GJGameLevel::setStars((GJGameLevel *)v8, 3);
v18 = nullptr;
v19 = 0;
v20 = 0;
std::string::__init((int *)&v18, "29_98_29_40_29_29_29_29_29_29_29_29_98_29_29_29", 0x2Fu);
std::string::operator=((unsigned __int8 *)(v8 + 972), (unsigned __int8 *)&v18);
goto LABEL_58;
}
if ( (int)this <= 3 )
{
if ( this == (LevelTools *)((char *)&dword_0 + 1) )
{
LevelTools::getAudioTitle((LevelTools *)&v18, 0);
std::string::operator=((unsigned __int8 *)(v8 + 280), (unsigned __int8 *)&v18);
std::string::~string((int)&v18);
*(_DWORD *)(v8 + 428) = 1;
*(_DWORD *)(v8 + 432) = 0;
GJGameLevel::setStars((GJGameLevel *)v8, 1);
v18 = nullptr;
v19 = 0;
v20 = 0;
std::string::__init((int *)&v18, "29_98_29_40_29_29_29_29_29_29_177_29_73_29_29_29", 0x30u);
std::string::operator=((unsigned __int8 *)(v8 + 972), (unsigned __int8 *)&v18);
}
else
{
if ( this != (LevelTools *)((char *)&dword_0 + 2) )
return LevelTools::getLevel((LevelTools *)((char *)&dword_0 + 1), a2, v7);
LevelTools::getAudioTitle((LevelTools *)&v18, 1);
std::string::operator=((unsigned __int8 *)(v8 + 280), (unsigned __int8 *)&v18);
std::string::~string((int)&v18);
*(_DWORD *)(v8 + 432) = 1;
*(_DWORD *)(v8 + 428) = 1;
GJGameLevel::setStars((GJGameLevel *)v8, 2);
v18 = nullptr;
v19 = 0;
v20 = 0;
std::string::__init((int *)&v18, "29_54_29_40_29_29_29_29_29_29_98_29_54_29_29_29", 0x2Fu);
std::string::operator=((unsigned __int8 *)(v8 + 972), (unsigned __int8 *)&v18);
}
goto LABEL_58;
}
v9 = (unsigned __int8 *)(v6 + 280);
v10 = (unsigned __int8 *)(v6 + 972);
if ( this == (LevelTools *)&byte_5 )
{
LevelTools::getAudioTitle((LevelTools *)&v18, 4);
std::string::operator=(v9, (unsigned __int8 *)&v18);
std::string::~string((int)&v18);
*(_DWORD *)(v8 + 432) = 4;
*(_DWORD *)(v8 + 428) = 3;
GJGameLevel::setStars((GJGameLevel *)v8, 5);
v18 = nullptr;
v19 = 0;
v20 = 0;
std::string::__init((int *)&v18, "29_73_29_40_29_29_29_29_29_29_98_29_73_29_29_29", 0x2Fu);
std::string::operator=(v10, (unsigned __int8 *)&v18);
goto LABEL_58;
}
if ( (int)this <= 5 )
{
LevelTools::getAudioTitle((LevelTools *)&v18, 3);
std::string::operator=(v9, (unsigned __int8 *)&v18);
std::string::~string((int)&v18);
*(_DWORD *)(v8 + 432) = 3;
*(_DWORD *)(v8 + 428) = 2;
GJGameLevel::setStars((GJGameLevel *)v8, 4);
v18 = nullptr;
v19 = 0;
v20 = 0;
std::string::__init((int *)&v18, "29_73_29_40_29_29_29_29_29_29_73_29_73_29_29_29", 0x2Fu);
}
else
{
LevelTools::getAudioTitle((LevelTools *)&v18, 5);
std::string::operator=(v9, (unsigned __int8 *)&v18);
std::string::~string((int)&v18);
*(_DWORD *)(v8 + 432) = 5;
*(_DWORD *)(v8 + 428) = 3;
GJGameLevel::setStars((GJGameLevel *)v8, 6);
v18 = nullptr;
v19 = 0;
v20 = 0;
std::string::__init((int *)&v18, "29_73_29_40_29_29_29_29_29_29_29_29_73_29_29_29", 0x2Fu);
}
goto LABEL_30;
}
if ( this == (LevelTools *)&byte_9[1] )
{
LevelTools::getAudioTitle((LevelTools *)&v18, 9);
std::string::operator=((unsigned __int8 *)(v8 + 280), (unsigned __int8 *)&v18);
std::string::~string((int)&v18);
*(_DWORD *)(v8 + 432) = 9;
*(_DWORD *)(v8 + 428) = 5;
GJGameLevel::setStars((GJGameLevel *)v8, 10);
v18 = nullptr;
v19 = 0;
v20 = 0;
std::string::__init((int *)&v18, "29_132_29_40_29_29_29_54_29_29_132_29_73_29_29_29", 0x31u);
std::string::operator=((unsigned __int8 *)(v8 + 972), (unsigned __int8 *)&v18);
goto LABEL_58;
}
if ( (int)this <= 10 )
{
if ( this == (LevelTools *)byte_8 )
{
LevelTools::getAudioTitle((LevelTools *)&v18, 7);
std::string::operator=((unsigned __int8 *)(v8 + 280), (unsigned __int8 *)&v18);
std::string::~string((int)&v18);
*(_DWORD *)(v8 + 432) = 7;
*(_DWORD *)(v8 + 428) = 4;
GJGameLevel::setStars((GJGameLevel *)v8, 8);
v18 = nullptr;
v19 = 0;
v20 = 0;
std::string::__init((int *)&v18, "29_132_29_40_29_29_29_29_29_29_73_29_98_29_29_29", 0x30u);
}
else
{
LevelTools::getAudioTitle((LevelTools *)&v18, 8);
std::string::operator=((unsigned __int8 *)(v8 + 280), (unsigned __int8 *)&v18);
std::string::~string((int)&v18);
*(_DWORD *)(v8 + 432) = 8;
*(_DWORD *)(v8 + 428) = 4;
GJGameLevel::setStars((GJGameLevel *)v8, 9);
v18 = nullptr;
v19 = 0;
v20 = 0;
std::string::__init((int *)&v18, "29_98_29_40_29_29_29_40_29_29_98_29_98_29_29_29", 0x2Fu);
}
LABEL_17:
std::string::operator=((unsigned __int8 *)(v8 + 972), (unsigned __int8 *)&v18);
LABEL_58:
v13 = (LocalLevelManager *)std::string::~string((int)&v18);
goto LABEL_65;
}
v11 = (unsigned __int8 *)(v6 + 280);
v10 = (unsigned __int8 *)(v6 + 972);
if ( this == (LevelTools *)&byte_9[3] )
{
LevelTools::getAudioTitle((LevelTools *)&v18, 11);
std::string::operator=(v11, (unsigned __int8 *)&v18);
std::string::~string((int)&v18);
*(_DWORD *)(v8 + 432) = 11;
*(_DWORD *)(v8 + 428) = 5;
GJGameLevel::setStars((GJGameLevel *)v8, 12);
v18 = nullptr;
v19 = 0;
v20 = 0;
std::string::__init((int *)&v18, "29_237_29_54_29_29_29_73_29_29_132_29_132_29_29_29", 0x32u);
std::string::operator=(v10, (unsigned __int8 *)&v18);
goto LABEL_58;
}
if ( (int)this <= 12 )
{
LevelTools::getAudioTitle((LevelTools *)&v18, 10);
std::string::operator=(v11, (unsigned __int8 *)&v18);
std::string::~string((int)&v18);
*(_DWORD *)(v8 + 432) = 10;
*(_DWORD *)(v8 + 428) = 5;
GJGameLevel::setStars((GJGameLevel *)v8, 11);
v18 = nullptr;
v19 = 0;
v20 = 0;
std::string::__init((int *)&v18, "29_237_29_40_29_29_29_73_29_29_29_29_98_29_29_29", 0x30u);
}
else
{
LevelTools::getAudioTitle((LevelTools *)&v18, 12);
std::string::operator=(v11, (unsigned __int8 *)&v18);
std::string::~string((int)&v18);
*(_DWORD *)(v8 + 432) = 12;
*(_DWORD *)(v8 + 428) = 5;
GJGameLevel::setStars((GJGameLevel *)v8, 10);
v18 = nullptr;
v19 = 0;
v20 = 0;
std::string::__init((int *)&v18, "29_237_29_40_29_29_29_98_29_29_98_29_132_29_29_29", 0x31u);
}
goto LABEL_30;
}
if ( this == (LevelTools *)((char *)&dword_14 + 1) )
{
LevelTools::getAudioTitle((LevelTools *)&v18, 20);
std::string::operator=((unsigned __int8 *)(v8 + 280), (unsigned __int8 *)&v18);
std::string::~string((int)&v18);
*(_DWORD *)(v8 + 432) = 20;
*(_DWORD *)(v8 + 428) = 5;
GJGameLevel::setStars((GJGameLevel *)v8, 12);
v18 = nullptr;
v19 = 0;
v20 = 0;
std::string::__init(
(int *)&v18,
"40_630_195_48_0_0_210_114_0_0_572_247_97_0_0_53_466_135_0_459_276_71_448_0_101_88_101_0_0_0_0_0_0_0_0_0_0_0_0_0_0_"
"0_0_0_0_0_0_0_0_0_0_0_0_0_0",
0x8Du);
std::string::operator=((unsigned __int8 *)(v8 + 972), (unsigned __int8 *)&v18);
goto LABEL_58;
}
if ( (int)this <= 21 )
{
if ( this == (LevelTools *)((char *)&word_10 + 1) )
{
LevelTools::getAudioTitle((LevelTools *)&v18, 16);
std::string::operator=((unsigned __int8 *)(v8 + 280), (unsigned __int8 *)&v18);
std::string::~string((int)&v18);
*(_DWORD *)(v8 + 432) = 16;
*(_DWORD *)(v8 + 428) = 4;
GJGameLevel::setStars((GJGameLevel *)v8, 10);
v18 = nullptr;
v19 = 0;
v20 = 0;
std::string::__init((int *)&v18, "29_237_29_73_29_29_98_132_29_29_566_54_132_29_29_29", 0x33u);
std::string::operator=((unsigned __int8 *)(v8 + 972), (unsigned __int8 *)&v18);
goto LABEL_58;
}
if ( (int)this <= 17 )
{
if ( this == (LevelTools *)&byte_9[6] )
{
LevelTools::getAudioTitle((LevelTools *)&v18, 14);
std::string::operator=((unsigned __int8 *)(v8 + 280), (unsigned __int8 *)&v18);
std::string::~string((int)&v18);
*(_DWORD *)(v8 + 432) = 14;
*(_DWORD *)(v8 + 428) = 5;
GJGameLevel::setStars((GJGameLevel *)v8, 12);
v18 = nullptr;
v19 = 0;
v20 = 0;
std::string::__init((int *)&v18, "29_237_98_40_29_29_29_237_29_29_98_73_177_29_29_29", 0x32u);
}
else
{
LevelTools::getAudioTitle((LevelTools *)&v18, 15);
std::string::operator=((unsigned __int8 *)(v8 + 280), (unsigned __int8 *)&v18);
std::string::~string((int)&v18);
*(_DWORD *)(v8 + 432) = 15;
*(_DWORD *)(v8 + 428) = 5;
GJGameLevel::setStars((GJGameLevel *)v8, 12);
v18 = nullptr;
v19 = 0;
v20 = 0;
std::string::__init((int *)&v18, "29_317_73_73_29_29_54_132_29_29_237_132_177_29_29_29", 0x34u);
}
goto LABEL_17;
}
v12 = (unsigned __int8 *)(v6 + 280);
v10 = (unsigned __int8 *)(v6 + 972);
if ( this == (LevelTools *)((char *)&word_12 + 1) )
{
LevelTools::getAudioTitle((LevelTools *)&v18, 18);
std::string::operator=(v12, (unsigned __int8 *)&v18);
std::string::~string((int)&v18);
*(_DWORD *)(v8 + 432) = 18;
*(_DWORD *)(v8 + 428) = 4;
GJGameLevel::setStars((GJGameLevel *)v8, 10);
v18 = nullptr;
v19 = 0;
v20 = 0;
std::string::__init((int *)&v18, "29_424_132_40_29_29_566_132_29_29_756_237_132_29_73_29", 0x36u);
std::string::operator=(v10, (unsigned __int8 *)&v18);
goto LABEL_58;
}
if ( (int)this <= 19 )
{
LevelTools::getAudioTitle((LevelTools *)&v18, 17);
std::string::operator=(v12, (unsigned __int8 *)&v18);
std::string::~string((int)&v18);
*(_DWORD *)(v8 + 432) = 17;
*(_DWORD *)(v8 + 428) = 6;
GJGameLevel::setStars((GJGameLevel *)v8, 14);
*(_DWORD *)(v8 + 920) = 20;
GJGameLevel::setDemon((GJGameLevel *)v8, 1);
v18 = nullptr;
v19 = 0;
v20 = 0;
std::string::__init((int *)&v18, "29_317_40_54_29_40_132_132_29_29_424_98_237_29_29_29", 0x34u);
}
else
{
LevelTools::getAudioTitle((LevelTools *)&v18, 19);
std::string::operator=(v12, (unsigned __int8 *)&v18);
std::string::~string((int)&v18);
*(_DWORD *)(v8 + 432) = 19;
*(_DWORD *)(v8 + 428) = 6;
GJGameLevel::setStars((GJGameLevel *)v8, 15);
*(_DWORD *)(v8 + 920) = 30;
GJGameLevel::setDemon((GJGameLevel *)v8, 1);
v18 = nullptr;
v19 = 0;
v20 = 0;
std::string::__init((int *)&v18, "29_317_73_73_29_29_317_424_73_29_566_317_177_29_132_54", 0x36u);
}
LABEL_30:
std::string::operator=(v10, (unsigned __int8 *)&v18);
goto LABEL_58;
}
if ( this == (LevelTools *)&stru_137C.st_other )
{
v18 = nullptr;
v19 = 0;
v20 = 0;
std::string::__init((int *)&v18, "The Tower", 9u);
std::string::operator=((unsigned __int8 *)(v8 + 280), (unsigned __int8 *)&v18);
std::string::~string((int)&v18);
*(_DWORD *)(v8 + 432) = 0;
*(_DWORD *)(v8 + 436) = 10003039;
*(_DWORD *)(v8 + 428) = 2;
GJGameLevel::setStars((GJGameLevel *)v8, 5);
v18 = nullptr;
v19 = 0;
v20 = 0;
std::string::__init((int *)&v18, "1,210,25,209,56,310,58,250,62,249", 0x21u);
std::string::operator=((unsigned __int8 *)(v8 + 972), (unsigned __int8 *)&v18);
LABEL_63:
v13 = (LocalLevelManager *)std::string::~string((int)&v18);
*(_DWORD *)(v8 + 724) = 5;
goto LABEL_65;
}
if ( (int)this > 5001 )
{
if ( this == (LevelTools *)((char *)&stru_137C.st_shndx + 1) )
{
v18 = nullptr;
v19 = 0;
v20 = 0;
std::string::__init((int *)&v18, "The Cellar", 0xAu);
std::string::operator=((unsigned __int8 *)(v8 + 280), (unsigned __int8 *)&v18);
std::string::~string((int)&v18);
*(_DWORD *)(v8 + 432) = 0;
*(_DWORD *)(v8 + 436) = 10002875;
*(_DWORD *)(v8 + 428) = 4;
GJGameLevel::setStars((GJGameLevel *)v8, 7);
v18 = nullptr;
v19 = 0;
v20 = 0;
std::string::__init((int *)&v18, "50,206,52,396,54,682", 0x14u);
std::string::operator=((unsigned __int8 *)(v8 + 972), (unsigned __int8 *)&v18);
}
else if ( (int)this < 5003 )
{
v18 = nullptr;
v19 = 0;
v20 = 0;
std::string::__init((int *)&v18, "The Sewers", 0xAu);
std::string::operator=((unsigned __int8 *)(v8 + 280), (unsigned __int8 *)&v18);
std::string::~string((int)&v18);
*(_DWORD *)(v8 + 432) = 0;
*(_DWORD *)(v8 + 436) = 10003129;
*(_DWORD *)(v8 + 428) = 3;
GJGameLevel::setStars((GJGameLevel *)v8, 6);
v18 = nullptr;
v19 = 0;
v20 = 0;
std::string::__init((int *)&v18, "50,366,52,332,54,408", 0x14u);
std::string::operator=((unsigned __int8 *)(v8 + 972), (unsigned __int8 *)&v18);
}
else
{
if ( this != (LevelTools *)&stru_138C )
return LevelTools::getLevel((LevelTools *)((char *)&dword_0 + 1), a2, v7);
v18 = nullptr;
v19 = 0;
v20 = 0;
std::string::__init((int *)&v18, "The Secret Hollow", 0x11u);
std::string::operator=((unsigned __int8 *)(v8 + 280), (unsigned __int8 *)&v18);
std::string::~string((int)&v18);
*(_DWORD *)(v8 + 432) = 0;
*(_DWORD *)(v8 + 436) = 10006086;
*(_DWORD *)(v8 + 428) = 4;
GJGameLevel::setStars((GJGameLevel *)v8, 7);
v18 = nullptr;
v19 = 0;
v20 = 0;
std::string::__init((int *)&v18, "52,505,54,1104,56,556,58,368", 0x1Cu);
std::string::operator=((unsigned __int8 *)(v8 + 972), (unsigned __int8 *)&v18);
}
goto LABEL_63;
}
if ( this != (LevelTools *)((char *)&dword_14 + 2) )
{
if ( this != (LevelTools *)&stru_BAC.st_other )
return LevelTools::getLevel((LevelTools *)((char *)&dword_0 + 1), a2, v7);
v18 = nullptr;
v19 = 0;
v20 = 0;
std::string::__init((int *)&v18, "The Challenge", 0xDu);
std::string::operator=((unsigned __int8 *)(v8 + 280), (unsigned __int8 *)&v18);
std::string::~string((int)&v18);
*(_DWORD *)(v8 + 432) = 26;
*(_DWORD *)(v8 + 428) = 3;
GJGameLevel::setStars((GJGameLevel *)v8, 3);
v18 = nullptr;
v19 = 0;
v20 = 0;
std::string::__init((int *)&v18, "73_237_29_40_29_29_237_98_29_29_237_237_132_29_29_29", 0x34u);
std::string::operator=((unsigned __int8 *)(v8 + 972), (unsigned __int8 *)&v18);
goto LABEL_58;
}
LevelTools::getAudioTitle((LevelTools *)&v18, 21);
std::string::operator=((unsigned __int8 *)(v8 + 280), (unsigned __int8 *)&v18);
std::string::~string((int)&v18);
*(_DWORD *)(v8 + 432) = 21;
*(_DWORD *)(v8 + 428) = 5;
GJGameLevel::setStars((GJGameLevel *)v8, 12);
v18 = nullptr;
v19 = 0;
v20 = 0;
std::string::__init((int *)&v18, "24,340,52,244,54,1335,56,356,58,510,60,1257", 0x2Bu);
std::string::operator=((unsigned __int8 *)(v8 + 972), (unsigned __int8 *)&v18);
v13 = (LocalLevelManager *)std::string::~string((int)&v18);
*(_DWORD *)(v8 + 1000) = 21940;
LABEL_65:
if ( !a2 )
{
v15 = (LocalLevelManager *)LocalLevelManager::sharedState(v13);
LocalLevelManager::getMainLevelString((LocalLevelManager *)&v18, v15);
std::string::operator=((unsigned __int8 *)(v8 + 304), (unsigned __int8 *)&v18);
std::string::~string((int)&v18);
}
*(_DWORD *)(v8 + 276) = this;
v16 = rand();
result = v8;
v17 = (int)(float)(vcvts_n_f32_s32(v16, 0x1Fu) * 1000.0);
*(_DWORD *)(v8 + 272) = v17;
*(_DWORD *)(v8 + 268) = (char *)this + v17;
*(_DWORD *)(v8 + 952) = 1;
if ( this != (LevelTools *)&stru_BAC.st_other )
*(_DWORD *)(v8 + 788) = 3;
return result;
}