//
// SFXBrowser::onImportFile from 0xb96a94 to 0xb96da8 (788 bytes)
//
// 3 xrefs:
// > ??> @ 0xc70c0
// > sub_B947C8 @ 0xb95f44
// > ??> @ 0x1545d08
//
// This function is hookable on this platform (idp: arm, 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 13:02:41 +0000
//
__int64 __fastcall SFXBrowser::onImportFile(SFXBrowser *this, cocos2d::CCObject *a2)
{
MusicDownloadManager *v3; // x0
__int64 v4; // x4
__int64 v5; // x5
__int64 v6; // x6
__int64 v7; // x7
int v8; // w0
void (__fastcall *v10)(SFXBrowser *, __int64, __int64); // x23
__int64 v11; // x0
char *v12; // x2
cocos2d::CCString *v13; // x0
const char *CString; // x0
size_t v15; // x0
__int64 v16; // x1
void (__fastcall *v17)(SFXBrowser *, __int64, __int64); // x23
__int64 v18; // x0
char v19; // [xsp+0h] [xbp+0h]
char *v20; // [xsp+48h] [xbp+48h]
char *v21; // [xsp+58h] [xbp+58h] BYREF
_QWORD v22[2]; // [xsp+60h] [xbp+60h] BYREF
void *v23; // [xsp+70h] [xbp+70h]
__int64 v24[2]; // [xsp+78h] [xbp+78h] BYREF
void *v25; // [xsp+88h] [xbp+88h]
__int64 v26; // [xsp+90h] [xbp+90h] BYREF
size_t v27; // [xsp+98h] [xbp+98h]
void *v28; // [xsp+A0h] [xbp+A0h]
__int64 v29; // [xsp+A8h] [xbp+A8h] BYREF
size_t v30; // [xsp+B0h] [xbp+B0h]
void *v31; // [xsp+B8h] [xbp+B8h]
__int64 v32[2]; // [xsp+C0h] [xbp+C0h] BYREF
void *v33; // [xsp+D0h] [xbp+D0h]
v22[0] = 0;
v22[1] = 0;
v23 = nullptr;
v21 = nullptr;
v3 = (MusicDownloadManager *)MusicDownloadManager::sharedState(_stack_chk_guard);
v8 = MusicDownloadManager::importCustomSFXFromFile(
v3,
(__int64)v22,
(int *)&v21,
(int *)&v21 + 1,
v4,
v5,
v6,
v7,
v19);
if ( v8 )
{
if ( v8 == 1 )
{
v12 = (char *)v22 + 1;
if ( (__int64)v21 <= 0 )
{
if ( (v22[0] & 1) != 0 )
v12 = (char *)v23;
v13 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat(
(cocos2d::CCString *)"Imported %i to '%s'",
(const char *)(unsigned int)v21,
v12);
}
else
{
if ( (v22[0] & 1) != 0 )
v12 = (char *)v23;
v13 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat(
(cocos2d::CCString *)"Imported %i to '%s' (%i existing)",
(const char *)(unsigned int)v21,
v12);
}
CString = (const char *)cocos2d::CCString::getCString(v13);
v26 = 0;
v20 = (char *)CString;
v27 = 0;
v28 = nullptr;
v15 = strlen(CString);
std::string::__init(&v26, v20, v15);
v16 = *(_QWORD *)this;
v29 = 0;
v30 = 0;
v31 = nullptr;
v17 = *(void (__fastcall **)(SFXBrowser *, __int64, __int64))(v16 + 464);
if ( (v26 & 1) != 0 )
{
std::string::__init(&v29, v28, v27);
}
else
{
v31 = v28;
v29 = v26;
v30 = v27;
}
v32[0] = 0;
v32[1] = 0;
v33 = nullptr;
std::string::__init(v32, &byte_11B8890, 0);
v18 = TextAlertPopup::create((char *)&v29, 150, (char *)v32, 0.9, 0.5);
v17(this, v18, 100);
if ( (v32[0] & 1) != 0 )
operator delete(v33);
if ( (v29 & 1) != 0 )
operator delete(v31);
SFXBrowser::refreshCustomList(this);
if ( (v26 & 1) != 0 )
operator delete(v28);
}
}
else
{
v10 = *(void (__fastcall **)(SFXBrowser *, __int64, __int64))(*(_QWORD *)this + 464LL);
v24[0] = 0;
v24[1] = 0;
v25 = nullptr;
std::string::__init(v24, "Import failed", 0xDu);
v26 = 0;
v27 = 0;
v28 = nullptr;
std::string::__init(&v26, &byte_11B8890, 0);
v11 = TextAlertPopup::create((char *)v24, 150, (char *)&v26, 0.9, 0.5);
v10(this, v11, 100);
if ( (v26 & 1) != 0 )
operator delete(v28);
if ( (v24[0] & 1) != 0 )
operator delete(v25);
}
if ( (v22[0] & 1) != 0 )
operator delete(v23);
return _stack_chk_guard;
}