Function at 0x51e5698a
Capabilities:
Get keyboard layout
Identify system language via api

Disassembly:
push ecx
mov eax, dword [0x51e8b69c]
push ebx
mov bl, byte [esp + 0x10]
push esi
mov esi, dword [sym.imp.KERNEL32.dll_GetUserDefaultLangID]
push edi
xor edi, edi
and bl, 0xf
cmp eax, edi
mov dword [esp + 0xc], edi
jne 0x51e569b8
call esi
sub ax, 0x411
neg ax
sbb eax, eax
inc eax
jmp 0x51e569c9
xor ecx, ecx
cmp dword [eax + 0x53ac], 0x411
sete cl
mov eax, ecx
cmp eax, edi
je 0x51e56a02
movzx eax, byte [esp + 0x1c]
sub eax, edi
je 0x51e569fa
dec eax
je 0x51e569f0
dec eax
je 0x51e569e6
dec eax
dec eax
jne 0x51e56a02
mov dword [esp + 0xc], edi
jmp 0x51e56a02
mov dword [esp + 0xc], 0x10008
jmp 0x51e56a02
mov dword [esp + 0xc], 1
jmp 0x51e56a02
mov dword [esp + 0xc], 8
mov eax, dword [0x51e8b69c]
cmp eax, edi
jne 0x51e56a19
call esi
sub ax, 0x804
neg ax
sbb eax, eax
inc eax
jmp 0x51e56a2a
xor ecx, ecx
cmp dword [eax + 0x53ac], 0x804
sete cl
mov eax, ecx
push ebp
cmp eax, edi
mov edi, dword [esp + 0x18]
mov ebp, 0x404
jne 0x51e56a5f
mov eax, dword [0x51e8b69c]
test eax, eax
jne 0x51e56a4e
call esi
sub ax, bp
neg ax
sbb eax, eax
inc eax
jmp 0x51e56a5b
xor ecx, ecx
cmp dword [eax + 0x53ac], ebp
sete cl
mov eax, ecx
test eax, eax
je 0x51e56a99
push 0
call dword [sym.imp.USER32.dll_GetKeyboardLayout]
mov ebp, eax
push ebp
call sub.IMM32.dll_ImmIsIME
test eax, eax
je 0x51e56a79
mov dword [0x51eb3c54], ebp
cmp dword [0x51eb3c70], 0
mov dword [0x51eb3c6c], edi
je 0x51e56aa6
cmp dword [0x51eb3c50], 0
jne 0x51e56a9d
mov dword [0x51eb3c4c], ebp
jmp 0x51e56a9d
mov ebp, dword [esp + 0x1c]
cmp dword [0x51eb3c70], 0
jne 0x51e56b24
cmp dword [0x51eb3c50], 0
je 0x51e56b24
test bl, bl
jne 0x51e56b24
mov eax, dword [0x51e8b69c]
test eax, eax
jne 0x51e56aca
call esi
sub ax, 0x804
neg ax
sbb eax, eax
inc eax
jmp 0x51e56adb
xor ecx, ecx
cmp dword [eax + 0x53ac], 0x804
sete cl
mov eax, ecx
test eax, eax
jne 0x51e56b0b
mov eax, dword [0x51e8b69c]
test eax, eax
jne 0x51e56af6
call esi
sub ax, 0x404
neg ax
sbb eax, eax
inc eax
jmp 0x51e56b07
xor ecx, ecx
cmp dword [eax + 0x53ac], 0x404
sete cl
mov eax, ecx
test eax, eax
je 0x51e56b24
push dword [0x51eb3c4c]
call sub.IMM32.dll_ImmIsIME
test eax, eax
je 0x51e56b24
mov eax, dword [0x51eb3c4c]
mov dword [0x51eb3c54], eax
movzx eax, bl
dec eax
cmp eax, 0xc
mov ecx, 0x412
ja case.0x51e56b36.12
jmp dword [eax*4 + 0x51e5725a]
mov eax, dword [0x51e8b69c]
test eax, eax
jne 0x51e56b59
call esi
sub ax, 0x411
neg ax
mov ecx, 0x412
sbb eax, eax
inc eax
jmp 0x51e56b6a
xor edx, edx
cmp dword [eax + 0x53ac], 0x411
sete dl
mov eax, edx
test eax, eax
je 0x51e56b7d
push 1
push edi
call fcn.51e56703
push 1
jmp 0x51e56c77
mov eax, dword [0x51e8b69c]
test eax, eax
jne 0x51e56b94
call esi
sub ax, 0x412
neg ax
sbb eax, eax
inc eax
jmp 0x51e56ba1
xor edx, edx
cmp dword [eax + 0x53ac], ecx
sete dl
mov eax, edx
test eax, eax
jne 0x51e56cbc
mov eax, dword [0x51e8b69c]
test eax, eax
jne 0x51e56bc0
call esi
sub ax, 0x404
neg ax
sbb eax, eax
inc eax
jmp 0x51e56bd1
xor ecx, ecx
cmp dword [eax + 0x53ac], 0x404
sete cl
mov eax, ecx
test eax, eax
je 0x51e5705e
push 0
push dword [0x51eb3c54]
call dword [sym.imp.USER32.dll_ActivateKeyboardLayout]
cmp dword [0x51eb3c64], 0
je 0x51e56c30
cmp bl, 0xd
jne 0x51e56c30
push dword [esp + 0x10]
push 0x81
jmp 0x51e56c36
xor ecx, ecx
cmp dword [eax + 0x53ac], 0x804
sete cl
mov eax, ecx
test eax, eax
je 0x51e570e8
push ebp
call sub.IMM32.dll_ImmIsIME
test eax, eax
jne 0x51e56c30
push eax
push dword [0x51eb3c54]
call dword [sym.imp.USER32.dll_ActivateKeyboardLayout]
push dword [esp + 0x10]
push 1
push edi
call fcn.51e56070
jmp 0x51e570e8
mov eax, dword [0x51e8b69c]
test eax, eax
jne 0x51e56c58
call esi
sub ax, 0x411
neg ax
sbb eax, eax
inc eax
jmp 0x51e56c69
xor ecx, ecx
cmp dword [eax + 0x53ac], 0x411
sete cl
mov eax, ecx
test eax, eax
je 0x51e56c8c
push 1
push edi
call fcn.51e56703
push 0
push edi
call fcn.51e56007
push dword [esp + 0x10]
push edi
call fcn.51e561e2
jmp 0x51e570e8
mov eax, dword [0x51e8b69c]
test eax, eax
jne 0x51e56ca3
call esi
sub ax, 0x412
neg ax
sbb eax, eax
inc eax
jmp 0x51e56cb4
xor ecx, ecx
cmp dword [eax + 0x53ac], 0x412
sete cl
mov eax, ecx
test eax, eax
je 0x51e56f4b
push 1
push edi
call fcn.51e56703
jmp 0x51e570e0
xor ecx, ecx
cmp dword [eax + 0x53ac], 0x804
sete cl
mov eax, ecx
test eax, eax
jne 0x51e56f82
mov eax, dword [0x51e8b69c]
test eax, eax
jne 0x51e56f69
call esi
sub ax, 0x404
neg ax
sbb eax, eax
inc eax
jmp 0x51e56f7a
push 0
push edi
call fcn.51e56703
jmp 0x51e56c7d
mov eax, dword [0x51e8b69c]
test eax, eax
jne 0x51e56d24
call esi
sub ax, 0x411
neg ax
sbb eax, eax
inc eax
jmp 0x51e56d35
xor ecx, ecx
cmp dword [eax + 0x53ac], 0x411
sete cl
mov eax, ecx
test eax, eax
je 0x51e570e8
push 1
push edi
call fcn.51e56703
push 1
push edi
call fcn.51e56007
push dword [esp + 0x10]
push 3
jmp 0x51e56c36
mov eax, dword [0x51e8b69c]
test eax, eax
jne 0x51e56d6f
call esi
sub ax, 0x411
neg ax
sbb eax, eax
inc eax
jmp 0x51e56d80
xor ecx, ecx
cmp dword [eax + 0x53ac], 0x411
sete cl
mov eax, ecx
test eax, eax
je 0x51e570e8
push 1
push edi
call fcn.51e56703
push 1
push edi
call fcn.51e56007
push dword [esp + 0x10]
push 0xb
jmp 0x51e56c36
mov eax, dword [0x51e8b69c]
test eax, eax
jne 0x51e56db7
call esi
sub ax, 0x411
jmp 0x51e56ffa
xor ecx, ecx
cmp dword [eax + 0x53ac], 0x411
sete cl
mov eax, ecx
test eax, eax
je 0x51e570e8
push 1
push edi
call fcn.51e56703
push 1
push edi
call fcn.51e56007
push dword [esp + 0x10]
push 9
jmp 0x51e56c36
mov eax, dword [0x51e8b69c]
test eax, eax
jne 0x51e56e02
call esi
sub ax, 0x411
neg ax
sbb eax, eax
inc eax
jmp 0x51e56e13
xor ecx, ecx
cmp dword [eax + 0x53ac], 0x411
sete cl
mov eax, ecx
test eax, eax
jne 0x51e56ed8
mov eax, dword [0x51e8b69c]
test eax, eax
jne 0x51e56e32
call esi
sub ax, 0x412
neg ax
sbb eax, eax
inc eax
jmp 0x51e56e43
xor ecx, ecx
cmp dword [eax + 0x53ac], 0x412
sete cl
mov eax, ecx
test eax, eax
jne 0x51e56ed8
mov eax, dword [0x51e8b69c]
test eax, eax
jne 0x51e56e62
call esi
sub ax, 0x804
neg ax
sbb eax, eax
inc eax
jmp 0x51e56e73
xor ecx, ecx
cmp dword [eax + 0x53ac], 0x804
sete cl
mov eax, ecx
test eax, eax
jne 0x51e56ea7
mov eax, dword [0x51e8b69c]
test eax, eax
jne 0x51e56e8e
call esi
sub ax, 0x404
neg ax
sbb eax, eax
inc eax
jmp 0x51e56e9f
xor ecx, ecx
cmp dword [eax + 0x53ac], 0x404
sete cl
mov eax, ecx
test eax, eax
je 0x51e570e8
xor ebx, ebx
push ebx
push dword [0x51eb3c54]
call dword [sym.imp.USER32.dll_ActivateKeyboardLayout]
cmp dword [0x51eb3c64], ebx
je 0x51e56ee8
push dword [esp + 0x10]
mov dword [0x51eb3c64], ebx
inc ebx
push ebx
push edi
call fcn.51e56070
mov dword [0x51eb3c64], ebx
jmp 0x51e56ee8
push 1
push edi
call fcn.51e56703
push 1
push edi
call fcn.51e56007
push dword [esp + 0x10]
push 8
jmp 0x51e56c36
mov eax, dword [0x51e8b69c]
test eax, eax
jne 0x51e56f0a
call esi
sub ax, 0x411
neg ax
sbb eax, eax
inc eax
jmp 0x51e56f1b
xor ecx, ecx
cmp dword [eax + 0x53ac], 0x411
sete cl
mov eax, ecx
test eax, eax
jne 0x51e56f8f
mov eax, dword [0x51e8b69c]
test eax, eax
jne 0x51e56f36
call esi
sub ax, 0x412
neg ax
sbb eax, eax
inc eax
jmp 0x51e56f47
xor ecx, ecx
cmp dword [eax + 0x53ac], 0x412
sete cl
mov eax, ecx
test eax, eax
jne 0x51e56f8f
mov eax, dword [0x51e8b69c]
test eax, eax
jne 0x51e56cc9
call esi
sub ax, 0x804
neg ax
sbb eax, eax
inc eax
jmp 0x51e56cda
xor ecx, ecx
cmp dword [eax + 0x53ac], 0x404
sete cl
mov eax, ecx
test eax, eax
je 0x51e570e8
push 0
push dword [0x51eb3c58]
jmp 0x51e56c2a
push 1
push edi
call fcn.51e56703
push 1
push edi
call fcn.51e56007
push dword [esp + 0x10]
push 0
jmp 0x51e56c36
mov eax, dword [0x51e8b69c]
test eax, eax
jne 0x51e56fc1
call esi
sub ax, 0x412
neg ax
sbb eax, eax
inc eax
jmp 0x51e56fce
xor edx, edx
cmp dword [eax + 0x53ac], ecx
sete dl
mov eax, edx
test eax, eax
je 0x51e570e8
push 1
push edi
call fcn.51e56703
push 1
push edi
call fcn.51e56007
jmp 0x51e56c30
mov eax, dword [0x51e8b69c]
test eax, eax
jne 0x51e57005
call esi
sub ax, 0x412
neg ax
sbb eax, eax
inc eax
jmp 0x51e56dc8
xor edx, edx
cmp dword [eax + 0x53ac], ecx
sete dl
mov eax, edx
jmp 0x51e56dc8
mov eax, dword [0x51e8b69c]
test eax, eax
jne 0x51e5702e
call esi
sub ax, 0x412
neg ax
sbb eax, eax
inc eax
jmp 0x51e5703b
xor edx, edx
cmp dword [eax + 0x53ac], ecx
sete dl
mov eax, edx
test eax, eax
je 0x51e570e8
push 1
push edi
call fcn.51e56703
push 1
push edi
call fcn.51e56007
push dword [esp + 0x10]
push 0x40
jmp 0x51e56c36
mov eax, dword [0x51e8b69c]
test eax, eax
jne 0x51e56c00
call esi
sub ax, 0x804
neg ax
sbb eax, eax
inc eax
jmp 0x51e56c11
push 1
push edi
call fcn.51e56703
mov eax, dword [0x51e8b69c]
test eax, eax
jne 0x51e5709b
call esi
sub ax, 0x411
neg ax
sbb eax, eax
inc eax
jmp 0x51e570ac
xor ecx, ecx
cmp dword [eax + 0x53ac], 0x411
sete cl
mov eax, ecx
test eax, eax
jne 0x51e56c7d
mov eax, dword [0x51e8b69c]
test eax, eax
jne 0x51e570cb
call esi
sub ax, 0x412
neg ax
sbb eax, eax
inc eax
jmp 0x51e570dc
xor ecx, ecx
cmp dword [eax + 0x53ac], 0x412
sete cl
mov eax, ecx
test eax, eax
je 0x51e570e8
push 1
push edi
call fcn.51e56007
xor ebx, ebx
cmp byte [esp + 0x1c], bl
pop ebp
jne 0x51e57199
mov eax, dword [0x51e8b69c]
cmp eax, ebx
jne 0x51e5710c
call esi
sub ax, 0x411
neg ax
sbb eax, eax
inc eax
jmp 0x51e5711d
xor ecx, ecx
cmp dword [eax + 0x53ac], 0x411
sete cl
mov eax, ecx
cmp eax, ebx
jne 0x51e57169
mov eax, dword [0x51e8b69c]
cmp eax, ebx
jne 0x51e57138
call esi
sub ax, 0x412
neg ax
sbb eax, eax
inc eax
jmp 0x51e57149
xor ecx, ecx
cmp dword [eax + 0x53ac], 0x412
sete cl
mov eax, ecx
cmp eax, ebx
jne 0x51e57169
cmp dword [0x51eb3c70], ebx
jne 0x51e57210
push edi
call fcn.51e56544
mov dword [0x51eb3c44], eax
jmp 0x51e57204
cmp dword [0x51eb3c70], ebx
jne 0x51e57210
mov eax, dword [0x51eb3c44]
mov ecx, 0x8000
test ecx, eax
jne 0x51e5718c
and eax, 0xffffbfff
or eax, ecx
jmp 0x51e57192
push edi
call fcn.51e56544
mov dword [0x51eb3c44], eax
jmp 0x51e57210
cmp dword [0x51eb3c70], ebx
jne 0x51e57210
push edi
call fcn.51e56544
mov dword [0x51eb3c44], eax
mov eax, dword [0x51e8b69c]
cmp eax, ebx
jne 0x51e571c3
call esi
sub ax, 0x804
neg ax
sbb eax, eax
inc eax
jmp 0x51e571d4
xor ecx, ecx
cmp dword [eax + 0x53ac], 0x804
sete cl
mov eax, ecx
cmp eax, ebx
jne 0x51e57204
mov eax, dword [0x51e8b69c]
cmp eax, ebx
jne 0x51e571ef
call esi
sub ax, 0x404
neg ax
sbb eax, eax
inc eax
jmp 0x51e57200
xor ecx, ecx
cmp dword [eax + 0x53ac], 0x404
sete cl
mov eax, ecx
cmp eax, ebx
je 0x51e57210
push ebx
call dword [sym.imp.USER32.dll_GetKeyboardLayout]
mov dword [0x51eb3c4c], eax
mov eax, dword [0x51e8b69c]
cmp eax, ebx
jne 0x51e57227
call esi
sub ax, 0x412
neg ax
sbb eax, eax
inc eax
jmp 0x51e57238
xor ecx, ecx
cmp dword [eax + 0x53ac], 0x412
sete cl
mov eax, ecx
cmp eax, ebx
jne 0x51e57253
test byte [esp + 0x18], 0x10
je 0x51e5724d
push 1
push edi
call fcn.51e5639c
jmp 0x51e57253
push edi
call fcn.51e56766
pop edi
pop esi
pop ebx
pop ecx
ret 0xc