Function at 0x43f5b0
Capabilities:
Get keyboard layout

Disassembly:
sub esp, 0x14
cmp byte [esp + 0x20], 0
push ebx
mov ebx, dword [esp + 0x1c]
push ebp
push esi
push edi
mov dword [esp + 0x20], 0
mov dword [esp + 0x1c], 0
mov byte [esp + 0x15], 0
je 0x43f5e2
cmp byte [ebx + 0x44], 0
mov byte [esp + 0x11], 1
jne 0x43f5e7
mov byte [esp + 0x11], 0
mov ebp, dword [esp + 0x2c]
cmp byte [ebp], 0
je 0x43f907
mov byte [esp + 0x14], 0
mov cl, byte [ebp]
movsx eax, cl
sub eax, 0x7b
je 0x43f64e
sub eax, 2
je 0x43f83d
cmp byte [esp + 0x11], 0
je 0x43f61e
inc dword [esp + 0x1c]
jmp 0x43f83d
push 0
mov byte [esp + 0x18], cl
mov byte [esp + 0x14], 0
call dword [sym.imp.USER32.dll_GetKeyboardLayout]
push eax
lea eax, [esp + 0x14]
push 1
push eax
lea eax, [esp + 0x20]
call fcn.0041afc0
mov bl, al
add esp, 0xc
mov byte [esp + 0x18], bl
jmp 0x43f76a
lea esi, [ebp + 1]
push 0x7d
push esi
call fcn.00494081
mov edi, eax
add esp, 8
test edi, edi
je 0x43f83d
sub eax, ebp
dec eax
jne 0x43f678
cmp byte [edi + 1], 0x7d
jne 0x43f83d
inc edi
jmp 0x43f67d
cmp eax, 1
jne 0x43f693
cmp byte [esp + 0x11], 0
je 0x43f68d
inc dword [esp + 0x1c]
jmp 0x43f83d
mov cl, byte [esi]
mov byte [esp + 0x14], cl
push 0
mov byte [edi], 0
mov byte [esp + 0x17], 0
mov byte [esp + 0x14], 0
call dword [sym.imp.USER32.dll_GetKeyboardLayout]
push eax
lea edx, [esp + 0x14]
push 1
push edx
mov eax, esi
call fcn.0041afc0
add esp, 0xc
mov byte [esp + 0x18], al
test al, al
je 0x43f74f
movzx esi, byte [esi]
test esi, 0xffffff80
jne 0x43f6e3
push 2
push esi
call fcn.004938f7
add esp, 8
test eax, eax
je 0x43f6e3
and esi, 0xffffffdf
mov eax, esi
cmp al, 0x56
jne 0x43f712
movzx esi, byte [ebp + 2]
test esi, 0xffffff80
jne 0x43f707
push 2
push esi
call fcn.004938f7
add esp, 8
test eax, eax
je 0x43f707
and esi, 0xffffffdf
mov eax, esi
mov byte [esp + 0x12], 1
cmp al, 0x4b
je 0x43f717
mov byte [esp + 0x12], 0
cmp dword [ebx + 8], 0
je 0x43f761
cmp byte [esp + 0x12], 0
jne 0x43f761
mov eax, dword [esp + 0x18]
push eax
mov bl, 1
call fcn.0041b520
movzx eax, ax
add esp, 4
mov dword [esp + 0x20], eax
test ax, ax
je 0x43f761
xor eax, 0x100
mov dword [esp + 0x20], eax
mov byte [esp + 0x18], 0
jmp 0x43f761
lea ebx, [esp + 0x13]
mov eax, esi
call fcn.0041af10
movzx ecx, ax
mov dword [esp + 0x20], ecx
mov bl, byte [esp + 0x18]
mov byte [edi], 0x7d
mov ebp, edi
test bl, bl
je 0x43f80e
cmp byte [esp + 0x14], 0
je 0x43f7ba
cmp byte [esp + 0x30], 0
je 0x43f7ba
mov edx, dword [esp + 0x14]
push edx
call dword [sym.imp.USER32.dll_IsCharAlphaA]
test eax, eax
jne 0x43f7ba
test byte [esp + 0x10], 0x30
je 0x43f7a8
mov ecx, dword [esp + 0x28]
movzx eax, bl
or byte [eax + ecx + 0x50], 1
lea eax, [eax + ecx + 0x50]
jmp 0x43f80e
mov eax, dword [esp + 0x28]
movzx edx, bl
or byte [edx + eax + 0x50], 2
lea eax, [edx + eax + 0x50]
jmp 0x43f80e
mov edx, dword [esp + 0x28]
movzx ecx, bl
lea eax, [ecx + edx + 0x50]
mov dl, byte [esp + 0x34]
mov cl, dl
not cl
mov byte [esp + 0x10], cl
and cl, byte [eax]
or cl, byte [esp + 0x38]
mov byte [eax], cl
test dl, dl
je 0x43f80e
cmp byte [esp + 0x12], 0
jne 0x43f80e
mov eax, dword [esp + 0x18]
push eax
xor bl, bl
call fcn.0041b520
movzx eax, ax
add esp, 4
test ax, ax
je 0x43f80e
mov edx, dword [esp + 0x28]
mov ecx, eax
lea eax, [ecx + edx + 0x150]
mov cl, byte [esp + 0x10]
and byte [eax], cl
mov eax, dword [esp + 0x20]
test ax, ax
jne 0x43f81d
cmp byte [esp + 0x13], al
je 0x43f839
mov cl, byte [esp + 0x34]
movzx edx, ax
mov eax, dword [esp + 0x28]
lea eax, [edx + eax + 0x150]
not cl
and cl, byte [eax]
or cl, byte [esp + 0x38]
mov byte [eax], cl
mov ebx, dword [esp + 0x28]
inc ebp
cmp byte [ebp], 0
jne 0x43f5f5
mov esi, dword [esp + 0x1c]
test esi, esi
je 0x43f907
mov eax, dword [ebx + 0x1c]
cmp esi, eax
jbe 0x43f89f
test eax, eax
je 0x43f86b
mov edx, dword [ebx + 0x18]
push edx
call fcn.00492708
add esp, 4
lea eax, [esi + 1]
push eax
call fcn.00492cd9
add esp, 4
mov dword [ebx + 0x18], eax
test eax, eax
jne 0x43f89c
push 0x4a7935
push str.Out_of_memory.
mov ecx, 0x4bc450
call fcn.0043b430
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x14
ret 0x14
mov dword [ebx + 0x1c], esi
mov esi, dword [esp + 0x2c]
cmp byte [esi], 0
mov ebx, dword [ebx + 0x18]
je 0x43f8f5
jmp 0x43f8b0
mov cl, byte [esi]
movsx eax, cl
sub eax, 0x7b
je 0x43f8c4
sub eax, 2
je 0x43f8ef
mov byte [ebx], cl
inc ebx
jmp 0x43f8ef
lea edi, [esi + 1]
push 0x7d
push edi
call fcn.00494081
add esp, 8
test eax, eax
je 0x43f8ef
cmp eax, edi
jne 0x43f8e1
cmp byte [eax + 1], 0x7d
jne 0x43f8e1
inc eax
add esi, 2
cmp eax, esi
jne 0x43f8ed
mov cl, byte [edi]
mov byte [ebx], cl
inc ebx
mov esi, eax
inc esi
cmp byte [esi], 0
jne 0x43f8b0
pop edi
pop esi
pop ebp
mov byte [ebx], 0
mov eax, 1
pop ebx
add esp, 0x14
ret 0x14
cmp byte [esp + 0x30], 0
je 0x43f930
cmp dword [ebx + 0x1c], 0
je 0x43f929
mov edx, dword [ebx + 0x18]
pop edi
pop esi
pop ebp
mov byte [edx], 0
mov eax, 1
pop ebx
add esp, 0x14
ret 0x14
mov dword [ebx + 0x18], 0x4a7935
pop edi
pop esi
pop ebp
mov eax, 1
pop ebx
add esp, 0x14
ret 0x14