Function at 0x417760
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 0x417789
lea eax, [esp + 0x17]
cmp byte [esp + 0x424], 0
mov dword [esp + 0x1c], eax
jne 0x41781b
mov ebx, edi
test edi, edi
je 0x41781b
movzx eax, word [edi]
test ax, ax
je 0x41781b
mov esi, eax
nop dword [eax + eax]
mov ecx, 0x4e6614
mov edx, 0x20
nop word [eax + eax]
cmp si, dx
je 0x4177e3
movzx eax, word [ecx + 2]
add ecx, 2
mov edx, eax
test ax, ax
jne 0x4177c0
movzx eax, word [ebx + 2]
add ebx, 2
mov esi, eax
test ax, ax
jne 0x4177b0
jmp 0x417817
mov eax, ebx
movzx ecx, word [eax]
cmp ecx, 0x20
je 0x4177f2
cmp ecx, 9
jne 0x4177f7
add eax, 2
jmp 0x4177e5
push 0x4e57b8
push eax
call dword [sym.imp.api_ms_win_crt_string_l1_1_0.dll__wcsicmp]
add esp, 8
test eax, eax
jne 0x417817
test ebp, ebp
je 0x417812
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.0041f4a0
mov bl, al
add esp, 0xc
test bl, bl
je 0x41792a
cmp byte [esp + 0x424], 0
je 0x4178c0
lea ecx, [ebx + 0x64]
cmp cl, 3
ja 0x4178dd
cmp byte [esp + 0x42c], 0
je 0x417882
mov ecx, dword [0x4fb9e4]
push 1
push 0
push 0xffffffffffffffff
push 0x4e661c
call fcn.004b55f0
xor eax, eax
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x410
ret
push edi
push 0x4e6620
lea eax, [esp + 0x28]
push 0x200
push eax
call fcn.004b0fe0
add esp, 0x10
lea eax, [esp + 0x20]
mov ecx, 0x4fdb90
push esi
push eax
call fcn.0044e970
test ebp, ebp
jne 0x417a47
lea eax, [ebp + 4]
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x410
ret
test ebp, ebp
je 0x4178dd
push 2
push 0x4e666c
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 0x4178ea
cmp bl, 3
jne 0x4178f2
mov al, bl
add al, 0x66
cmp al, 5
ja 0x4178f6
mov dl, 1
jmp 0x4178f8
xor dl, dl
mov cl, byte [esp + 0x16]
mov byte [esp + 0x16], cl
test cl, 0x30
je 0x417914
mov al, bl
sub al, 0x41
cmp al, 0x19
ja 0x417914
and cl, 0xcf
mov byte [esp + 0x16], cl
xor eax, eax
test dl, dl
je 0x417a70
mov edx, dword [esp + 0x1c]
mov byte [edx], 2
jmp 0x417a70
xor edx, edx
mov ecx, edi
call fcn.0041f3b0
movzx eax, ax
test ax, ax
jne 0x417a68
xor ebx, ebx
mov esi, edi
test edi, edi
je 0x4179bb
movzx eax, word [edi]
test ax, ax
je 0x4179bb
cmp eax, 0x30
jb 0x41797d
mov ecx, eax
cmp cx, 0x39
ja 0x41796a
movzx eax, word [esi + 2]
add esi, 2
mov ecx, eax
cmp eax, 0x30
jae 0x417956
cmp esi, edi
jbe 0x41797d
mov ecx, edi
call fcn.0041a370
dec eax
cmp eax, 0xf
ja 0x4179bb
mov ebx, eax
push 3
push 0x4ef6f8
push esi
call dword [sym.imp.api_ms_win_crt_string_l1_1_0.dll__wcsnicmp]
add esp, 0xc
test eax, eax
jne 0x4179bb
push eax
push eax
push eax
xor edx, edx
lea ecx, [esi + 6]
call fcn.004b0df0
add esp, 0xc
test eax, eax
je 0x4179bb
lea ecx, [esi + 6]
call fcn.0041a370
lea ecx, [eax - 1]
cmp ecx, 0x1f
ja 0x4179bb
add eax, 0xb
jmp 0x4179bd
xor eax, eax
movzx eax, ax
test ax, ax
jne 0x417a54
cmp byte [esp + 0x42c], al
je 0x4179f5
mov ecx, dword [0x4fb9e4]
push 1
push 0
push 0xffffffffffffffff
push 0x4e6674
call fcn.004b55f0
xor eax, eax
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x410
ret
cmp word [edi + 2], 0
jne 0x417a17
cmp byte [0x4fe688], 0
jne 0x417a17
test ebp, ebp
jne 0x417a47
lea eax, [ebp + 3]
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x410
ret
test ebp, ebp
je 0x417a47
push edi
push 0x4e6678
lea eax, [esp + 0x28]
push 0x200
push eax
call fcn.004b0fe0
add esp, 0x10
lea eax, [esp + 0x20]
mov ecx, 0x4fdb90
push 0x4cfc30
push eax
call fcn.0044e970
xor eax, eax
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x410
ret
mov edx, dword [esp + 0x1c]
inc dword [0x4fc558]
mov byte [ebx + 0x4fc540], 1
mov byte [edx], 4
mov cl, byte [esp + 0x16]
mov byte [esp + 0x16], cl
test ebp, ebp
je 0x417adc
cmp byte [esp + 0x424], 0
je 0x417a95
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
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 + 0x16]
and al, 0x2a
or byte [ebp + 0xe], al
pop edi
pop esi
pop ebp
mov eax, 1
pop ebx
add esp, 0x410
ret