Function at 0x416850
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 0x416879
lea eax, [esp + 0x1b]
cmp byte [esp + 0x424], 0
mov dword [esp + 0x1c], eax
jne 0x41690a
mov ebx, ebp
test ebp, ebp
je 0x41690a
movzx eax, word [ebp]
test ax, ax
je 0x41690a
mov esi, eax
nop dword [eax]
mov ecx, 0x506dbc
mov edx, 0x20
nop word [eax + eax]
cmp si, dx
je 0x4168d3
movzx eax, word [ecx + 2]
add ecx, 2
mov edx, eax
test ax, ax
jne 0x4168b0
movzx eax, word [ebx + 2]
add ebx, 2
mov esi, eax
test ax, ax
jne 0x4168a0
jmp 0x416906
mov eax, ebx
movzx ecx, word [eax]
cmp ecx, 0x20
je 0x4168e2
cmp ecx, 9
jne 0x4168e7
add eax, 2
jmp 0x4168d5
push 0x505f5c
push eax
call fcn.004ce516
add esp, 8
test eax, eax
jne 0x416906
test edi, edi
je 0x416901
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.0041e390
mov bl, al
add esp, 0xc
test bl, bl
je 0x416a18
cmp byte [esp + 0x424], 0
je 0x4169af
lea ecx, [ebx + 0x64]
cmp cl, 3
ja 0x4169cb
cmp byte [esp + 0x42c], 0
je 0x416971
mov ecx, dword [0x51eabc]
push 1
push 0
push 0xffffffffffffffff
push 0x506dc4
call fcn.004b3e10
xor eax, eax
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x410
ret
push ebp
push 0x506dc8
lea eax, [esp + 0x28]
push 0x200
push eax
call fcn.004af740
add esp, 0x10
lea eax, [esp + 0x20]
mov ecx, 0x520c68
push esi
push eax
call fcn.0044ddc0
test edi, edi
jne 0x416ac7
lea eax, [edi + 4]
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x410
ret
test edi, edi
je 0x4169cb
push 2
push 0x506e14
push ebp
call fcn.004cff45
add esp, 0xc
test eax, eax
sete al
mov byte [edi + 0x17], al
mov al, bl
dec al
cmp al, 5
ja 0x4169d8
cmp bl, 3
jne 0x4169e0
mov al, bl
add al, 0x66
cmp al, 5
ja 0x4169e4
mov dl, 1
jmp 0x4169e6
xor dl, dl
mov cl, byte [esp + 0x13]
mov byte [esp + 0x13], cl
test cl, 0x30
je 0x416a02
mov al, bl
sub al, 0x41
cmp al, 0x19
ja 0x416a02
and cl, 0xcf
mov byte [esp + 0x13], cl
xor eax, eax
test dl, dl
je 0x416af4
mov edx, dword [esp + 0x1c]
mov byte [edx], 2
jmp 0x416af4
xor edx, edx
mov ecx, ebp
call fcn.0041e2a0
movzx eax, ax
test ax, ax
jne 0x416aec
push 1
lea edx, [esp + 0x18]
mov ecx, ebp
call fcn.0047abf0
movzx eax, ax
add esp, 4
test ax, ax
jne 0x416ad4
cmp byte [esp + 0x42c], al
je 0x416a75
mov ecx, dword [0x51eabc]
push 1
push 0
push 0xffffffffffffffff
push 0x506e1c
call fcn.004b3e10
xor eax, eax
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x410
ret
cmp word [ebp + 2], 0
jne 0x416a97
cmp byte [0x521760], 0
jne 0x416a97
test edi, edi
jne 0x416ac7
lea eax, [edi + 3]
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x410
ret
test edi, edi
je 0x416ac7
push ebp
push 0x506e20
lea eax, [esp + 0x28]
push 0x200
push eax
call fcn.004af740
add esp, 0x10
lea eax, [esp + 0x20]
mov ecx, 0x520c68
push 0x4f03e8
push eax
call fcn.0044ddc0
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 [0x51f638]
mov byte [edx], 4
mov byte [ebx + 0x51f620], 1
mov cl, byte [esp + 0x13]
mov byte [esp + 0x13], cl
test edi, edi
je 0x416b61
cmp byte [esp + 0x424], 0
je 0x416b19
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