Function at 0x40a3bc
Capabilities:
Get keyboard layout

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x170
push esi
movzx eax, byte [ebp + 0x34]
test eax, eax
je 0x40a59f
mov eax, dword [ebp + 0x10]
mov dword [ebp - 0xec], eax
lea eax, [ebp + 0x14]
mov dword [ebp - 0x134], eax
mov eax, dword [ebp + 0x3c]
mov dword [ebp - 0x7c], eax
lea eax, [ebp + 0x2c]
mov dword [ebp - 0xbc], eax
mov eax, dword [ebp + 0x38]
mov dword [ebp - 0xf4], eax
mov eax, dword [ebp + 0x24]
mov dword [ebp - 0x84], eax
mov eax, dword [ebp + 0x4c]
mov dword [ebp - 0x6c], eax
mov eax, dword [ebp + 0x30]
mov dword [ebp - 0x8c], eax
mov eax, dword [ebp + 0x44]
mov dword [ebp - 0xfc], eax
mov eax, dword [ebp - 0xbc]
movzx eax, byte [eax]
test eax, eax
je 0x40a45e
mov eax, dword [ebp - 0xec]
mov dword [ebp - 0x15c], eax
mov eax, dword [ebp - 0x6c]
mov dword [ebp - 0x74], eax
push 0x1ed
push dword [ebp - 0x15c]
push 0x5e51
push 0
push dword [ebp - 0x74]
call fcn.004202bf
add esp, 0x14
jmp 0x40a59a
mov eax, dword [ebp - 0xf4]
mov dword [ebp - 0x60], eax
mov eax, dword [ebp - 0x7c]
mov dword [ebp - 0x94], eax
mov eax, dword [ebp - 0x134]
mov dword [ebp - 0x158], eax
mov eax, dword [ebp - 0x84]
mov dword [ebp - 0x9c], eax
mov eax, dword [ebp - 0xfc]
mov dword [ebp - 0x104], eax
mov eax, dword [ebp - 0x8c]
mov dword [ebp - 0x114], eax
mov eax, dword [ebp - 0x158]
movzx eax, byte [eax]
test eax, eax
je 0x40a55a
mov eax, dword [ebp - 0x94]
mov dword [ebp - 0x13c], eax
mov eax, dword [ebp - 0x104]
mov dword [ebp - 0xa4], eax
mov eax, dword [ebp - 0x9c]
mov dword [ebp - 0x10c], eax
mov eax, dword [ebp - 0x13c]
mov dword [ebp - 0xb4], eax
mov eax, dword [ebp - 0xa4]
mov dword [ebp - 0x40], eax
mov eax, dword [ebp - 0x10c]
mov dword [ebp - 0xac], eax
mov eax, dword [ebp - 0x40]
cmp dword [eax], 7
jbe 0x40a507
mov dword [ebp - 0x48], 1
jmp 0x40a50b
and dword [ebp - 0x48], 0
mov eax, dword [ebp - 0xac]
mov eax, dword [eax]
cmp eax, dword [ebp - 0x48]
jl 0x40a521
mov dword [ebp - 0x20], 1
jmp 0x40a525
and dword [ebp - 0x20], 0
cmp dword [ebp - 0x20], 0xa67f6a19
je 0x40a53a
mov dword [ebp - 0x150], 1
jmp 0x40a541
and dword [ebp - 0x150], 0
mov eax, dword [ebp - 0x40]
mov eax, dword [eax]
mov dword [ebp - 0x160], eax
mov eax, dword [ebp - 0xb4]
mov dword [eax], 0
jmp 0x40a59a
mov eax, dword [ebp - 0x114]
mov dword [ebp - 0x144], eax
mov eax, dword [ebp - 0x60]
mov dword [ebp - 0xc4], eax
mov eax, dword [ebp - 0x144]
mov dword [ebp - 0x11c], eax
mov eax, dword [ebp - 0xc4]
mov dword [ebp - 0xcc], eax
mov eax, dword [ebp - 0x11c]
mov eax, dword [eax]
mov ecx, dword [ebp - 0xcc]
mov ecx, dword [ecx]
mov dword [eax + 8], ecx
jmp 0x40a9a8
mov eax, dword [ebp + 0x5c]
mov dword [ebp - 0x78], eax
mov eax, dword [ebp + 0x48]
mov dword [ebp - 0x68], eax
mov eax, dword [ebp + 0x18]
mov dword [ebp - 0x64], eax
lea eax, [ebp + 0x20]
mov dword [ebp - 0x70], eax
mov eax, dword [ebp + 8]
mov dword [ebp - 0x12c], eax
mov eax, dword [ebp + 0x1c]
mov dword [ebp - 0xe4], eax
mov eax, dword [ebp + 0x58]
mov dword [ebp - 0x88], eax
mov eax, dword [ebp + 0x50]
mov dword [ebp - 0x80], eax
mov eax, dword [ebp + 0x40]
mov dword [ebp - 0xd4], eax
mov eax, dword [ebp + 0x54]
mov dword [ebp - 0xdc], eax
lea eax, [ebp + 0xc]
mov dword [ebp - 0x154], eax
mov eax, dword [ebp + 0x28]
mov dword [ebp - 0x14c], eax
mov eax, dword [ebp - 0x154]
movzx eax, byte [eax]
test eax, eax
je 0x40a629
mov eax, dword [ebp - 0xd4]
mov dword [ebp - 0x124], eax
push 1
push dword [ebp - 0x124]
call fcn.0040a1f0
pop ecx
pop ecx
jmp 0x40a9a8
mov eax, dword [ebp - 0xdc]
mov dword [ebp - 0xa8], eax
mov eax, dword [ebp - 0x14c]
mov dword [ebp - 0xb8], eax
mov eax, dword [ebp - 0xe4]
mov dword [ebp - 0xc8], eax
mov eax, dword [ebp - 0x12c]
mov dword [ebp - 0xd8], eax
mov eax, dword [ebp - 0x64]
mov dword [ebp - 0xc0], eax
mov eax, dword [ebp - 0x68]
mov dword [ebp - 0x98], eax
mov eax, dword [ebp - 0x70]
mov dword [ebp - 0x90], eax
mov eax, dword [ebp - 0x78]
mov dword [ebp - 0xd0], eax
mov eax, dword [ebp - 0x80]
mov dword [ebp - 0xb0], eax
mov eax, dword [ebp - 0x88]
mov dword [ebp - 0xa0], eax
mov eax, dword [ebp - 0x90]
movzx eax, byte [eax]
test eax, eax
je 0x40a99d
mov eax, dword [ebp - 0x98]
mov dword [ebp - 0xe0], eax
mov eax, dword [ebp - 0xa0]
mov dword [ebp - 0xe8], eax
mov eax, dword [ebp - 0xa8]
mov dword [ebp - 0xf0], eax
mov eax, dword [ebp - 0xb0]
mov dword [ebp - 0xf8], eax
mov eax, dword [ebp - 0xb8]
mov dword [ebp - 0x100], eax
mov eax, dword [ebp - 0xc0]
mov dword [ebp - 0x108], eax
mov eax, dword [ebp - 0xc8]
mov dword [ebp - 0x110], eax
mov eax, dword [ebp - 0xd0]
mov dword [ebp - 0x118], eax
mov eax, dword [ebp - 0xd8]
mov dword [ebp - 0x120], eax
mov eax, dword [ebp - 0xe0]
mov dword [ebp - 8], eax
mov eax, dword [ebp - 0xe8]
mov dword [ebp - 0xc], eax
mov eax, dword [ebp - 0xf0]
mov dword [ebp - 0x10], eax
mov eax, dword [ebp - 0xf8]
mov dword [ebp - 0x18], eax
mov eax, dword [ebp - 0x100]
mov dword [ebp - 0x130], eax
mov eax, dword [ebp - 0x108]
mov dword [ebp - 4], eax
mov eax, dword [ebp - 0x110]
mov dword [ebp - 0x128], eax
mov eax, dword [ebp - 0x118]
mov dword [ebp - 0x140], eax
mov eax, dword [ebp - 0x120]
mov dword [ebp - 0x148], eax
mov eax, dword [ebp - 0x10]
mov eax, dword [eax]
mov dword [ebp - 0x16c], eax
push 0
mov ecx, dword [ebp - 8]
call fcn.00428b0e
mov ecx, dword [ebp - 4]
mov ecx, dword [ecx]
cmp dword [eax], ecx
jg 0x40a793
mov dword [ebp - 0x28], 1
jmp 0x40a797
and dword [ebp - 0x28], 0
mov eax, dword [ebp - 4]
mov eax, dword [eax]
cmp dword [ebp - 0x28], eax
jl 0x40a7aa
mov dword [ebp - 0x50], 1
jmp 0x40a7ae
and dword [ebp - 0x50], 0
mov eax, dword [ebp - 0xc]
mov eax, dword [eax]
add eax, dword [ebp - 0x50]
je 0x40a7d3
push 2
pop eax
test eax, eax
je 0x40a7d3
mov eax, dword [ebp - 0x128]
cmp dword [eax], 0
je 0x40a7d3
mov dword [ebp - 0x14], 1
jmp 0x40a7d7
and dword [ebp - 0x14], 0
mov eax, dword [ebp - 0x130]
mov ecx, dword [ebp - 0x14]
mov dword [eax], ecx
mov eax, dword [ebp - 4]
mov eax, dword [eax]
cmp dword [ebp - 0x14], eax
jle 0x40a7f8
mov dword [ebp - 0x138], 1
jmp 0x40a7ff
and dword [ebp - 0x138], 0
push 0
mov ecx, dword [ebp - 0x18]
call fcn.00428b0e
mov dword [ebp - 0x30], eax
mov eax, dword [ebp - 0x30]
mov eax, dword [eax]
dec eax
mov ecx, dword [ebp - 0x30]
mov dword [ecx], eax
mov eax, dword [ebp - 0x10]
mov eax, dword [eax]
mov dword [ebp - 0x164], eax
mov eax, dword [ebp - 0xc]
mov eax, dword [eax]
mov dword [ebp - 0x168], eax
push 0
mov ecx, dword [ebp - 0x18]
call fcn.00428b0e
mov eax, dword [ebp - 4]
mov eax, dword [eax]
mov dword [ebp - 0x170], eax
push 1
mov ecx, dword [ebp - 8]
call fcn.00428b0e
mov eax, dword [ebp - 4]
cmp dword [eax], 0xfffe
jae 0x40a860
mov dword [ebp - 0x38], 1
jmp 0x40a864
and dword [ebp - 0x38], 0
mov eax, dword [ebp - 4]
mov eax, dword [eax]
cmp dword [ebp - 0x38], eax
jge 0x40a877
mov dword [ebp - 0x58], 1
jmp 0x40a87b
and dword [ebp - 0x58], 0
mov eax, dword [ebp - 0x140]
mov eax, dword [eax]
cmp dword [ebp - 0x58], eax
je 0x40a891
mov dword [ebp - 0x1c], 1
jmp 0x40a895
and dword [ebp - 0x1c], 0
mov eax, dword [ebp - 4]
mov esi, dword [eax]
imul esi, dword [ebp - 0x1c]
push 1
mov ecx, dword [ebp - 8]
call fcn.00428b0e
cmp esi, dword [eax]
jl 0x40a8b5
mov dword [ebp - 0x24], 1
jmp 0x40a8b9
and dword [ebp - 0x24], 0
mov eax, dword [ebp - 0xc]
mov eax, dword [eax]
cmp dword [ebp - 0x24], eax
jne 0x40a8cc
mov dword [ebp - 0x2c], 1
jmp 0x40a8d0
and dword [ebp - 0x2c], 0
mov eax, dword [ebp - 0xc]
mov eax, dword [eax]
cmp dword [ebp - 0x2c], eax
jge 0x40a8e3
mov dword [ebp - 0x34], 1
jmp 0x40a8e7
and dword [ebp - 0x34], 0
push 1
mov ecx, dword [ebp - 8]
call fcn.00428b0e
mov ecx, dword [ebp - 0x34]
cmp ecx, dword [eax]
jle 0x40a901
mov dword [ebp - 0x3c], 1
jmp 0x40a905
and dword [ebp - 0x3c], 0
mov eax, dword [ebp - 0x3c]
add eax, 0x20b45845
je 0x40a918
mov eax, dword [ebp - 0x148]
cmp dword [eax], 0
mov eax, dword [ebp - 0x10]
mov esi, dword [eax]
push 1
mov ecx, dword [ebp - 8]
call fcn.00428b0e
cmp esi, dword [eax]
je 0x40a934
mov dword [ebp - 0x44], 1
jmp 0x40a938
and dword [ebp - 0x44], 0
mov eax, dword [ebp - 0xc]
mov eax, dword [eax]
cmp eax, dword [ebp - 0x44]
jge 0x40a94b
mov dword [ebp - 0x4c], 1
jmp 0x40a94f
and dword [ebp - 0x4c], 0
mov eax, dword [ebp - 0x10]
mov ecx, dword [ebp - 0x4c]
sub ecx, dword [eax]
jne 0x40a96e
push 1
mov ecx, dword [ebp - 8]
call fcn.00428b0e
cmp dword [eax], 0
jne 0x40a96e
and dword [ebp - 0x54], 0
jmp 0x40a975
mov dword [ebp - 0x54], 1
mov eax, dword [ebp - 0xc]
mov eax, dword [eax]
cmp eax, dword [ebp - 0x54]
jge 0x40a988
mov dword [ebp - 0x5c], 1
jmp 0x40a98c
and dword [ebp - 0x5c], 0
push 1
mov ecx, dword [ebp - 8]
call fcn.00428b0e
mov ecx, dword [ebp - 0x5c]
mov dword [eax], ecx
jmp 0x40a9a8
push 0x1fee
call dword [sym.imp.USER32.dll_GetKeyboardLayout]
pop esi
mov esp, ebp
pop ebp
ret