//
// CWin32InputBox::InputBox from 0x18001e120 to 0x18001e2e5 (453 bytes)
//
// 3 xrefs:
// > cocos2d::extension::CCEditBoxImplWin::openKeyboard @ 0x180011f6d
// > ??> @ 0x18002fdf8
// > ??> @ 0x18004b0e8
//
// This function is hookable on this platform!
//
// Using BromaIDA 8.0.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit ba9f177b at Thu Jul 16 22:52:06 2026 from https://github.com/geode-sdk/bindings
//
INT_PTR __fastcall CWin32InputBox::InputBox(const char *a1, const char *a2, char *a3, int a4, bool a5)
{
int v10; // eax
int v11; // eax
LPARAM dwInitParam[2]; // [rsp+30h] [rbp-49h] BYREF
bool v13; // [rsp+40h] [rbp-39h] BYREF
void *v14; // [rsp+48h] [rbp-31h]
__int64 v15; // [rsp+50h] [rbp-29h]
char v16; // [rsp+58h] [rbp-21h]
int v17; // [rsp+5Ch] [rbp-1Dh]
int v18; // [rsp+60h] [rbp-19h]
int v19; // [rsp+64h] [rbp-15h]
int v20; // [rsp+68h] [rbp-11h]
const char *v21; // [rsp+70h] [rbp-9h]
const char *v22; // [rsp+78h] [rbp-1h]
char *v23; // [rsp+80h] [rbp+7h]
int v24; // [rsp+88h] [rbp+Fh]
HWND hWndParent; // [rsp+90h] [rbp+17h]
HINSTANCE hInstance; // [rsp+98h] [rbp+1Fh]
int v27; // [rsp+A0h] [rbp+27h]
hWndParent = nullptr;
v15 = 0;
v16 = 1;
hInstance = GetModuleHandleW(nullptr);
v13 = a5;
v14 = &unk_1800470A4;
v17 = 0;
v19 = 0;
v18 = -1;
v20 = -1;
v27 = -1;
v21 = a1;
v22 = a2;
v23 = a3;
v24 = a4;
if ( a3 )
{
if ( unk_1800470A4 == 1 && unk_1800470A6 == 0xFFFF && &unk_1800470A4 )
{
unk_1800470AC &= v20;
v10 = v18 & (dword_1800470B0[0] | v17);
dword_1800470B0[0] = v10;
dword_1800470B0[0] = v10 | 0x800;
if ( (_WORD)v27 != 0xFFFF )
HIWORD(dword_1800470B0[1]) = v27;
if ( HIWORD(v27) != 0xFFFF )
LOWORD(dword_1800470B0[2]) = HIWORD(v27);
}
else
{
unk_1800470A4 |= v17;
unk_1800470A8 &= v20;
v11 = v18 & unk_1800470A4;
unk_1800470A4 &= v18;
unk_1800470A4 = v11 | 0x800;
if ( (_WORD)v27 != 0xFFFF )
unk_1800470AE = v27;
if ( HIWORD(v27) != 0xFFFF )
LOWORD(dword_1800470B0[0]) = HIWORD(v27);
}
dwInitParam[0] = (LPARAM)&v13;
return DialogBoxIndirectParamW(
hInstance,
(LPCDLGTEMPLATEW)&unk_1800470A4,
hWndParent,
CWin32InputBox::DlgProc,
(LPARAM)dwInitParam);
}
else
{
SetLastError(0x57u);
return 0;
}
}