Function at 0x40bf50
Capabilities:
Get keyboard layout

Disassembly:
sub esp, 0x410
push ebx
push ebp
mov ebp, dword [esp + 0x424]
push esi
push edi
xor edi, edi
mov esi, ecx
mov byte [esp + 0x13], 0
test ebp, ebp
je 0x40bf77
lea eax, [ebp + 0x14]
mov dword [esp + 0x14], eax
jmp 0x40bf7f
lea ecx, [esp + 0x1b]
mov dword [esp + 0x14], ecx
cmp byte [esp + 0x428], 0
jne 0x40bfd1
mov ebx, 0x4a36ac
mov eax, esi
call fcn.004096a0
mov ebx, eax
test ebx, ebx
je 0x40bfd1
mov ecx, ebx
lea ecx, [ecx]
movzx eax, word [ecx]
cmp eax, 0x20
je 0x40bfad
cmp eax, 9
jne 0x40bfb2
add ecx, 2
jmp 0x40bfa0
push 0x4a0db4
push ecx
call fcn.0048d309
add esp, 8
test eax, eax
jne 0x40bfd1
test ebp, ebp
je 0x40bfcc
mov byte [ebp + 0x18], 1
xor edx, edx
mov word [ebx], dx
push 0
call dword [sym.imp.USER32.dll_GetKeyboardLayout]
push 1
mov ecx, eax
push 1
lea edx, [esp + 0x1b]
mov eax, esi
call fcn.004122f0
mov bl, al
add esp, 8
test bl, bl
je 0x40c0da
cmp byte [esp + 0x428], 0
je 0x40c07c
lea eax, [ebx + 0x64]
cmp al, 3
ja 0x40c098
cmp byte [esp + 0x430], 0
je 0x40c03a
mov ecx, dword [0x4c7ca4]
push 1
push 0
push 0xffffffffffffffff
push 0x4a36b4
push ecx
call fcn.00476c40
pop edi
pop esi
pop ebp
xor eax, eax
pop ebx
add esp, 0x410
ret
push esi
push 0x4a36b8
mov esi, 0x200
lea edi, [esp + 0x28]
call fcn.00473e90
mov edx, dword [esp + 0x42c]
add esp, 8
push edx
mov eax, edi
push eax
mov ecx, 0x4c9630
call fcn.0042e370
test ebp, ebp
jne 0x40c12a
pop edi
pop esi
lea eax, [ebp + 4]
pop ebp
pop ebx
add esp, 0x410
ret
test ebp, ebp
je 0x40c098
push 2
push 0x4a3704
push esi
call fcn.0048db57
add esp, 0xc
test eax, eax
sete cl
mov byte [ebp + 0x19], cl
lea edx, [ebx - 1]
cmp dl, 5
ja 0x40c0a5
cmp bl, 3
jne 0x40c0ac
lea eax, [ebx + 0x66]
cmp al, 5
ja 0x40c0b0
mov al, 1
jmp 0x40c0b2
xor al, al
mov dl, byte [esp + 0x13]
test dl, 0x30
je 0x40c0c6
lea ecx, [ebx - 0x41]
cmp cl, 0x19
ja 0x40c0c6
and dl, 0xcf
test al, al
je 0x40c1b8
mov eax, dword [esp + 0x14]
mov byte [eax], 2
jmp 0x40c1b8
mov eax, esi
call fcn.00412250
movzx edi, ax
test di, di
jne 0x40c1b4
push 1
lea ebx, [esp + 0x20]
mov eax, esi
call fcn.0044f210
movzx edi, ax
add esp, 4
test di, di
jne 0x40c198
cmp byte [esp + 0x430], 0
je 0x40c137
mov edx, dword [0x4c7ca4]
push 1
push 0
push 0xffffffffffffffff
push 0x4a370c
push edx
call fcn.00476c40
pop edi
pop esi
pop ebp
xor eax, eax
pop ebx
add esp, 0x410
ret
cmp word [esi + 2], 0
jne 0x40c15e
cmp byte [0x4ca0fc], 0
jne 0x40c15e
mov eax, ebp
neg eax
pop edi
sbb eax, eax
pop esi
and eax, 0xfffffffd
pop ebp
add eax, 3
pop ebx
add esp, 0x410
ret
test ebp, ebp
je 0x40c18b
push esi
push 0x4a3710
mov esi, 0x200
lea edi, [esp + 0x28]
call fcn.00473e90
add esp, 8
push 0x4a0850
mov eax, edi
push eax
mov ecx, 0x4c9630
call fcn.0042e370
pop edi
pop esi
pop ebp
xor eax, eax
pop ebx
add esp, 0x410
ret
mov ecx, dword [esp + 0x14]
mov ebx, dword [esp + 0x1c]
mov eax, 1
add dword [0x4c8ea0], eax
mov byte [ecx], 4
mov byte [ebx + 0x4c8e90], al
mov dl, byte [esp + 0x13]
cmp byte [esp + 0x428], 0
je 0x40c1dd
test ebp, ebp
je 0x40c215
mov word [ebp + 0xa], di
pop edi
pop esi
mov byte [ebp + 0x13], bl
pop ebp
mov eax, 1
pop ebx
add esp, 0x410
ret
test ebp, ebp
je 0x40c215
mov al, dl
and al, 0xd5
xor ecx, ecx
mov byte [ebp + 0x12], bl
mov word [ebp + 8], di
test al, 0xc0
je 0x40c1f7
mov ecx, 8
test al, 0xc
je 0x40c1fe
or ecx, 1
test al, 0x30
je 0x40c205
or ecx, 4
test al, 3
je 0x40c20c
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, 0x410
ret