Function at 0x40d240
Capabilities:
Get keyboard layout

Disassembly:
sub esp, 0x210
push ebx
push ebp
push esi
mov esi, dword [esp + 0x224]
xor ebp, ebp
mov dword [esp + 0x14], edx
mov byte [esp + 0xf], 0
push edi
lea eax, [esi + 0x12]
mov edi, ecx
test esi, esi
jne 0x40d269
lea eax, [esp + 0x1f]
cmp byte [esp + 0x224], 0
mov dword [esp + 0x14], eax
jne 0x40d2bc
mov edx, 0x4a0c84
call fcn.0040a9c0
mov ebx, eax
test ebx, ebx
je 0x40d2bc
mov ecx, ebx
lea esp, [esp]
mov dl, byte [ecx]
cmp dl, 0x20
je 0x40d29c
cmp dl, 9
jne 0x40d29f
inc ecx
jmp 0x40d290
push 0x49f184
push ecx
call fcn.004855c8
add esp, 8
test eax, eax
jne 0x40d2bc
test esi, esi
je 0x40d2b9
mov byte [esi + 0x16], 1
mov byte [ebx], 0
push 0
call dword [sym.imp.USER32.dll_GetKeyboardLayout]
push eax
push ecx
push 1
lea edx, [esp + 0x1f]
mov ecx, edi
call fcn.004134c0
mov bl, al
add esp, 0xc
test bl, bl
je 0x40d3c3
cmp byte [esp + 0x224], 0
je 0x40d364
lea ecx, [ebx + 0x64]
cmp cl, 3
ja 0x40d380
cmp byte [esp + 0x22c], 0
je 0x40d323
mov ecx, dword [0x4af094]
push 1
push 0
push 0xffffffffffffffff
push 0x4a0c88
call fcn.004759c0
pop edi
pop esi
pop ebp
xor eax, eax
pop ebx
add esp, 0x210
ret
push edi
push str.__s__is_not_allowed_as_a_prefix_key.
lea eax, [esp + 0x28]
push 0x200
push eax
call fcn.00472ab0
add esp, 0x10
lea eax, [esp + 0x20]
mov ecx, 0x4b09a0
push dword [esp + 0x18]
push eax
call fcn.0042e360
test esi, esi
jne 0x40d412
pop edi
lea eax, [esi + 4]
pop esi
pop ebp
pop ebx
add esp, 0x210
ret
test esi, esi
je 0x40d380
push 2
push 0x4a0cb4
push edi
call fcn.0048616d
add esp, 0xc
test eax, eax
sete al
mov byte [esi + 0x17], al
mov al, bl
dec al
cmp al, 5
ja 0x40d38d
cmp bl, 3
jne 0x40d395
mov al, bl
add al, 0x66
cmp al, 5
ja 0x40d399
mov dl, 1
jmp 0x40d39b
xor dl, dl
mov cl, byte [esp + 0x13]
test cl, 0x30
je 0x40d3af
mov al, bl
sub al, 0x41
cmp al, 0x19
ja 0x40d3af
and cl, 0xcf
test dl, dl
je 0x40d49e
mov eax, dword [esp + 0x14]
mov byte [eax], 2
jmp 0x40d49e
mov ecx, edi
call fcn.00413410
movzx ebp, ax
test bp, bp
jne 0x40d49a
push 1
lea edx, [esp + 0x1c]
mov ecx, edi
call fcn.0044d690
movzx ebp, ax
add esp, 4
test bp, bp
jne 0x40d482
cmp byte [esp + 0x22c], 0
je 0x40d41f
mov ecx, dword [0x4af094]
push 1
push 0
push 0xffffffffffffffff
push 0x4a0cb8
call fcn.004759c0
pop edi
pop esi
pop ebp
xor eax, eax
pop ebx
add esp, 0x210
ret
cmp byte [edi + 1], 0
jne 0x40d445
cmp byte [0x4b0fb4], 0
jne 0x40d445
pop edi
xor eax, eax
mov ecx, 3
test esi, esi
pop esi
pop ebp
cmove eax, ecx
pop ebx
add esp, 0x210
ret
test esi, esi
je 0x40d412
push edi
push str.__s__is_not_a_valid_key_name.
lea eax, [esp + 0x28]
push 0x200
push eax
call fcn.00472ab0
add esp, 0x10
lea eax, [esp + 0x20]
mov ecx, 0x4b09a0
push 0x49e065
push eax
call fcn.0042e360
pop edi
pop esi
pop ebp
xor eax, eax
pop ebx
add esp, 0x210
ret
mov eax, dword [esp + 0x14]
mov ebx, dword [esp + 0x18]
inc dword [0x4afb14]
mov byte [eax], 4
mov byte [ebx + 0x4afb00], 1
mov cl, byte [esp + 0x13]
cmp byte [esp + 0x224], 0
je 0x40d4c3
test esi, esi
je 0x40d500
pop edi
mov byte [esi + 0x11], bl
mov eax, 1
mov word [esi + 0xa], bp
pop esi
pop ebp
pop ebx
add esp, 0x210
ret
test esi, esi
je 0x40d500
mov dl, cl
mov byte [esi + 0x10], bl
and dl, 0xd5
mov word [esi + 8], bp
xor eax, eax
mov edi, 8
test dl, 0xc0
cmovne eax, edi
test dl, 0xc
je 0x40d4e8
or eax, 1
test dl, 0x30
je 0x40d4f0
or eax, 4
test dl, 3
je 0x40d4f8
or eax, 2
or dword [esi], eax
and cl, 0x2a
or byte [esi + 0xe], cl
pop edi
pop esi
pop ebp
mov eax, 1
pop ebx
add esp, 0x210
ret