Function at 0x440da0
Capabilities:
Get keyboard layout

Disassembly:
sub esp, 0x18
push ebx
push ebp
xor eax, eax
mov edx, ecx
push esi
mov word [esp + 0x1a], ax
xor esi, esi
mov al, byte [esp + 0x2c]
push edi
xor edi, edi
mov dword [esp + 0x24], edx
mov dword [esp + 0x18], edi
mov dword [esp + 0x20], esi
test al, al
je 0x440dd3
cmp byte [edx + 0x45], 0
mov byte [esp + 0x15], 1
jne 0x440dd8
mov byte [esp + 0x15], 0
mov ebx, dword [esp + 0x2c]
mov ebp, ebx
cmp word [ebx], si
je 0x441103
mov ebx, ecx
nop dword [eax]
xor eax, eax
mov word [esp + 0x1c], ax
movzx ecx, word [ebp]
mov eax, ecx
sub eax, 0x7b
je 0x440e46
sub eax, 2
je 0x440e7e
cmp byte [esp + 0x15], 0
je 0x440e15
inc esi
mov dword [esp + 0x20], esi
jmp 0x440e7e
push 0
mov word [esp + 0x20], cx
mov byte [esp + 0x18], 0
call dword [sym.imp.USER32.dll_GetKeyboardLayout]
push eax
push ecx
push 1
lea edx, [esp + 0x20]
lea ecx, [esp + 0x28]
call fcn.004155c0
mov dh, al
add esp, 0xc
mov byte [esp + 0x13], dh
jmp 0x440fc7
lea edi, [ebp + 2]
push 0x7d
push edi
call fcn.004ace17
mov esi, eax
add esp, 8
test esi, esi
je 0x440e76
mov ecx, esi
sub ecx, ebp
sar ecx, 1
sub ecx, 1
jne 0x440ef3
add esi, 2
cmp word [esi], 0x7d
je 0x440ef8
mov esi, dword [esp + 0x20]
mov edi, dword [esp + 0x18]
add ebp, 2
cmp word [ebp], 0
jne 0x440df0
mov ebx, dword [esp + 0x2c]
mov edx, dword [esp + 0x24]
test esi, esi
je 0x4410ff
mov eax, dword [edx + 0x1c]
cmp esi, eax
jbe 0x441088
test eax, eax
je 0x440eb6
push dword [edx + 0x18]
call fcn.004b113e
add esp, 4
lea eax, [esi*2 + 2]
push eax
call fcn.004af8fa
mov edx, dword [esp + 0x28]
add esp, 4
mov dword [edx + 0x18], eax
test eax, eax
jne 0x441085
push 0x4cd2cc
push str.Out_of_memory.
mov ecx, 0x4f9a70
call fcn.0043bff0
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x18
ret 0x10
cmp ecx, 1
jne 0x440f15
cmp byte [esp + 0x15], 0
je 0x440f0d
mov esi, dword [esp + 0x20]
inc esi
mov dword [esp + 0x20], esi
jmp 0x440e7a
mov ax, word [edi]
mov word [esp + 0x1c], ax
xor eax, eax
push eax
mov word [esi], ax
mov byte [esp + 0x1b], al
mov byte [esp + 0x18], al
call dword [sym.imp.USER32.dll_GetKeyboardLayout]
push eax
push ecx
push 1
lea edx, [esp + 0x20]
mov ecx, edi
call fcn.004155c0
add esp, 0xc
mov byte [esp + 0x13], al
test al, al
je 0x440f9d
mov cx, word [edi]
call fcn.0040ba80
cmp ax, 0x56
jne 0x440f64
mov cx, word [ebp + 4]
call fcn.0040ba80
cmp ax, 0x4b
jne 0x440f64
mov al, 1
jmp 0x440f66
xor al, al
cmp dword [ebx + 8], 0
mov byte [esp + 0x16], al
je 0x440fb1
test al, al
jne 0x440fb1
mov cl, byte [esp + 0x13]
mov dl, 1
call fcn.00415b20
movzx edi, ax
mov dword [esp + 0x18], edi
test di, di
je 0x440fb5
xor edi, 0x100
xor dh, dh
mov dword [esp + 0x18], edi
mov byte [esp + 0x13], dh
jmp 0x440fb9
lea edx, [esp + 0x17]
mov ecx, edi
call fcn.004154d0
movzx edi, ax
mov dword [esp + 0x18], edi
jmp 0x440fb5
mov edi, dword [esp + 0x18]
mov dh, byte [esp + 0x13]
mov eax, 0x7d
mov ebp, esi
mov word [esi], ax
mov esi, dword [esp + 0x20]
test dh, dh
je 0x441052
cmp word [esp + 0x1c], 0
je 0x441009
cmp byte [esp + 0x30], 0
je 0x441009
push dword [esp + 0x1c]
call dword [sym.imp.USER32.dll_IsCharAlphaW]
test eax, eax
jne 0x441005
movzx eax, byte [esp + 0x13]
lea ecx, [eax + ebx]
mov al, byte [esp + 0x14]
and al, 0x30
neg al
sbb al, al
add al, 2
or byte [ecx + 0x54], al
jmp 0x441052
mov dh, byte [esp + 0x13]
mov dl, byte [esp + 0x34]
movzx eax, dh
not dl
lea ecx, [eax + ebx]
mov byte [esp + 0x14], dl
mov al, byte [ecx + 0x54]
and al, dl
mov dl, byte [esp + 0x34]
or al, byte [esp + 0x38]
mov byte [ecx + 0x54], al
test dl, dl
je 0x441056
cmp byte [esp + 0x16], 0
jne 0x441056
xor dl, dl
mov cl, dh
call fcn.00415b20
movzx eax, ax
test ax, ax
je 0x441052
mov cl, byte [esp + 0x14]
add eax, 0x154
add eax, ebx
and byte [eax], cl
mov dl, byte [esp + 0x34]
test di, di
jne 0x441066
cmp byte [esp + 0x17], 0
je 0x440e7e
movzx eax, di
lea ecx, [eax + ebx]
mov al, dl
not al
and al, byte [ecx + 0x154]
or al, byte [esp + 0x38]
mov byte [ecx + 0x154], al
jmp 0x440e7e
mov dword [edx + 0x1c], esi
movzx eax, word [ebx]
mov esi, dword [edx + 0x18]
test ax, ax
je 0x4410eb
mov ecx, eax
movzx eax, cx
sub eax, 0x7b
je 0x4410aa
sub eax, 2
je 0x4410dd
mov word [esi], cx
add esi, 2
jmp 0x4410dd
lea edi, [ebx + 2]
push 0x7d
push edi
call fcn.004ace17
add esp, 8
test eax, eax
je 0x4410dd
cmp eax, edi
jne 0x4410cb
cmp word [eax + 2], 0x7d
lea ecx, [eax + 2]
cmove eax, ecx
lea ecx, [ebx + 4]
cmp eax, ecx
jne 0x4410db
mov cx, word [edi]
mov word [esi], cx
add esi, 2
mov ebx, eax
movzx eax, word [ebx + 2]
add ebx, 2
mov ecx, eax
test ax, ax
jne 0x441095
xor eax, eax
pop edi
mov word [esi], ax
mov eax, 1
pop esi
pop ebp
pop ebx
add esp, 0x18
ret 0x10
mov al, byte [esp + 0x30]
test al, al
je 0x441129
cmp dword [edx + 0x1c], 0
je 0x441122
mov eax, dword [edx + 0x18]
xor ecx, ecx
pop edi
pop esi
pop ebp
mov word [eax], cx
lea eax, [ecx + 1]
pop ebx
add esp, 0x18
ret 0x10
mov dword [edx + 0x18], 0x4cd2cc
pop edi
pop esi
pop ebp
mov eax, 1
pop ebx
add esp, 0x18
ret 0x10