//
// GameToolbox::showSaveFileDialog from 0x140074d10 to 0x140074e77 (359 bytes)
//
// 2 xrefs:
// > LocalLevelManager::exportLevelsToFile @ 0x14046e86d
// > ??> @ 0x1409118dc
//
// 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:25:50 +0000
//
char __fastcall GameToolbox::showSaveFileDialog(
const CHAR *a1,
const CHAR *a2,
const CHAR *a3,
const char *a4,
_BYTE *a5)
{
_BYTE *v9; // rax
__int64 v10; // rdx
__int64 v11; // rcx
__int64 v12; // r8
__int64 v13; // r9
__int64 v14; // rax
BOOL SaveFileNameA; // ebx
__int64 v16; // rdx
__int64 v17; // rcx
__int64 v18; // r8
__int64 v19; // r9
cocos2d::CCEGLView *v20; // rax
size_t v22; // r8
struct tagOFNA v23; // [rsp+20h] [rbp-E0h] BYREF
char Destination[272]; // [rsp+C0h] [rbp-40h] BYREF
v9 = a5;
*((_QWORD *)a5 + 2) = 0;
if ( *((_QWORD *)a5 + 3) > 0xFu )
v9 = *(_BYTE **)a5;
*v9 = 0;
memset(Destination, 0, 0x104u);
if ( *((_QWORD *)a4 + 3) > 0xFu )
a4 = *(const char **)a4;
strncpy(Destination, a4, 0x103u);
v23.lStructSize = 152;
memset(&v23.lStructSize + 1, 0, 148);
v14 = cocos2d::CCEGLView::sharedOpenGLView(
v11,
v10,
v12,
v13,
*(_QWORD *)&v23.lStructSize,
0,
v23.hInstance,
0,
v23.lpstrCustomFilter,
0,
v23.lpstrFile,
0,
v23.lpstrFileTitle,
0,
v23.lpstrInitialDir,
0,
*(_QWORD *)&v23.Flags,
0,
v23.lCustData);
v23.hwndOwner = (HWND)sub_140675620(*(_QWORD *)(v14 + 200));
v23.lpstrFilter = a2;
v23.lpstrFile = Destination;
v23.nMaxFile = 260;
v23.lpstrTitle = a1;
v23.Flags = 10;
v23.lpstrDefExt = a3;
SaveFileNameA = GetSaveFileNameA(&v23);
v20 = (cocos2d::CCEGLView *)cocos2d::CCEGLView::sharedOpenGLView(
v17,
v16,
v18,
v19,
*(_QWORD *)&v23.lStructSize,
v23.hwndOwner,
v23.hInstance,
v23.lpstrFilter,
v23.lpstrCustomFilter,
*(_QWORD *)&v23.nMaxCustFilter,
v23.lpstrFile,
*(_QWORD *)&v23.nMaxFile,
v23.lpstrFileTitle,
*(_QWORD *)&v23.nMaxFileTitle,
v23.lpstrInitialDir,
v23.lpstrTitle,
*(_QWORD *)&v23.Flags,
v23.lpstrDefExt,
v23.lCustData);
cocos2d::CCEGLView::clearQueuedInput(v20);
if ( !SaveFileNameA )
return 0;
v22 = -1;
do
++v22;
while ( Destination[v22] );
sub_1400405A0((void **)a5, Destination, v22);
return 1;
}