Function at 0x4159a0
Capabilities:
Get keyboard layout

Disassembly:
sub esp, 0x410
push ebx
push ebp
push esi
mov esi, dword [esp + 0x424]
xor ebp, ebp
mov dword [esp + 0x18], edx
mov byte [esp + 0x12], 0
push edi
lea eax, [esi + 0x12]
mov edi, ecx
test esi, esi
jne 0x4159c9
lea eax, [esp + 0x17]
cmp byte [esp + 0x424], 0
mov dword [esp + 0x18], eax
jne 0x415a22
mov edx, 0x4d1604
call fcn.004065e0
mov ebx, eax
test ebx, ebx
je 0x415a22
mov ecx, ebx
nop dword [eax]
movzx edx, word [ecx]
cmp edx, 0x20
je 0x4159fd
cmp edx, 9
jne 0x415a02
add ecx, 2
jmp 0x4159f0
push 0x4d07a4
push ecx
call dword [sym.imp.api_ms_win_crt_string_l1_1_0.dll__wcsicmp]
add esp, 8
test eax, eax
jne 0x415a22
test esi, esi
je 0x415a1d
mov byte [esi + 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 + 0x22]
mov ecx, edi
call fcn.0041cef0
mov bl, al
add esp, 0xc
test bl, bl
je 0x415b32
cmp byte [esp + 0x424], 0
je 0x415aca
lea ecx, [ebx + 0x64]
cmp cl, 3
ja 0x415ae7
cmp byte [esp + 0x42c], 0
je 0x415a89
mov ecx, dword [0x4e69cc]
push 1
push 0
push 0xffffffffffffffff
push 0x4d160c
call fcn.004a1950
xor eax, eax
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x410
ret
push edi
push 0x4d1610
lea eax, [esp + 0x28]
push 0x200
push eax
call fcn.0049d580
add esp, 0x10
lea eax, [esp + 0x20]
mov ecx, 0x4e8b78
push dword [esp + 0x1c]
push eax
call fcn.00448ad0
test esi, esi
jne 0x415be2
lea eax, [esi + 4]
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x410
ret
test esi, esi
je 0x415ae7
push 2
push 0x4d165c
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 [esi + 0x17], al
mov al, bl
dec al
cmp al, 5
ja 0x415af4
cmp bl, 3
jne 0x415afc
mov al, bl
add al, 0x66
cmp al, 5
ja 0x415b00
mov dl, 1
jmp 0x415b02
xor dl, dl
mov cl, byte [esp + 0x16]
mov byte [esp + 0x16], cl
test cl, 0x30
je 0x415b1e
mov al, bl
sub al, 0x41
cmp al, 0x19
ja 0x415b1e
and cl, 0xcf
mov byte [esp + 0x16], cl
test dl, dl
je 0x415c0f
mov eax, dword [esp + 0x18]
mov byte [eax], 2
jmp 0x415c0f
xor edx, edx
mov ecx, edi
call fcn.0041ce00
movzx ebp, ax
test bp, bp
jne 0x415c07
push 1
lea edx, [esp + 0x20]
mov ecx, edi
call fcn.0046e8c0
movzx ebp, ax
add esp, 4
test bp, bp
jne 0x415bef
cmp byte [esp + 0x42c], 0
je 0x415b90
mov ecx, dword [0x4e69cc]
push 1
push 0
push 0xffffffffffffffff
push 0x4d1664
call fcn.004a1950
xor eax, eax
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x410
ret
cmp word [edi + 2], 0
jne 0x415bb2
cmp byte [0x4e9670], 0
jne 0x415bb2
test esi, esi
jne 0x415be2
lea eax, [esi + 3]
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x410
ret
test esi, esi
je 0x415be2
push edi
push 0x4d1668
lea eax, [esp + 0x28]
push 0x200
push eax
call fcn.0049d580
add esp, 0x10
lea eax, [esp + 0x20]
mov ecx, 0x4e8b78
push 0x4bac30
push eax
call fcn.00448ad0
xor eax, eax
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x410
ret
mov eax, dword [esp + 0x18]
mov ebx, dword [esp + 0x1c]
inc dword [0x4e7548]
mov byte [eax], 4
mov byte [ebx + 0x4e7530], 1
mov cl, byte [esp + 0x16]
mov byte [esp + 0x16], cl
test esi, esi
je 0x415c7c
cmp byte [esp + 0x424], 0
je 0x415c34
mov byte [esi + 0x11], bl
mov eax, 1
mov word [esi + 0xa], bp
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x410
ret
mov byte [esi + 0x10], bl
mov bl, cl
and bl, 0xd5
mov word [esi + 8], bp
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 [esi], eax
mov al, byte [esp + 0x16]
and al, 0x2a
or byte [esi + 0xe], al
pop edi
pop esi
pop ebp
mov eax, 1
pop ebx
add esp, 0x410
ret