Function at 0x415b50
Capabilities:
Get keyboard layout

Disassembly:
sub esp, 0x4c
push ebx
push ebp
push esi
push edi
mov bl, dl
mov byte [esp + 0x11], 0
mov edi, ecx
mov byte [esp + 0x12], bl
mov esi, edi
movzx eax, word [esi]
cmp eax, 0x7f
ja 0x415b81
push eax
call fcn.004a35e0
add esp, 4
test eax, eax
jne 0x415b81
cmp word [esi], 0x5f
jne 0x415b86
add esi, 2
jmp 0x415b66
cmp esi, edi
jne 0x415b93
cmp word [edi], 0
je 0x415b93
add esi, 2
mov ebp, dword [esp + 0x60]
test bl, bl
jne 0x415c6f
movzx ecx, word [esi]
cmp ecx, 0x20
je 0x415bb0
cmp ecx, 9
jne 0x415c6f
mov eax, esi
cmp cx, 0x20
je 0x415bbe
cmp cx, 9
jne 0x415bc7
movzx ecx, word [eax + 2]
add eax, 2
jmp 0x415bb2
push 0x4d3534
push eax
call fcn.0049f2b1
add esp, 8
test eax, eax
jne 0x415c6f
cmp byte [esp + 0x64], al
jne 0x415dda
test ebp, ebp
je 0x415bef
mov byte [ebp + 0x16], 1
push 0x1f
lea eax, [esp + 0x1c]
push edi
push eax
call fcn.004aa8b4
sub esi, edi
xor eax, eax
sar esi, 1
add esp, 0xc
mov word [esp + 0x56], ax
cmp esi, 0x20
jae 0x415c14
mov word [esp + esi*2 + 0x18], ax
lea edi, [esp + 0x18]
lea esi, [ebp + 0x12]
test ebp, ebp
jne 0x415c23
lea esi, [esp + 0x13]
push 0
call dword [sym.imp.USER32.dll_GetKeyboardLayout]
push eax
push ecx
push 1
lea edx, [esp + 0x1d]
mov ecx, edi
call fcn.0041cb20
mov bl, al
add esp, 0xc
test bl, bl
je 0x415d00
cmp byte [esp + 0x12], 0
je 0x415c9b
lea ecx, [ebx + 0x64]
cmp cl, 3
ja 0x415cb7
push 0
mov edx, edi
mov ecx, str.Unsupported_prefix_key.
call fcn.0040dd50
add esp, 4
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x4c
ret
cmp byte [esp + 0x64], 0
movzx ecx, word [esi]
je 0x415c89
xor eax, eax
test cx, cx
sete al
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x4c
ret
test cx, cx
je 0x415c18
mov eax, 4
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x4c
ret
test ebp, ebp
je 0x415cb7
push 2
push 0x4d4174
push edi
call fcn.0049f432
add esp, 0xc
test eax, eax
sete al
mov byte [ebp + 0x17], al
mov al, bl
dec al
cmp al, 5
ja 0x415cc4
cmp bl, 3
jne 0x415ccc
mov al, bl
add al, 0x66
cmp al, 5
ja 0x415cd0
mov dl, 1
jmp 0x415cd2
xor dl, dl
mov cl, byte [esp + 0x11]
mov byte [esp + 0x11], cl
test cl, 0x30
je 0x415cee
mov al, bl
sub al, 0x41
cmp al, 0x19
ja 0x415cee
and cl, 0xcf
mov byte [esp + 0x11], cl
xor eax, eax
test dl, dl
je 0x415def
mov byte [esi], 2
jmp 0x415def
xor edx, edx
mov ecx, edi
call fcn.0041ca60
movzx eax, ax
test ax, ax
jne 0x415de7
push 1
lea edx, [esp + 0x18]
mov ecx, edi
call fcn.00454a10
movzx eax, ax
add esp, 4
test ax, ax
jne 0x415d68
cmp word [edi + 2], ax
jne 0x415d4f
cmp byte [0x4ea594], al
jne 0x415d4f
xor eax, eax
mov ecx, 3
test ebp, ebp
cmove eax, ecx
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x4c
ret
push 0
mov edx, edi
mov ecx, str.Invalid_key_name.
call fcn.0040dd50
add esp, 4
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x4c
ret
cmp byte [esp + 0x12], 0
jne 0x415c56
mov ebx, dword [esp + 0x14]
mov cl, byte [esp + 0x11]
inc dword [0x4e8fd8]
mov byte [esi], 4
mov byte [ebx + 0x4e8fc0], 1
mov byte [esp + 0x11], cl
test ebp, ebp
je 0x415dda
mov word [ebp + 8], ax
mov byte [ebp + 0x10], bl
mov bl, cl
and bl, 0xd5
mov al, bl
and al, 0xc0
movzx ecx, al
neg ecx
sbb ecx, ecx
and ecx, 8
mov edx, ecx
or edx, 1
test bl, 0xc
cmove edx, ecx
mov ecx, edx
or ecx, 4
test bl, 0x30
cmove ecx, edx
mov eax, ecx
or eax, 2
test bl, 3
cmove eax, ecx
or dword [ebp], eax
mov al, byte [esp + 0x11]
and al, 0x2a
or byte [ebp + 0xe], al
mov eax, 1
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x4c
ret
mov cl, byte [esp + 0x11]
mov byte [esp + 0x11], cl
cmp byte [esp + 0x12], 0
je 0x415d8f
test ebp, ebp
je 0x415dda
pop edi
pop esi
mov byte [ebp + 0x11], bl
mov word [ebp + 0xa], ax
mov eax, 1
pop ebp
pop ebx
add esp, 0x4c
ret