Function at 0x40c500
Capabilities:
Get keyboard layout

Disassembly:
sub esp, 0x210
push ebx
push ebp
mov ebp, dword [esp + 0x224]
push esi
push edi
mov esi, ecx
mov dword [esp + 0x14], 0
mov byte [esp + 0x12], 0
test ebp, ebp
je 0x40c52d
lea eax, [ebp + 0x12]
mov dword [esp + 0x18], eax
jmp 0x40c535
lea ecx, [esp + 0x13]
mov dword [esp + 0x18], ecx
cmp byte [esp + 0x228], 0
jne 0x40c57d
mov edi, 0x49d1bc
mov eax, esi
call fcn.00409bf0
mov edi, eax
test edi, edi
je 0x40c57d
mov ecx, edi
mov al, byte [ecx]
cmp al, 0x20
je 0x40c55d
cmp al, 9
jne 0x40c560
inc ecx
jmp 0x40c553
push 0x49bbd4
push ecx
call fcn.00487c11
add esp, 8
test eax, eax
jne 0x40c57d
test ebp, ebp
je 0x40c57a
mov byte [ebp + 0x16], 1
mov byte [edi], 0
push 0
call dword [sym.imp.USER32.dll_GetKeyboardLayout]
push eax
lea edx, [esp + 0x16]
push 1
push edx
mov eax, esi
call fcn.00413d30
mov bl, al
add esp, 0xc
mov byte [esp + 0x13], bl
test bl, bl
je 0x40c6b0
cmp byte [esp + 0x228], 0
je 0x40c62a
lea eax, [ebx + 0x64]
cmp al, 3
ja 0x40c646
cmp byte [esp + 0x230], 0
je 0x40c5e8
mov ecx, dword [0x4aea5c]
push 1
push 0
push 0xffffffffffffffff
push 0x49d1c0
push ecx
call fcn.00477990
pop edi
pop esi
pop ebp
xor eax, eax
pop ebx
add esp, 0x210
ret
push esi
push str.__s__is_not_allowed_as_a_prefix_key.
mov esi, 0x200
lea edi, [esp + 0x28]
call fcn.004749f0
mov edx, dword [esp + 0x22c]
add esp, 8
push edx
mov eax, edi
push eax
mov ecx, 0x4af210
call fcn.0042fe10
test ebp, ebp
jne 0x40c705
pop edi
pop esi
lea eax, [ebp + 4]
pop ebp
pop ebx
add esp, 0x210
ret
test ebp, ebp
je 0x40c646
push 2
push 0x49d1ec
push esi
call fcn.00487fcd
add esp, 0xc
test eax, eax
sete cl
mov byte [ebp + 0x17], cl
lea edx, [ebx - 1]
cmp dl, 5
ja 0x40c653
cmp bl, 3
jne 0x40c65a
lea eax, [ebx + 0x66]
cmp al, 5
ja 0x40c65e
mov al, 1
jmp 0x40c660
xor al, al
mov dl, byte [esp + 0x12]
test dl, 0x30
je 0x40c674
lea ecx, [ebx - 0x41]
cmp cl, 0x19
ja 0x40c674
and dl, 0xcf
test al, al
je 0x40c67f
mov eax, dword [esp + 0x18]
mov byte [eax], 2
mov edi, dword [esp + 0x14]
cmp byte [esp + 0x228], 0
je 0x40c7a6
test ebp, ebp
je 0x40c7de
mov word [ebp + 0xa], di
pop edi
pop esi
mov byte [ebp + 0x11], bl
pop ebp
mov eax, 1
pop ebx
add esp, 0x210
ret
xor ebx, ebx
mov eax, esi
call fcn.00413c80
movzx edi, ax
test di, di
jne 0x40c799
push 1
lea ebx, [esp + 0x20]
mov eax, esi
call fcn.0044fae0
movzx eax, ax
add esp, 4
mov dword [esp + 0x14], eax
test ax, ax
jne 0x40c772
cmp byte [esp + 0x230], al
je 0x40c712
mov edx, dword [0x4aea5c]
push 1
push 0
push 0xffffffffffffffff
push 0x49d1f0
push edx
call fcn.00477990
pop edi
pop esi
pop ebp
xor eax, eax
pop ebx
add esp, 0x210
ret
cmp byte [esi + 1], 0
jne 0x40c738
cmp byte [0x4af82c], 0
jne 0x40c738
mov eax, ebp
neg eax
pop edi
sbb eax, eax
pop esi
and eax, 0xfffffffd
pop ebp
add eax, 3
pop ebx
add esp, 0x210
ret
test ebp, ebp
je 0x40c765
push esi
push str.__s__is_not_a_valid_key_name.
mov esi, 0x200
lea edi, [esp + 0x28]
call fcn.004749f0
add esp, 8
push 0x49b8bd
mov eax, edi
push eax
mov ecx, 0x4af210
call fcn.0042fe10
pop edi
pop esi
pop ebp
xor eax, eax
pop ebx
add esp, 0x210
ret
mov edx, dword [esp + 0x18]
mov eax, dword [esp + 0x1c]
mov ecx, 1
add dword [0x4aeac4], ecx
mov byte [edx], 4
mov dl, byte [esp + 0x12]
mov byte [eax + 0x4aeab4], cl
mov bl, al
jmp 0x40c67f
mov dl, byte [esp + 0x12]
mov bl, byte [esp + 0x13]
jmp 0x40c683
test ebp, ebp
je 0x40c7de
mov al, dl
and al, 0xd5
xor ecx, ecx
mov byte [ebp + 0x10], bl
mov word [ebp + 8], di
test al, 0xc0
je 0x40c7c0
mov ecx, 8
test al, 0xc
je 0x40c7c7
or ecx, 1
test al, 0x30
je 0x40c7ce
or ecx, 4
test al, 3
je 0x40c7d5
or ecx, 2
or dword [ebp], ecx
and dl, 0x2a
or byte [ebp + 0xe], dl
pop edi
pop esi
pop ebp
mov eax, 1
pop ebx
add esp, 0x210
ret