//
// SFXBrowser::onExportFile from 0x14061df90 to 0x14061e1a0 (528 bytes)
//
// 2 xrefs:
// > SFXBrowser::init @ 0x1406182fe
// > ??> @ 0x1409302fc
//
// 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 11:35:21 +0000
//
// Hidden C++ exception states: #wind=4
__int64 __fastcall SFXBrowser::onExportFile(__int64 *a1)
{
_QWORD *v2; // rax
__int64 v3; // rcx
int CustomSFXCount; // ebx
char *v5; // rdx
__int64 v6; // r8
__int64 v7; // rcx
__int64 result; // rax
__int64 v9; // rbx
cocos2d::CCNode *v10; // rax
__int128 v11; // [rsp+30h] [rbp-40h] BYREF
__int64 v12; // [rsp+40h] [rbp-30h]
__int64 v13; // [rsp+48h] [rbp-28h]
__int128 v14; // [rsp+50h] [rbp-20h] BYREF
__int64 v15; // [rsp+60h] [rbp-10h]
__int64 v16; // [rsp+68h] [rbp-8h]
void *v17; // [rsp+A0h] [rbp+30h]
void *v18; // [rsp+A0h] [rbp+30h]
v11 = 0u;
v2 = operator new(0x20u);
*v2 = v2;
v2[1] = v2;
v2[2] = v2;
*((_WORD *)v2 + 12) = 257;
*(_QWORD *)&v11 = v2;
v3 = qword_14090C070;
if ( !qword_14090C070 )
{
v17 = operator new(0x3D0u);
qword_14090C070 = MusicDownloadManager::MusicDownloadManager((__int64)v17);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_14090C070 + 72LL))(qword_14090C070);
v3 = qword_14090C070;
}
CustomSFXCount = MusicDownloadManager::getCustomSFXCount(v3, (__int64)&v11);
sub_1400BD560((void **)&v11, (__int64)&v11);
if ( CustomSFXCount <= 0 )
{
v14 = 0;
v15 = 0;
v16 = 15;
LOBYTE(v14) = 0;
v11 = 0;
v12 = 0;
v13 = 0;
v5 = (char *)sub_14003D460(0x20u);
*(_QWORD *)&v11 = v5;
v12 = 27;
v13 = 31;
strcpy(v5, "No custom folders to export");
LABEL_9:
v9 = *a1;
v10 = TextAlertPopup::create((__int64)&v11, (__int64)v5, v6, 150, (__int64)&v14);
return (*(__int64 (__fastcall **)(__int64 *, cocos2d::CCNode *, __int64))(v9 + 456))(a1, v10, 100);
}
v7 = qword_14090C070;
if ( !qword_14090C070 )
{
v18 = operator new(0x3D0u);
qword_14090C070 = MusicDownloadManager::MusicDownloadManager((__int64)v18);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_14090C070 + 72LL))(qword_14090C070);
v7 = qword_14090C070;
}
result = MusicDownloadManager::exportCustomSFXToFile(v7);
if ( (_BYTE)result )
{
v14 = 0;
v15 = 0;
v16 = 15;
LOBYTE(v14) = 0;
v11 = 0;
v12 = 0;
v13 = 0;
*(_QWORD *)&v11 = sub_14003D460(0x20u);
v12 = 20;
v13 = 31;
strcpy((char *)v11, "SFX folders exported");
goto LABEL_9;
}
return result;
}