Function at 0x416800
Capabilities:
Get keyboard layout

Disassembly:
sub esp, 0x410
push ebx
push ebp
mov ebp, dword [esp + 0x420]
mov byte [esp + 0xe], 0
push esi
mov esi, edx
mov dword [esp + 0x14], esi
lea eax, [ebp + 0x12]
push edi
mov edi, ecx
test ebp, ebp
jne 0x416829
lea eax, [esp + 0x17]
cmp byte [esp + 0x424], 0
mov dword [esp + 0x1c], eax
jne 0x4168bb
mov ebx, edi
test edi, edi
je 0x4168bb
movzx eax, word [edi]
test ax, ax
je 0x4168bb
mov esi, eax
nop dword [eax + eax]
mov ecx, 0x4e4614
mov edx, 0x20
nop word [eax + eax]
cmp si, dx
je 0x416883
movzx eax, word [ecx + 2]
add ecx, 2
mov edx, eax
test ax, ax
jne 0x416860
movzx eax, word [ebx + 2]
add ebx, 2
mov esi, eax
test ax, ax
jne 0x416850
jmp 0x4168b7
mov eax, ebx
movzx ecx, word [eax]
cmp ecx, 0x20
je 0x416892
cmp ecx, 9
jne 0x416897
add eax, 2
jmp 0x416885
push 0x4e37b4
push eax
call dword [sym.imp.api_ms_win_crt_string_l1_1_0.dll__wcsicmp]
add esp, 8
test eax, eax
jne 0x4168b7
test ebp, ebp
je 0x4168b2
mov byte [ebp + 0x16], 1
xor eax, eax
mov word [ebx], ax
mov esi, dword [esp + 0x18]
push 0
call dword [sym.imp.USER32.dll_GetKeyboardLayout]
push eax
push ecx
push 1
lea edx, [esp + 0x22]
mov ecx, edi
call fcn.0041e390
mov bl, al
add esp, 0xc
test bl, bl
je 0x4169ca
cmp byte [esp + 0x424], 0
je 0x416960
lea ecx, [ebx + 0x64]
cmp cl, 3
ja 0x41697d
cmp byte [esp + 0x42c], 0
je 0x416922
mov ecx, dword [0x4f99cc]
push 1
push 0
push 0xffffffffffffffff
push 0x4e461c
call fcn.004b3f70
xor eax, eax
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x410
ret
push edi
push 0x4e4620
lea eax, [esp + 0x28]
push 0x200
push eax
call fcn.004af890
add esp, 0x10
lea eax, [esp + 0x20]
mov ecx, 0x4fbb78
push esi
push eax
call fcn.0044dc10
test ebp, ebp
jne 0x416ae7
lea eax, [ebp + 4]
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x410
ret
test ebp, ebp
je 0x41697d
push 2
push 0x4e466c
push edi
call dword [sym.imp.api_ms_win_crt_string_l1_1_0.dll__wcsnicmp]
add esp, 0xc
test eax, eax
sete al
mov byte [ebp + 0x17], al
mov al, bl
dec al
cmp al, 5
ja 0x41698a
cmp bl, 3
jne 0x416992
mov al, bl
add al, 0x66
cmp al, 5
ja 0x416996
mov dl, 1
jmp 0x416998
xor dl, dl
mov cl, byte [esp + 0x16]
mov byte [esp + 0x16], cl
test cl, 0x30
je 0x4169b4
mov al, bl
sub al, 0x41
cmp al, 0x19
ja 0x4169b4
and cl, 0xcf
mov byte [esp + 0x16], cl
xor eax, eax
test dl, dl
je 0x416b10
mov edx, dword [esp + 0x1c]
mov byte [edx], 2
jmp 0x416b10
xor edx, edx
mov ecx, edi
call fcn.0041e2a0
movzx eax, ax
test ax, ax
jne 0x416b08
xor ebx, ebx
mov esi, edi
test edi, edi
je 0x416a5b
movzx eax, word [edi]
test ax, ax
je 0x416a5b
cmp eax, 0x30
jb 0x416a1d
mov ecx, eax
cmp cx, 0x39
ja 0x416a0a
movzx eax, word [esi + 2]
add esi, 2
mov ecx, eax
cmp eax, 0x30
jae 0x4169f6
cmp esi, edi
jbe 0x416a1d
mov ecx, edi
call fcn.00419330
dec eax
cmp eax, 0xf
ja 0x416a5b
mov ebx, eax
push 3
push 0x4ed740
push esi
call dword [sym.imp.api_ms_win_crt_string_l1_1_0.dll__wcsnicmp]
add esp, 0xc
test eax, eax
jne 0x416a5b
push eax
push eax
push eax
xor edx, edx
lea ecx, [esi + 6]
call fcn.004af6b0
add esp, 0xc
test eax, eax
je 0x416a5b
lea ecx, [esi + 6]
call fcn.00419330
lea ecx, [eax - 1]
cmp ecx, 0x1f
ja 0x416a5b
add eax, 0xb
jmp 0x416a5d
xor eax, eax
movzx eax, ax
test ax, ax
jne 0x416af4
cmp byte [esp + 0x42c], al
je 0x416a95
mov ecx, dword [0x4f99cc]
push 1
push 0
push 0xffffffffffffffff
push 0x4e4674
call fcn.004b3f70
xor eax, eax
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x410
ret
cmp word [edi + 2], 0
jne 0x416ab7
cmp byte [0x4fc670], 0
jne 0x416ab7
test ebp, ebp
jne 0x416ae7
lea eax, [ebp + 3]
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x410
ret
test ebp, ebp
je 0x416ae7
push edi
push 0x4e4678
lea eax, [esp + 0x28]
push 0x200
push eax
call fcn.004af890
add esp, 0x10
lea eax, [esp + 0x20]
mov ecx, 0x4fbb78
push 0x4cdc40
push eax
call fcn.0044dc10
xor eax, eax
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x410
ret
mov edx, dword [esp + 0x1c]
inc dword [0x4fa548]
mov byte [ebx + 0x4fa530], 1
mov byte [edx], 4
mov cl, byte [esp + 0x16]
mov byte [esp + 0x16], cl
test ebp, ebp
je 0x416b7e
cmp byte [esp + 0x424], 0
je 0x416b35
mov word [ebp + 0xa], ax
mov eax, 1
mov byte [ebp + 0x11], bl
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x410
ret
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
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 [ebp], eax
mov al, byte [esp + 0x16]
and al, 0x2a
or byte [ebp + 0xe], al
pop edi
pop esi
pop ebp
mov eax, 1
pop ebx
add esp, 0x410
ret