//
// sub_1800E2320 from 0x1800e2320 to 0x1800e2528 (520 bytes)
//
// 2 xrefs:
// > sub_1800DA0D0 @ 0x1800da2a6
// > ??> @ 0x1801c5274
//
// 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
//
int sub_1800E2320()
{
int result; // eax
UINT *v1; // r14
__int16 *v2; // rbp
CHAR *v3; // r15
int v4; // ebx
UINT v5; // esi
UINT v6; // edi
__int64 v7; // [rsp+0h] [rbp-1C8h] BYREF
int v8; // [rsp+40h] [rbp-188h]
int v9; // [rsp+44h] [rbp-184h]
int v10; // [rsp+48h] [rbp-180h]
int v11; // [rsp+4Ch] [rbp-17Ch]
int v12; // [rsp+50h] [rbp-178h]
int v13; // [rsp+54h] [rbp-174h]
int v14; // [rsp+58h] [rbp-170h]
int v15; // [rsp+5Ch] [rbp-16Ch]
int v16; // [rsp+60h] [rbp-168h]
int v17; // [rsp+64h] [rbp-164h]
int v18; // [rsp+68h] [rbp-160h]
int v19; // [rsp+6Ch] [rbp-15Ch]
int v20; // [rsp+70h] [rbp-158h]
int v21; // [rsp+74h] [rbp-154h]
int v22; // [rsp+78h] [rbp-150h]
WCHAR pwszBuff[16]; // [rsp+80h] [rbp-148h] BYREF
BYTE KeyState[256]; // [rsp+A0h] [rbp-128h] BYREF
memset(KeyState, 0, sizeof(KeyState));
result = (unsigned int)memset(&unk_1801B5982, 0, 0x6D1u);
v1 = (UINT *)(&v7 - 136);
v2 = (__int16 *)&unk_1801B5708;
v3 = MultiByteStr;
v4 = 32;
do
{
v5 = *v2;
if ( v5 != -1 )
{
if ( (unsigned int)v4 < 0x140 || (unsigned int)v4 > 0x14E )
{
v6 = MapVirtualKeyW(v5, 1u);
}
else
{
v8 = 96;
v9 = 97;
v10 = 98;
v11 = 99;
v12 = 100;
v13 = 101;
v14 = 102;
v15 = 103;
v16 = 104;
v17 = 105;
v18 = 110;
v19 = 111;
v20 = 106;
v21 = 109;
v22 = 107;
v6 = *v1;
}
result = ToUnicode(v6, v5, KeyState, pwszBuff, 16, 0);
if ( result == -1 )
result = ToUnicode(v6, v5, KeyState, pwszBuff, 16, 0);
if ( result >= 1 )
result = WideCharToMultiByte(0xFDE9u, 0, pwszBuff, 1, v3, 5, nullptr, nullptr);
}
++v4;
v3 += 5;
++v1;
++v2;
}
while ( v4 <= 348 );
return result;
}