Function at 0x435810
Capabilities:
Get keyboard layout

Disassembly:
sub esp, 0x14
push ebx
mov ebx, dword [esp + 0x1c]
push ebp
xor eax, eax
push esi
push edi
mov dword [esp + 0x20], 0
mov dword [esp + 0x1c], 0
mov word [esp + 0x16], ax
cmp byte [esp + 0x30], al
je 0x435842
mov byte [esp + 0x12], 1
cmp byte [ebx + 0x44], al
jne 0x435846
mov byte [esp + 0x12], al
mov ebp, dword [esp + 0x2c]
cmp word [ebp], ax
je 0x435b86
xor ecx, ecx
mov word [esp + 0x14], cx
movzx ecx, word [ebp]
mov eax, ecx
sub eax, 0x7b
je 0x4358af
sub eax, 2
je 0x435aa6
cmp byte [esp + 0x12], 0
je 0x43587f
inc dword [esp + 0x1c]
jmp 0x435aa6
push 0
mov word [esp + 0x18], cx
mov byte [esp + 0x15], 0
call dword [sym.imp.USER32.dll_GetKeyboardLayout]
push eax
push 1
lea ecx, [esp + 0x19]
lea eax, [esp + 0x1c]
call fcn.00413d60
mov bl, al
add esp, 8
mov byte [esp + 0x18], bl
jmp 0x4359cd
lea esi, [ebp + 2]
push 0x7d
push esi
call fcn.004909d1
mov edi, eax
add esp, 8
test edi, edi
je 0x435aa6
sub eax, ebp
sar eax, 1
dec eax
jne 0x4358de
cmp word [edi + 2], 0x7d
jne 0x435aa6
add edi, 2
jmp 0x4358e3
cmp eax, 1
jne 0x4358fb
cmp byte [esp + 0x12], 0
je 0x4358f3
inc dword [esp + 0x1c]
jmp 0x435aa6
mov dx, word [esi]
mov word [esp + 0x14], dx
xor eax, eax
push eax
mov word [edi], ax
mov byte [esp + 0x15], al
call dword [sym.imp.USER32.dll_GetKeyboardLayout]
push eax
push 1
lea ecx, [esp + 0x19]
mov eax, esi
call fcn.00413d60
add esp, 8
mov byte [esp + 0x18], al
test al, al
je 0x4359b1
movzx esi, word [esi]
test esi, 0xffffff80
jne 0x435945
push 2
push esi
call fcn.00490e4e
add esp, 8
test eax, eax
je 0x435945
and esi, 0xffffffdf
cmp si, 0x56
jne 0x435974
movzx esi, word [ebp + 4]
test esi, 0xffffff80
jne 0x435969
push 2
push esi
call fcn.00490e4e
add esp, 8
test eax, eax
je 0x435969
and esi, 0xffffffdf
mov byte [esp + 0x13], 1
cmp si, 0x4b
je 0x435979
mov byte [esp + 0x13], 0
cmp dword [ebx + 8], 0
je 0x4359bf
cmp byte [esp + 0x13], 0
jne 0x4359bf
mov ecx, dword [esp + 0x18]
push ecx
mov bl, 1
call fcn.004142f0
movzx eax, ax
add esp, 4
mov dword [esp + 0x20], eax
test ax, ax
je 0x4359bf
xor eax, 0x100
mov dword [esp + 0x20], eax
mov byte [esp + 0x18], 0
jmp 0x4359bf
mov eax, esi
call fcn.00413cb0
movzx edx, ax
mov dword [esp + 0x20], edx
mov bl, byte [esp + 0x18]
mov eax, 0x7d
mov word [edi], ax
mov ebp, edi
test bl, bl
je 0x435a79
cmp word [esp + 0x14], 0
je 0x435a1e
cmp byte [esp + 0x30], 0
je 0x435a1e
mov ecx, dword [esp + 0x14]
push ecx
call dword [sym.imp.USER32.dll_IsCharAlphaW]
test eax, eax
jne 0x435a1e
test byte [esp + 0x11], 0x30
je 0x435a0c
mov eax, dword [esp + 0x28]
movzx edx, bl
or byte [edx + eax + 0x54], 1
lea eax, [edx + eax + 0x54]
jmp 0x435a79
mov edx, dword [esp + 0x28]
movzx ecx, bl
or byte [ecx + edx + 0x54], 2
lea eax, [ecx + edx + 0x54]
jmp 0x435a79
mov ecx, dword [esp + 0x28]
mov dl, byte [esp + 0x34]
movzx eax, bl
mov bl, byte [eax + ecx + 0x54]
lea eax, [eax + ecx + 0x54]
mov cl, dl
not cl
and bl, cl
or bl, byte [esp + 0x38]
mov byte [esp + 0x11], cl
mov byte [eax], bl
test dl, dl
je 0x435a79
cmp byte [esp + 0x13], 0
jne 0x435a79
mov edx, dword [esp + 0x18]
push edx
xor bl, bl
call fcn.004142f0
movzx eax, ax
add esp, 4
test ax, ax
je 0x435a79
mov ecx, dword [esp + 0x28]
mov dl, byte [esp + 0x11]
and byte [eax + ecx + 0x154], dl
lea eax, [eax + ecx + 0x154]
mov eax, dword [esp + 0x20]
test ax, ax
je 0x435aa2
mov ecx, dword [esp + 0x28]
mov dl, byte [esp + 0x34]
movzx eax, ax
lea eax, [eax + ecx + 0x154]
not dl
and dl, byte [eax]
mov ebx, ecx
or dl, byte [esp + 0x38]
mov byte [eax], dl
jmp 0x435aa6
mov ebx, dword [esp + 0x28]
add ebp, 2
cmp word [ebp], 0
jne 0x435854
mov esi, dword [esp + 0x1c]
test esi, esi
je 0x435b86
mov eax, dword [ebx + 0x1c]
cmp esi, eax
jbe 0x435b0c
test eax, eax
je 0x435ad7
mov eax, dword [ebx + 0x18]
push eax
call fcn.004904f1
add esp, 4
lea ecx, [esi + esi + 2]
push ecx
call fcn.0048fc34
add esp, 4
mov dword [ebx + 0x18], eax
test eax, eax
jne 0x435b09
push 0x4a3890
push str.Out_of_memory.
mov ecx, 0x4cb508
call fcn.00430600
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x14
ret 0x14
mov dword [ebx + 0x1c], esi
mov esi, dword [esp + 0x2c]
cmp word [esi], 0
mov ebx, dword [ebx + 0x18]
je 0x435b72
lea esp, [esp]
movzx ecx, word [esi]
mov eax, ecx
sub eax, 0x7b
je 0x435b37
sub eax, 2
je 0x435b69
mov word [ebx], cx
add ebx, 2
jmp 0x435b69
lea edi, [esi + 2]
push 0x7d
push edi
call fcn.004909d1
add esp, 8
test eax, eax
je 0x435b69
cmp eax, edi
jne 0x435b57
cmp word [eax + 2], 0x7d
jne 0x435b57
add eax, 2
add esi, 4
cmp eax, esi
jne 0x435b67
mov dx, word [edi]
mov word [ebx], dx
add ebx, 2
mov esi, eax
add esi, 2
cmp word [esi], 0
jne 0x435b20
pop edi
pop esi
xor eax, eax
mov word [ebx], ax
pop ebp
mov eax, 1
pop ebx
add esp, 0x14
ret 0x14
cmp byte [esp + 0x30], 0
je 0x435baf
cmp dword [ebx + 0x1c], 0
je 0x435ba8
mov ecx, dword [ebx + 0x18]
pop edi
pop esi
xor edx, edx
pop ebp
mov word [ecx], dx
lea eax, [edx + 1]
pop ebx
add esp, 0x14
ret 0x14
mov dword [ebx + 0x18], 0x4a3890
pop edi
pop esi
pop ebp
mov eax, 1
pop ebx
add esp, 0x14
ret 0x14