Function at 0x452cd0
Capabilities:
Get keyboard layout

Disassembly:
sub esp, 0x18
mov al, byte [esp + 0x20]
mov edx, ecx
push ebx
push ebp
push esi
push edi
xor esi, esi
mov dword [esp + 0x24], edx
xor edi, edi
mov dword [esp + 0x18], esi
mov dword [esp + 0x20], edi
mov byte [esp + 0x1d], 0
test al, al
je 0x452d00
cmp byte [edx + 0x45], 0
je 0x452d00
mov ch, 1
jmp 0x452d02
xor ch, ch
mov ebx, dword [esp + 0x2c]
mov ebp, ebx
mov byte [esp + 0x14], ch
cmp byte [ebx], 0
je 0x453063
mov ebx, edx
nop word [eax + eax]
mov byte [esp + 0x1c], 0
mov cl, byte [ebp]
movsx eax, cl
sub eax, 0x7b
je 0x452d70
sub eax, 2
je 0x452da8
test ch, ch
je 0x452d40
inc edi
mov dword [esp + 0x20], edi
jmp 0x452da8
push 0
mov byte [esp + 0x20], cl
mov byte [esp + 0x19], 0
call dword [sym.imp.USER32.dll_GetKeyboardLayout]
push eax
push ecx
push 1
lea edx, [esp + 0x21]
lea ecx, [esp + 0x28]
call fcn.0041d950
mov dh, al
add esp, 0xc
mov byte [esp + 0x13], dh
jmp 0x452f43
lea esi, [ebp + 1]
push 0x7d
push esi
call dword [sym.imp.api_ms_win_crt_multibyte_l1_1_0.dll__mbschr]
mov edi, eax
add esp, 8
test edi, edi
je 0x452d9c
mov ecx, edi
sub ecx, ebp
sub ecx, 1
jne 0x452e18
inc edi
cmp byte [edi], 0x7d
je 0x452e1d
mov edi, dword [esp + 0x20]
mov esi, dword [esp + 0x18]
mov ch, byte [esp + 0x14]
inc ebp
cmp byte [ebp], 0
jne 0x452d20
mov ebx, dword [esp + 0x2c]
mov edx, dword [esp + 0x24]
test edi, edi
je 0x45305f
mov eax, dword [edx + 0x1c]
cmp edi, eax
jbe 0x452ff7
test eax, eax
je 0x452dde
push dword [edx + 0x18]
call dword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
add esp, 4
lea eax, [edi + 1]
push eax
call dword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_malloc]
mov edx, dword [esp + 0x28]
add esp, 4
mov dword [edx + 0x18], eax
test eax, eax
jne 0x452ff4
push 0x4c3c29
push str.Out_of_memory.
mov ecx, 0x4dba98
call fcn.0044da60
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x18
ret 0x10
cmp ecx, 1
jne 0x452e3d
mov ch, byte [esp + 0x14]
test ch, ch
je 0x452e37
mov edi, dword [esp + 0x20]
mov esi, dword [esp + 0x18]
inc edi
mov dword [esp + 0x20], edi
jmp 0x452da8
mov al, byte [esi]
mov byte [esp + 0x1c], al
push 0
mov byte [edi], 0
mov byte [esp + 0x1b], 0
mov byte [esp + 0x19], 0
call dword [sym.imp.USER32.dll_GetKeyboardLayout]
push eax
push ecx
push 1
lea edx, [esp + 0x21]
mov ecx, esi
call fcn.0041d950
add esp, 0xc
mov byte [esp + 0x13], al
test al, al
je 0x452f1e
mov ch, byte [esi]
mov esi, dword [sym.imp.api_ms_win_crt_string_l1_1_0.dll__isctype]
movzx eax, ch
mov byte [esp + 0x16], ch
test eax, 0xffffff80
je 0x452e8a
xor eax, eax
jmp 0x452e96
push 2
push eax
call esi
mov ch, byte [esp + 0x1e]
add esp, 8
mov cl, ch
and cl, 0xdf
test eax, eax
movzx edx, cl
movzx ecx, ch
cmove edx, ecx
cmp dl, 0x56
jne 0x452ee5
mov ch, byte [ebp + 2]
movzx eax, ch
mov byte [esp + 0x16], ch
test eax, 0xffffff80
je 0x452ec0
xor eax, eax
jmp 0x452ecc
push 2
push eax
call esi
mov ch, byte [esp + 0x1e]
add esp, 8
mov cl, ch
and cl, 0xdf
test eax, eax
movzx edx, cl
movzx ecx, ch
cmove edx, ecx
cmp dl, 0x4b
jne 0x452ee5
mov al, 1
jmp 0x452ee7
xor al, al
cmp dword [ebx + 8], 0
mov byte [esp + 0x16], al
je 0x452f32
test al, al
jne 0x452f32
mov cl, byte [esp + 0x13]
mov dl, 1
call fcn.0041df10
movzx esi, ax
mov dword [esp + 0x18], esi
test si, si
je 0x452f36
xor esi, 0x100
xor dh, dh
mov dword [esp + 0x18], esi
mov byte [esp + 0x13], dh
jmp 0x452f3a
lea edx, [esp + 0x17]
mov ecx, esi
call fcn.0041d860
movzx esi, ax
mov dword [esp + 0x18], esi
jmp 0x452f36
mov esi, dword [esp + 0x18]
mov dh, byte [esp + 0x13]
mov byte [edi], 0x7d
mov ebp, edi
mov edi, dword [esp + 0x20]
test dh, dh
je 0x452fc4
cmp byte [esp + 0x1c], 0
je 0x452f81
cmp byte [esp + 0x30], 0
je 0x452f81
push dword [esp + 0x1c]
call dword [sym.imp.USER32.dll_IsCharAlphaA]
test eax, eax
jne 0x452f7d
movzx eax, byte [esp + 0x13]
lea ecx, [ebx + 0x54]
add ecx, eax
mov al, byte [esp + 0x15]
and al, 0x30
neg al
sbb al, al
add al, 2
or byte [ecx], al
jmp 0x452fc4
mov dh, byte [esp + 0x13]
mov dl, byte [esp + 0x34]
lea ecx, [ebx + 0x54]
movzx eax, dh
add ecx, eax
mov al, dl
not al
mov byte [esp + 0x15], al
and al, byte [ecx]
or al, byte [esp + 0x38]
mov byte [ecx], al
test dl, dl
je 0x452fc8
cmp byte [esp + 0x16], 0
jne 0x452fc8
xor dl, dl
mov cl, dh
call fcn.0041df10
movzx eax, ax
test ax, ax
je 0x452fc4
mov cl, byte [esp + 0x15]
and byte [eax + ebx + 0x154], cl
mov dl, byte [esp + 0x34]
test si, si
jne 0x452fd8
cmp byte [esp + 0x17], 0
je 0x452da4
movzx eax, si
lea ecx, [ebx + 0x154]
add ecx, eax
mov al, dl
not al
and al, byte [ecx]
or al, byte [esp + 0x38]
mov byte [ecx], al
jmp 0x452da4
mov dword [edx + 0x1c], edi
mov cl, byte [ebx]
mov esi, dword [edx + 0x18]
test cl, cl
je 0x45304d
mov ebp, dword [sym.imp.api_ms_win_crt_multibyte_l1_1_0.dll__mbschr]
movsx eax, cl
sub eax, 0x7b
je 0x453018
sub eax, 2
je 0x453045
mov byte [esi], cl
inc esi
jmp 0x453045
lea edi, [ebx + 1]
push 0x7d
push edi
call ebp
mov edx, eax
add esp, 8
test edx, edx
je 0x453045
cmp edx, edi
jne 0x453037
cmp byte [edx + 1], 0x7d
lea ecx, [edx + 1]
cmove edx, ecx
lea eax, [ebx + 2]
cmp edx, eax
jne 0x453043
mov al, byte [edi]
mov byte [esi], al
inc esi
mov ebx, edx
mov cl, byte [ebx + 1]
inc ebx
test cl, cl
jne 0x453006
pop edi
mov byte [esi], 0
mov eax, 1
pop esi
pop ebp
pop ebx
add esp, 0x18
ret 0x10
mov al, byte [esp + 0x30]
test al, al
je 0x453089
cmp dword [edx + 0x1c], 0
je 0x453082
mov eax, dword [edx + 0x18]
pop edi
pop esi
pop ebp
mov byte [eax], 0
mov eax, 1
pop ebx
add esp, 0x18
ret 0x10
mov dword [edx + 0x18], 0x4c3c29
pop edi
pop esi
pop ebp
mov eax, 1
pop ebx
add esp, 0x18
ret 0x10