//
// MusicDownloadManager::exportCustomSFXToFile from 0x575a78 to 0x575b7c (260 bytes)
//
// 1 xrefs:
// > SFXBrowser::onExportFile @ 0x6c472c
//
// 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:52:41 +0000
//
size_t __fastcall MusicDownloadManager::exportCustomSFXToFile(MusicDownloadManager *this)
{
size_t v1; // r4
char *v2; // r0
FILE *v3; // r7
char *v4; // r0
size_t v5; // r2
int v7; // [sp+Ch] [bp-34h] BYREF
size_t n; // [sp+10h] [bp-30h]
void *ptr; // [sp+14h] [bp-2Ch]
_DWORD *v10; // [sp+18h] [bp-28h] BYREF
_DWORD v11[2]; // [sp+1Ch] [bp-24h] BYREF
_DWORD v12[2]; // [sp+24h] [bp-1Ch] BYREF
char *filename; // [sp+2Ch] [bp-14h]
int v14[3]; // [sp+30h] [bp-10h] BYREF
v11[0] = 0;
v11[1] = 0;
v10 = v11;
MusicDownloadManager::encodeCustomSFX(&v7, this, &v10);
std::__tree::~__tree((int)&v10);
if ( (v7 & 1) != 0 )
v1 = n;
else
v1 = (int)(unsigned __int8)v7 >> 1;
if ( v1 )
{
v12[0] = 0;
v12[1] = 0;
filename = nullptr;
memset(v14, 0, sizeof(v14));
std::string::__init(v14, "customsfx.gdsfx", 0xFu);
v1 = GameToolbox::showSaveFileDialog(
(cocos2d::CCFileUtils *)"Export SFX Folders",
(int)"GD SFX Folder Files (*.gdsfx)",
"gdsfx",
(unsigned __int8 *)v14,
(int)v12);
std::string::~string((int)v14);
if ( v1 && ((v12[0] & 1) != 0 ? (v2 = filename) : (v2 = (char *)v12 + 1), (v3 = fopen(v2, "w")) != nullptr) )
{
if ( (v7 & 1) != 0 )
{
v4 = (char *)ptr;
v5 = n;
}
else
{
v5 = (int)(unsigned __int8)v7 >> 1;
v4 = (char *)&v7 + 1;
}
fwrite(v4, 1u, v5, v3);
fclose(v3);
}
else
{
v1 = 0;
}
std::string::~string((int)v12);
}
std::string::~string((int)&v7);
return v1;
}