Function at 0x40bd20
Capabilities:
Get keyboard layout

Disassembly:
sub esp, 0xc
push ebx
push ebp
push esi
push edi
mov edi, dword [esp + 0x24]
mov ebp, ecx
mov byte [esp + 0x24], 0
lea eax, [edi + 0x12]
test edi, edi
jne 0x40bd3d
lea eax, [esp + 0x13]
cmp byte [esp + 0x20], 0
mov dword [esp + 0x14], eax
jne 0x40bdc6
mov ebx, ebp
test ebp, ebp
je 0x40bdc6
movzx eax, word [ebp]
test ax, ax
je 0x40bdc6
mov esi, eax
nop dword [eax]
mov eax, 0x4c678c
mov edx, 0x20
nop word [eax + eax]
cmp si, dx
je 0x40bd93
movzx ecx, word [eax + 2]
add eax, 2
mov edx, ecx
test cx, cx
jne 0x40bd70
movzx eax, word [ebx + 2]
add ebx, 2
mov esi, eax
test ax, ax
jne 0x40bd60
jmp 0x40bdc6
mov eax, ebx
movzx ecx, word [eax]
cmp ecx, 0x20
je 0x40bda2
cmp ecx, 9
jne 0x40bda7
add eax, 2
jmp 0x40bd95
push 0x4b51a4
push eax
call fcn.004979b3
add esp, 8
test eax, eax
jne 0x40bdc6
test edi, edi
je 0x40bdc1
mov byte [edi + 0x16], 1
xor eax, eax
mov word [ebx], ax
push 0
call dword [sym.imp.USER32.dll_GetKeyboardLayout]
push eax
push ecx
push 1
lea edx, [esp + 0x30]
mov ecx, ebp
call fcn.00413120
mov bl, al
add esp, 0xc
test bl, bl
je 0x40be85
cmp byte [esp + 0x20], 0
je 0x40be1c
lea ecx, [ebx + 0x64]
cmp cl, 3
ja 0x40be38
push ebp
push str.Unsupported_prefix_key.
mov ecx, 0x4dcd68
call fcn.00428f20
test edi, edi
jne 0x40bedf
lea eax, [edi + 4]
pop edi
pop esi
pop ebp
pop ebx
add esp, 0xc
ret
test edi, edi
je 0x40be38
push 2
push 0x4c67c4
push ebp
call fcn.00497b0e
add esp, 0xc
test eax, eax
sete al
mov byte [edi + 0x17], al
mov al, bl
dec al
cmp al, 5
ja 0x40be45
cmp bl, 3
jne 0x40be4d
mov al, bl
add al, 0x66
cmp al, 5
ja 0x40be51
mov dl, 1
jmp 0x40be53
xor dl, dl
mov cl, byte [esp + 0x24]
mov byte [esp + 0x24], cl
test cl, 0x30
je 0x40be6f
mov al, bl
sub al, 0x41
cmp al, 0x19
ja 0x40be6f
and cl, 0xcf
mov byte [esp + 0x24], cl
xor eax, eax
test dl, dl
je 0x40bf09
mov edx, dword [esp + 0x14]
mov byte [edx], 2
jmp 0x40bf09
xor edx, edx
mov ecx, ebp
call fcn.00413030
movzx eax, ax
test ax, ax
jne 0x40bf01
push 1
lea edx, [esp + 0x1c]
mov ecx, ebp
call fcn.004501f0
movzx eax, ax
add esp, 4
test ax, ax
jne 0x40bee9
cmp word [ebp + 2], ax
jne 0x40becb
cmp byte [0x4dd434], al
jne 0x40becb
test edi, edi
jne 0x40bedf
lea eax, [edi + 3]
pop edi
pop esi
pop ebp
pop ebx
add esp, 0xc
ret
test edi, edi
je 0x40bedf
push ebp
push str.Invalid_key_name.
mov ecx, 0x4dcd68
call fcn.00428f20
xor eax, eax
pop edi
pop esi
pop ebp
pop ebx
add esp, 0xc
ret
mov edx, dword [esp + 0x14]
mov ebx, dword [esp + 0x18]
inc dword [0x4dbfe8]
mov byte [edx], 4
mov byte [ebx + 0x4dbfd0], 1
mov cl, byte [esp + 0x24]
mov byte [esp + 0x24], cl
test edi, edi
je 0x40bf70
cmp byte [esp + 0x20], 0
je 0x40bf28
mov word [edi + 0xa], ax
mov eax, 1
mov byte [edi + 0x11], bl
pop edi
pop esi
pop ebp
pop ebx
add esp, 0xc
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 + 0x24]
and al, 0x2a
or byte [edi + 0xe], al
pop edi
pop esi
pop ebp
mov eax, 1
pop ebx
add esp, 0xc
ret