//
// sub_1800E1D90 from 0x1800e1d90 to 0x1800e222c (1180 bytes)
//
// 4 xrefs:
// > sub_1800DB600 @ 0x1800db63c
// > ??> @ 0x18014c8bc
// > ??> @ 0x18014c8cc
// > ??> @ 0x1801c5244
//
// 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:22:37 +0000
//
__int64 sub_1800E1D90()
{
UINT *v0; // r14
__int16 *v1; // r15
CHAR *v2; // r12
int v3; // ebx
UINT v4; // esi
UINT v5; // edi
int v6; // eax
ULONGLONG v7; // rax
ULONGLONG v8; // rax
ULONGLONG v9; // rax
HWND Window; // rax
BYTE KeyState[288]; // [rsp+60h] [rbp-A0h] BYREF
struct tagMSG Msg; // [rsp+180h] [rbp+80h] BYREF
int v14; // [rsp+1B0h] [rbp+B0h]
int v15; // [rsp+1B4h] [rbp+B4h]
int v16; // [rsp+1B8h] [rbp+B8h]
WCHAR pwszBuff[2]; // [rsp+1C0h] [rbp+C0h] BYREF
__int64 v18; // [rsp+1C4h] [rbp+C4h]
__int128 v19; // [rsp+1CCh] [rbp+CCh]
int v20; // [rsp+1DCh] [rbp+DCh]
SystemParametersInfoW(0x2000u, 0, &pvParam, 0);
SystemParametersInfoW(0x2001u, 0, nullptr, 2u);
if ( !(unsigned int)sub_1800E2810() )
return 0;
sub_1800E2530();
memset(KeyState, 0, 0x100u);
memset(&unk_1801B5982, 0, 0x6D1u);
v0 = (UINT *)&KeyState[-864];
v1 = (__int16 *)&unk_1801B5708;
v2 = MultiByteStr;
v3 = 32;
do
{
v4 = *v1;
if ( v4 != -1 )
{
if ( (unsigned int)v3 < 0x140 || (unsigned int)v3 > 0x14E )
{
v5 = MapVirtualKeyW(v4, 1u);
}
else
{
Msg.hwnd = (HWND)0x6100000060LL;
Msg.message = 98;
*(&Msg.message + 1) = 99;
Msg.wParam = 0x6500000064LL;
Msg.lParam = 0x6700000066LL;
Msg.time = 104;
Msg.pt.x = 105;
Msg.pt.y = 110;
*((_DWORD *)&Msg.pt + 2) = 111;
v14 = 106;
v15 = 109;
v16 = 107;
v5 = *v0;
}
v6 = ToUnicode(v5, v4, KeyState, pwszBuff, 16, 0);
if ( v6 == -1 )
v6 = ToUnicode(v5, v4, KeyState, pwszBuff, 16, 0);
if ( v6 >= 1 )
WideCharToMultiByte(0xFDE9u, 0, pwszBuff, 1, v2, 5, nullptr, nullptr);
}
++v3;
v2 += 5;
++v0;
++v1;
}
while ( v3 <= 348 );
*(_DWORD *)KeyState = 284;
*(_QWORD *)&KeyState[4] = 10;
*(_DWORD *)&KeyState[12] = 15063;
memset(&KeyState[16], 0, 0x10Cu);
v7 = VerSetConditionMask(0, 2u, 3u);
v8 = VerSetConditionMask(v7, 1u, 3u);
v9 = VerSetConditionMask(v8, 4u, 3u);
if ( (unsigned int)qword_1801B6140(KeyState, 7, v9) )
{
if ( sub_1800E1CB0(6u, 3u, 0) )
{
qword_1801B6128(2);
}
else if ( sub_1800E1CB0(6u, 0, 0) )
{
qword_1801B60C0();
}
}
else
{
qword_1801B60D8(-4);
}
if ( !(unsigned int)sub_1800D8F60() )
return 0;
Window = CreateWindowExW(
0x300u,
L"GLFW30",
L"GLFW message window",
0x6000000u,
0,
0,
1,
1,
nullptr,
nullptr,
phModule,
nullptr);
hRecipient = Window;
if ( !Window )
{
sub_1800E1AF0(0x10008u, "Win32: Failed to create helper window");
return 0;
}
ShowWindow(Window, 0);
v18 = 5;
v19 = xmmword_180128BD0;
v20 = 0;
wcscpy(pwszBuff, L" ");
Handle = RegisterDeviceNotificationW(hRecipient, pwszBuff, 0);
while ( PeekMessageW(&Msg, hRecipient, 0, 0, 1u) )
{
TranslateMessage(&Msg);
DispatchMessageW(&Msg);
}
sub_1800E39F0();
sub_1800DE460();
sub_1800E3110();
return 1;
}