Function at 0x4172b0
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 0x4172d9
lea eax, [esp + 0x17]
cmp byte [esp + 0x424], 0
mov dword [esp + 0x1c], eax
jne 0x41736b
mov ebx, edi
test edi, edi
je 0x41736b
movzx eax, word [edi]
test ax, ax
je 0x41736b
mov esi, eax
nop dword [eax + eax]
mov ecx, 0x4e5614
mov edx, 0x20
nop word [eax + eax]
cmp si, dx
je 0x417333
movzx eax, word [ecx + 2]
add ecx, 2
mov edx, eax
test ax, ax
jne 0x417310
movzx eax, word [ebx + 2]
add ebx, 2
mov esi, eax
test ax, ax
jne 0x417300
jmp 0x417367
mov eax, ebx
movzx ecx, word [eax]
cmp ecx, 0x20
je 0x417342
cmp ecx, 9
jne 0x417347
add eax, 2
jmp 0x417335
push 0x4e47b8
push eax
call dword [sym.imp.api_ms_win_crt_string_l1_1_0.dll__wcsicmp]
add esp, 8
test eax, eax
jne 0x417367
test ebp, ebp
je 0x417362
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.0041efb0
mov bl, al
add esp, 0xc
test bl, bl
je 0x41747a
cmp byte [esp + 0x424], 0
je 0x417410
lea ecx, [ebx + 0x64]
cmp cl, 3
ja 0x41742d
cmp byte [esp + 0x42c], 0
je 0x4173d2
mov ecx, dword [0x4faa64]
push 1
push 0
push 0xffffffffffffffff
push 0x4e561c
call fcn.004b4bf0
xor eax, eax
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x410
ret
push edi
push 0x4e5620
lea eax, [esp + 0x28]
push 0x200
push eax
call fcn.004b0610
add esp, 0x10
lea eax, [esp + 0x20]
mov ecx, 0x4fcc10
push esi
push eax
call fcn.0044df00
test ebp, ebp
jne 0x417597
lea eax, [ebp + 4]
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x410
ret
test ebp, ebp
je 0x41742d
push 2
push 0x4e566c
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 0x41743a
cmp bl, 3
jne 0x417442
mov al, bl
add al, 0x66
cmp al, 5
ja 0x417446
mov dl, 1
jmp 0x417448
xor dl, dl
mov cl, byte [esp + 0x16]
mov byte [esp + 0x16], cl
test cl, 0x30
je 0x417464
mov al, bl
sub al, 0x41
cmp al, 0x19
ja 0x417464
and cl, 0xcf
mov byte [esp + 0x16], cl
xor eax, eax
test dl, dl
je 0x4175c0
mov edx, dword [esp + 0x1c]
mov byte [edx], 2
jmp 0x4175c0
xor edx, edx
mov ecx, edi
call fcn.0041eec0
movzx eax, ax
test ax, ax
jne 0x4175b8
xor ebx, ebx
mov esi, edi
test edi, edi
je 0x41750b
movzx eax, word [edi]
test ax, ax
je 0x41750b
cmp eax, 0x30
jb 0x4174cd
mov ecx, eax
cmp cx, 0x39
ja 0x4174ba
movzx eax, word [esi + 2]
add esi, 2
mov ecx, eax
cmp eax, 0x30
jae 0x4174a6
cmp esi, edi
jbe 0x4174cd
mov ecx, edi
call fcn.00419ea0
dec eax
cmp eax, 0xf
ja 0x41750b
mov ebx, eax
push 3
push 0x4ee6c0
push esi
call dword [sym.imp.api_ms_win_crt_string_l1_1_0.dll__wcsnicmp]
add esp, 0xc
test eax, eax
jne 0x41750b
push eax
push eax
push eax
xor edx, edx
lea ecx, [esi + 6]
call fcn.004b0420
add esp, 0xc
test eax, eax
je 0x41750b
lea ecx, [esi + 6]
call fcn.00419ea0
lea ecx, [eax - 1]
cmp ecx, 0x1f
ja 0x41750b
add eax, 0xb
jmp 0x41750d
xor eax, eax
movzx eax, ax
test ax, ax
jne 0x4175a4
cmp byte [esp + 0x42c], al
je 0x417545
mov ecx, dword [0x4faa64]
push 1
push 0
push 0xffffffffffffffff
push 0x4e5674
call fcn.004b4bf0
xor eax, eax
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x410
ret
cmp word [edi + 2], 0
jne 0x417567
cmp byte [0x4fd708], 0
jne 0x417567
test ebp, ebp
jne 0x417597
lea eax, [ebp + 3]
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x410
ret
test ebp, ebp
je 0x417597
push edi
push 0x4e5678
lea eax, [esp + 0x28]
push 0x200
push eax
call fcn.004b0610
add esp, 0x10
lea eax, [esp + 0x20]
mov ecx, 0x4fcc10
push 0x4cec30
push eax
call fcn.0044df00
xor eax, eax
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x410
ret
mov edx, dword [esp + 0x1c]
inc dword [0x4fb5d8]
mov byte [ebx + 0x4fb5c0], 1
mov byte [edx], 4
mov cl, byte [esp + 0x16]
mov byte [esp + 0x16], cl
test ebp, ebp
je 0x41762c
cmp byte [esp + 0x424], 0
je 0x4175e5
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