Function at 0x40bec0
Capabilities:
Get keyboard layout

Disassembly:
sub esp, 0x414
push ebx
push ebp
mov ebp, dword [esp + 0x428]
push esi
push edi
mov edi, ecx
mov dword [esp + 0x14], 0
mov byte [esp + 0x13], 0
test ebp, ebp
je 0x40beed
lea eax, [ebp + 0x14]
mov dword [esp + 0x18], eax
jmp 0x40bef5
lea ecx, [esp + 0x1f]
mov dword [esp + 0x18], ecx
cmp byte [esp + 0x42c], 0
jne 0x40bf44
mov ebx, 0x4a45a4
mov eax, edi
call fcn.00409660
mov esi, eax
test esi, esi
je 0x40bf44
mov ecx, esi
movzx eax, word [ecx]
cmp eax, 0x20
je 0x40bf20
cmp eax, 9
jne 0x40bf25
add ecx, 2
jmp 0x40bf13
push 0x4a1d68
push ecx
call fcn.0048db99
add esp, 8
test eax, eax
jne 0x40bf44
test ebp, ebp
je 0x40bf3f
mov byte [ebp + 0x18], 1
xor edx, edx
mov word [esi], dx
push 0
call dword [sym.imp.USER32.dll_GetKeyboardLayout]
movzx edx, word [edi]
test dx, dx
jne 0x40bfbe
xor bl, bl
mov eax, edi
call fcn.004122b0
movzx eax, ax
mov dword [esp + 0x14], eax
test ax, ax
jne 0x40c1ba
push 1
lea ebx, [esp + 0x24]
mov eax, edi
call fcn.0044fcb0
movzx eax, ax
add esp, 4
mov dword [esp + 0x14], eax
test ax, ax
jne 0x40c19e
cmp byte [esp + 0x434], al
je 0x40c13d
mov edx, dword [0x4c8cc4]
push 1
push 0
push 0xffffffffffffffff
push 0x4a4604
push edx
call fcn.004774d0
pop edi
pop esi
pop ebp
xor eax, eax
pop ebx
add esp, 0x414
ret
cmp word [edi + 2], 0
jne 0x40c027
mov ecx, eax
lea esi, [esp + 0x13]
mov eax, edx
call fcn.00412410
mov bl, al
test bl, bl
je 0x40bf56
cmp byte [esp + 0x42c], 0
je 0x40c0de
lea edx, [ebx + 0x64]
cmp dl, 3
ja 0x40c0fa
cmp byte [esp + 0x434], 0
je 0x40c09c
mov eax, dword [0x4c8cc4]
push 1
push 0
push 0xffffffffffffffff
push 0x4a45ac
push eax
call fcn.004774d0
pop edi
pop esi
pop ebp
xor eax, eax
pop ebx
add esp, 0x414
ret
mov esi, edx
test esi, 0xffffff80
jne 0x40c043
push 2
push esi
call fcn.0048edee
add esp, 8
test eax, eax
je 0x40c043
and esi, 0xffffffdf
cmp si, 0x56
jne 0x40c06d
mov ax, word [edi + 2]
call fcn.00409630
cmp ax, 0x4b
jne 0x40c06d
push 0x10
lea eax, [edi + 4]
push 0
push eax
call fcn.0048f1cb
add esp, 0xc
jmp 0x40bfd2
xor esi, esi
nop
mov ecx, dword [esi*8 + 0x4c56f8]
push edi
push ecx
call fcn.0048db99
add esp, 8
test eax, eax
je 0x40c090
inc esi
cmp esi, 0x6d
jl 0x40c070
jmp 0x40bf54
mov bl, byte [esi*8 + 0x4c56fc]
jmp 0x40bfd4
push edi
push 0x4a45b0
mov esi, 0x200
lea edi, [esp + 0x2c]
call fcn.00474720
mov ecx, dword [esp + 0x430]
add esp, 8
push ecx
mov edx, edi
push edx
mov ecx, 0x4ca650
call fcn.0042e420
test ebp, ebp
jne 0x40bfb1
pop edi
pop esi
lea eax, [ebp + 4]
pop ebp
pop ebx
add esp, 0x414
ret
test ebp, ebp
je 0x40c0fa
push 2
push 0x4a45fc
push edi
call fcn.0048e3e7
add esp, 0xc
test eax, eax
sete al
mov byte [ebp + 0x19], al
lea ecx, [ebx - 1]
cmp cl, 5
ja 0x40c107
cmp bl, 3
jne 0x40c10f
lea edx, [ebx + 0x66]
cmp dl, 5
ja 0x40c113
mov al, 1
jmp 0x40c115
xor al, al
mov dl, byte [esp + 0x13]
test dl, 0x30
je 0x40c129
lea ecx, [ebx - 0x41]
cmp cl, 0x19
ja 0x40c129
and dl, 0xcf
test al, al
je 0x40c1be
mov eax, dword [esp + 0x18]
mov byte [eax], 2
jmp 0x40c1be
cmp word [edi + 2], 0
jne 0x40c164
cmp byte [0x4cb11c], 0
jne 0x40c164
mov eax, ebp
neg eax
pop edi
sbb eax, eax
pop esi
and eax, 0xfffffffd
pop ebp
add eax, 3
pop ebx
add esp, 0x414
ret
test ebp, ebp
je 0x40c191
push edi
push 0x4a4608
mov esi, 0x200
lea edi, [esp + 0x2c]
call fcn.00474720
add esp, 8
push 0x4ac0f0
mov eax, edi
push eax
mov ecx, 0x4ca650
call fcn.0042e420
pop edi
pop esi
pop ebp
xor eax, eax
pop ebx
add esp, 0x414
ret
mov ecx, dword [esp + 0x18]
mov ebx, dword [esp + 0x20]
mov eax, 1
add dword [0x4c9ec0], eax
mov byte [ecx], 4
mov byte [ebx + 0x4c9eb0], al
mov dl, byte [esp + 0x13]
cmp byte [esp + 0x42c], 0
je 0x40c1e8
test ebp, ebp
je 0x40c225
mov cx, word [esp + 0x14]
pop edi
pop esi
mov byte [ebp + 0x13], bl
mov word [ebp + 0xa], cx
pop ebp
mov eax, 1
pop ebx
add esp, 0x414
ret
test ebp, ebp
je 0x40c225
mov ax, word [esp + 0x14]
mov word [ebp + 8], ax
mov al, dl
and al, 0xd5
xor ecx, ecx
mov byte [ebp + 0x12], bl
test al, 0xc0
je 0x40c207
mov ecx, 8
test al, 0xc
je 0x40c20e
or ecx, 1
test al, 0x30
je 0x40c215
or ecx, 4
test al, 3
je 0x40c21c
or ecx, 2
or dword [ebp + 0xc], ecx
and dl, 0x2a
or byte [ebp + 0x10], dl
pop edi
pop esi
pop ebp
mov eax, 1
pop ebx
add esp, 0x414
ret