Function at 0x40e8e0
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 0x40e909
lea eax, [esp + 0x1b]
cmp byte [esp + 0x424], 0
mov dword [esp + 0x1c], eax
jne 0x40e99b
mov ebx, ebp
test ebp, ebp
je 0x40e99b
movzx eax, word [ebp]
test ax, ax
je 0x40e99b
mov esi, eax
nop dword [eax]
mov ecx, 0x4d5394
mov edx, 0x20
nop word [eax + eax]
cmp si, dx
je 0x40e963
movzx eax, word [ecx + 2]
add ecx, 2
mov edx, eax
test ax, ax
jne 0x40e940
movzx eax, word [ebx + 2]
add ebx, 2
mov esi, eax
test ax, ax
jne 0x40e930
jmp 0x40e997
mov eax, ebx
movzx ecx, word [eax]
cmp ecx, 0x20
je 0x40e972
cmp ecx, 9
jne 0x40e977
add eax, 2
jmp 0x40e965
push 0x4c1e9c
push eax
call dword [sym.imp.api_ms_win_crt_string_l1_1_0.dll__wcsicmp]
add esp, 8
test eax, eax
jne 0x40e997
test edi, edi
je 0x40e992
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.004162a0
mov bl, al
add esp, 0xc
test bl, bl
je 0x40eaaa
cmp byte [esp + 0x424], 0
je 0x40ea40
lea ecx, [ebx + 0x64]
cmp cl, 3
ja 0x40ea5d
cmp byte [esp + 0x42c], 0
je 0x40ea02
mov ecx, dword [0x4e97d8]
push 1
push 0
push 0xffffffffffffffff
push 0x4d539c
call fcn.004a6070
xor eax, eax
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x410
ret
push ebp
push 0x4d53a0
lea eax, [esp + 0x28]
push 0x200
push eax
call fcn.004a1b10
add esp, 0x10
lea eax, [esp + 0x20]
mov ecx, 0x4eb958
push esi
push eax
call fcn.0043ec50
test edi, edi
jne 0x40eb59
lea eax, [edi + 4]
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x410
ret
test edi, edi
je 0x40ea5d
push 2
push 0x4d53ec
push ebp
call dword [sym.imp.api_ms_win_crt_string_l1_1_0.dll__wcsnicmp]
add esp, 0xc
test eax, eax
sete al
mov byte [edi + 0x17], al
mov al, bl
dec al
cmp al, 5
ja 0x40ea6a
cmp bl, 3
jne 0x40ea72
mov al, bl
add al, 0x66
cmp al, 5
ja 0x40ea76
mov dl, 1
jmp 0x40ea78
xor dl, dl
mov cl, byte [esp + 0x13]
mov byte [esp + 0x13], cl
test cl, 0x30
je 0x40ea94
mov al, bl
sub al, 0x41
cmp al, 0x19
ja 0x40ea94
and cl, 0xcf
mov byte [esp + 0x13], cl
xor eax, eax
test dl, dl
je 0x40eb86
mov edx, dword [esp + 0x1c]
mov byte [edx], 2
jmp 0x40eb86
xor edx, edx
mov ecx, ebp
call fcn.004161b0
movzx eax, ax
test ax, ax
jne 0x40eb7e
push 1
lea edx, [esp + 0x18]
mov ecx, ebp
call fcn.0046bb70
movzx eax, ax
add esp, 4
test ax, ax
jne 0x40eb66
cmp byte [esp + 0x42c], al
je 0x40eb07
mov ecx, dword [0x4e97d8]
push 1
push 0
push 0xffffffffffffffff
push 0x4d53f4
call fcn.004a6070
xor eax, eax
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x410
ret
cmp word [ebp + 2], 0
jne 0x40eb29
cmp byte [0x4ec450], 0
jne 0x40eb29
test edi, edi
jne 0x40eb59
lea eax, [edi + 3]
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x410
ret
test edi, edi
je 0x40eb59
push ebp
push 0x4d53f8
lea eax, [esp + 0x28]
push 0x200
push eax
call fcn.004a1b10
add esp, 0x10
lea eax, [esp + 0x20]
mov ecx, 0x4eb958
push 0x4bfba0
push eax
call fcn.0043ec50
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 [0x4ea32c]
mov byte [edx], 4
mov byte [ebx + 0x4ea314], 1
mov cl, byte [esp + 0x13]
mov byte [esp + 0x13], cl
test edi, edi
je 0x40ebf3
cmp byte [esp + 0x424], 0
je 0x40ebab
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