Function at 0x51e09238
Capabilities:
Get keyboard layout

Disassembly:
mov eax, 0x51e7e628
call fcn.51e038b0
push ecx
push ebx
push esi
push edi
mov edi, dword [0x51e8c348]
mov dword [ebp - 0x10], esp
push 0x59
pop ecx
push dword [0x51e8c34c]
xor eax, eax
push 0x66
pop esi
xor ebx, ebx
push esi
rep stosd dword es:[edi], eax
mov dword [ebp - 4], ebx
call fcn.51e0315e
push dword [0x51e8c34c]
mov ecx, dword [0x51e8c344]
push esi
mov dword [ecx], eax
call fcn.51e0315e
push dword [0x51e8c34c]
mov ecx, dword [0x51e8c348]
push esi
mov dword [ecx + 0x90], eax
call fcn.51e0315e
push dword [0x51e8c34c]
mov ecx, dword [0x51e8c348]
push esi
mov dword [ecx + 0xdc], eax
call fcn.51e0315e
mov ecx, dword [0x51e8c348]
push 0xc
push eax
mov dword [ecx + 0xec], eax
call fcn.51e02f4d
push 2
pop esi
push esi
push dword [0x51e8c344]
call fcn.51e0226d
mov eax, dword [0x51e8c348]
add eax, 0x90
push esi
push eax
call fcn.51e0226d
mov eax, dword [ebp + 8]
mov ecx, dword [0x51e8c348]
mov dword [ecx], eax
mov eax, dword [ebp + 0x10]
add esp, 0x38
xor edx, edx
test al, 0x14
jne 0x51e2b7bc
mov edi, dword [ecx + 8]
xor edi, edx
mov edx, eax
and edx, 0x20
and eax, 1
shl edx, 2
or edx, eax
and edi, 1
xor dword [ecx + 8], edi
mov eax, dword [ecx + 8]
and eax, 0xffffefdf
shl edx, 5
or edx, eax
mov eax, dword [0x51e8b840]
imul eax, eax, 0xf780
mov dword [ecx + 8], edx
cdq
mov edi, 0x5a0
idiv edi
push ebx
push 1
push ebx
push dword [0x51e8c344]
inc eax
sar eax, 1
mov dword [ecx + 0x14], eax
call fcn.51e039e6
mov ecx, dword [ebp + 0xc]
mov byte [eax], bl
mov eax, dword [0x51e8c348]
mov dword [eax + 4], ecx
mov edx, dword [eax + 8]
and edx, 0xfffff7ff
or edx, 0x400
mov dword [eax + 8], edx
push ecx
mov dword [eax + 0x24], 0xfa00
call fcn.51e02f40
add esp, 0x14
push ebx
push ebx
push ebx
push ebx
call dword [sym.imp.GDI32.dll_CreateRectRgn]
cmp eax, ebx
mov ecx, dword [0x51e8c348]
mov dword [ecx + 0x70], eax
je 0x51e2b7c2
push ebx
push esi
call fcn.51e18609
pop ecx
pop ecx
push dword [0x51e8bbc8]
call fcn.51e1830f
pop ecx
push ebx
push dword [ebp + 0x14]
call fcn.51e17d55
pop ecx
pop ecx
mov ecx, dword [0x51e8c348]
cmp byte [ecx + 0x118], bl
jne 0x51e2b7cc
mov eax, dword [ecx + 0xc]
mov eax, dword [eax + 8]
cdq
xor eax, edx
sub eax, edx
add eax, dword [ecx + 0x98]
mov dword [ecx + 0xa0], eax
mov eax, dword [ecx + 0x9c]
add eax, dword [ecx + 0x10]
push ebx
mov dword [ecx + 0xa4], eax
call dword [sym.imp.USER32.dll_GetKeyboardLayout]
movzx ecx, ax
mov eax, dword [0x51e8b69c]
mov dword [eax + 0x53ac], ecx
cmp dword [eax + 0x53b8], ebx
jne 0x51e2b7f1
mov ecx, dword [eax + 0x53ac]
cmp ecx, 0x411
je 0x51e09461
cmp ecx, 0x404
je 0x51e09461
cmp ecx, 0x412
je 0x51e09461
cmp ecx, 0x804
je 0x51e09461
xor ecx, ecx
mov dword [eax + 0x53bc], ecx
call fcn.51e02ed9
cmp dword [0x51e8c26c], ebx
jne 0x51e2b81a
xor eax, eax
inc eax
mov ecx, dword [ebp - 0xc]
pop edi
pop esi
mov dword fs:[0], ecx
pop ebx
leave
ret
xor ecx, ecx
inc ecx
jmp 0x51e09438
inc edx
jmp 0x51e092fd
push 0x7d1
call fcn.51e0d896
mov eax, dword [ecx + 0x98]
add eax, dword [ecx + 0x10]
mov dword [ecx + 0xa0], eax
mov eax, dword [ecx + 0xc]
mov eax, dword [eax + 8]
cdq
xor eax, edx
sub eax, edx
add eax, dword [ecx + 0x9c]
jmp 0x51e093e9
cmp dword [0x51e8b568], esi
je 0x51e09410
cmp ecx, 0x409
jne 0x51e09410
mov ecx, dword [eax + 0x53a8]
mov dword [eax + 0x53ac], ecx
jmp 0x51e09410
mov eax, dword [0x51e8c348]
mov ecx, dword [0x51eb7918]
mov byte [eax + 0x152], 0x63
mov dword [eax + 0x154], ecx
mov dword [eax + 0x158], ebx
jmp 0x51e0944f