Function at 0x40cb00
Capabilities:
Get keyboard layout

Disassembly:
sub esp, 0x410
push ebx
push ebp
push esi
push edi
mov edi, dword [esp + 0x428]
mov esi, edx
mov dword [esp + 0x14], esi
mov ebp, ecx
mov byte [esp + 0x13], 0
lea eax, [edi + 0x12]
test edi, edi
jne 0x40cb29
lea eax, [esp + 0x1b]
cmp byte [esp + 0x424], 0
mov dword [esp + 0x1c], eax
jne 0x40cbba
mov ebx, ebp
test ebp, ebp
je 0x40cbba
movzx eax, word [ebp]
test ax, ax
je 0x40cbba
mov esi, eax
nop dword [eax]
mov ecx, 0x4ca844
mov edx, 0x20
nop word [eax + eax]
cmp si, dx
je 0x40cb83
movzx eax, word [ecx + 2]
add ecx, 2
mov edx, eax
test ax, ax
jne 0x40cb60
movzx eax, word [ebx + 2]
add ebx, 2
mov esi, eax
test ax, ax
jne 0x40cb50
jmp 0x40cbb6
mov eax, ebx
movzx ecx, word [eax]
cmp ecx, 0x20
je 0x40cb92
cmp ecx, 9
jne 0x40cb97
add eax, 2
jmp 0x40cb85
push 0x4b913c
push eax
call fcn.00499643
add esp, 8
test eax, eax
jne 0x40cbb6
test edi, edi
je 0x40cbb1
mov byte [edi + 0x16], 1
xor eax, eax
mov word [ebx], ax
mov esi, dword [esp + 0x14]
push 0
call dword [sym.imp.USER32.dll_GetKeyboardLayout]
push eax
push ecx
push 1
lea edx, [esp + 0x1f]
mov ecx, ebp
call fcn.00414160
mov bl, al
add esp, 0xc
test bl, bl
je 0x40ccc8
cmp byte [esp + 0x424], 0
je 0x40cc5f
lea ecx, [ebx + 0x64]
cmp cl, 3
ja 0x40cc7b
cmp byte [esp + 0x42c], 0
je 0x40cc21
mov ecx, dword [0x4dc408]
push 1
push 0
push 0xffffffffffffffff
push 0x4ca84c
call fcn.0047faa0
xor eax, eax
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x410
ret
push ebp
push 0x4ca850
lea eax, [esp + 0x28]
push 0x200
push eax
call fcn.0047c9c0
add esp, 0x10
lea eax, [esp + 0x20]
mov ecx, 0x4ddca0
push esi
push eax
call fcn.004302e0
test edi, edi
jne 0x40cd75
lea eax, [edi + 4]
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x410
ret
test edi, edi
je 0x40cc7b
push 2
push 0x4ca89c
push ebp
call fcn.0049b726
add esp, 0xc
test eax, eax
sete al
mov byte [edi + 0x17], al
mov al, bl
dec al
cmp al, 5
ja 0x40cc88
cmp bl, 3
jne 0x40cc90
mov al, bl
add al, 0x66
cmp al, 5
ja 0x40cc94
mov dl, 1
jmp 0x40cc96
xor dl, dl
mov cl, byte [esp + 0x13]
mov byte [esp + 0x13], cl
test cl, 0x30
je 0x40ccb2
mov al, bl
sub al, 0x41
cmp al, 0x19
ja 0x40ccb2
and cl, 0xcf
mov byte [esp + 0x13], cl
xor eax, eax
test dl, dl
je 0x40cda2
mov edx, dword [esp + 0x1c]
mov byte [edx], 2
jmp 0x40cda2
mov ecx, ebp
call fcn.00414080
movzx eax, ax
test ax, ax
jne 0x40cd9a
push 1
lea edx, [esp + 0x18]
mov ecx, ebp
call fcn.00454db0
movzx eax, ax
add esp, 4
test ax, ax
jne 0x40cd82
cmp byte [esp + 0x42c], al
je 0x40cd23
mov ecx, dword [0x4dc408]
push 1
push 0
push 0xffffffffffffffff
push 0x4ca8a4
call fcn.0047faa0
xor eax, eax
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x410
ret
cmp word [ebp + 2], 0
jne 0x40cd45
cmp byte [0x4de780], 0
jne 0x40cd45
test edi, edi
jne 0x40cd75
lea eax, [edi + 3]
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x410
ret
test edi, edi
je 0x40cd75
push ebp
push 0x4ca8a8
lea eax, [esp + 0x28]
push 0x200
push eax
call fcn.0047c9c0
add esp, 0x10
lea eax, [esp + 0x20]
mov ecx, 0x4ddca0
push 0x4b70dc
push eax
call fcn.004302e0
xor eax, eax
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x410
ret
mov edx, dword [esp + 0x1c]
mov ebx, dword [esp + 0x14]
inc dword [0x4dcefc]
mov byte [edx], 4
mov byte [ebx + 0x4dcee4], 1
mov cl, byte [esp + 0x13]
mov byte [esp + 0x13], cl
test edi, edi
je 0x40ce0f
cmp byte [esp + 0x424], 0
je 0x40cdc7
mov word [edi + 0xa], ax
mov eax, 1
mov byte [edi + 0x11], bl
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x410
ret
mov word [edi + 8], ax
mov byte [edi + 0x10], bl
mov bl, cl
and bl, 0xd5
mov al, bl
and al, 0xc0
movzx ecx, al
mov al, bl
neg ecx
sbb ecx, ecx
and ecx, 8
mov edx, ecx
or edx, 1
and al, 0xc
mov al, bl
cmove edx, ecx
mov ecx, edx
or ecx, 4
and al, 0x30
cmove ecx, edx
mov eax, ecx
or eax, 2
and bl, 3
cmove eax, ecx
or dword [edi], eax
mov al, byte [esp + 0x13]
and al, 0x2a
or byte [edi + 0xe], al
pop edi
pop esi
pop ebp
mov eax, 1
pop ebx
add esp, 0x410
ret