Function at 0x40b4a0
Capabilities:
Get keyboard layout

Disassembly:
push ebp
mov ebp, esp
and esp, 0xffffffc0
sub esp, 0x434
push ebx
push esi
mov esi, dword [ebp + 0xc]
push edi
mov edi, ecx
mov dword [esp + 0x30], 0
mov byte [esp + 0x2f], 0
test esi, esi
je 0x40b4ce
lea eax, [esi + 0x14]
mov dword [esp + 0x34], eax
jmp 0x40b4d6
lea ecx, [esp + 0x3b]
mov dword [esp + 0x34], ecx
cmp byte [ebp + 8], 0
jne 0x40b52b
mov ebx, 0x49e544
mov eax, edi
call fcn.00408f40
mov esi, eax
test esi, esi
je 0x40b528
mov ecx, esi
movzx eax, word [ecx]
cmp eax, 0x20
je 0x40b4fd
cmp eax, 9
jne 0x40b502
add ecx, 2
jmp 0x40b4f0
push 0x49bd08
push ecx
call fcn.004881a9
add esp, 8
test eax, eax
jne 0x40b528
mov eax, dword [ebp + 0xc]
test eax, eax
je 0x40b51f
mov byte [eax + 0x18], 1
xor edx, edx
mov word [esi], dx
mov esi, eax
jmp 0x40b52b
mov esi, dword [ebp + 0xc]
push 0
call dword [sym.imp.USER32.dll_GetKeyboardLayout]
movzx edx, word [edi]
test dx, dx
jne 0x40b542
xor bl, bl
jmp 0x40b607
cmp word [edi + 2], 0
jne 0x40b59f
mov ecx, eax
lea esi, [esp + 0x2f]
mov eax, edx
call fcn.00411a20
mov bl, al
test bl, bl
je 0x40b604
cmp byte [ebp + 8], 0
je 0x40b6d4
lea edx, [ebx + 0x64]
cmp dl, 3
ja 0x40b6f3
cmp byte [ebp + 0x10], 0
je 0x40b672
mov ecx, dword [0x4c26a8]
push 1
push 0
push 0xffffffffffffffff
push 0x49e54c
call fcn.00471c00
xor eax, eax
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
mov esi, edx
test esi, 0xffffff80
jne 0x40b5bb
push 2
push esi
call fcn.004893ee
add esp, 8
test eax, eax
je 0x40b5bb
and esi, 0xffffffdf
cmp si, 0x56
jne 0x40b5e5
mov ax, word [edi + 2]
call fcn.00408f10
cmp ax, 0x4b
jne 0x40b5e5
push 0x10
lea eax, [edi + 4]
push 0
push eax
call fcn.004897cb
add esp, 0xc
jmp 0x40b556
xor esi, esi
mov ecx, dword [esi*8 + 0x4bf230]
push edi
push ecx
call fcn.004881a9
add esp, 8
test eax, eax
je 0x40b666
inc esi
cmp esi, 0x6d
jl 0x40b5e7
xor bl, bl
mov esi, dword [ebp + 0xc]
mov eax, edi
call fcn.004118c0
movzx eax, ax
mov dword [esp + 0x30], eax
test ax, ax
jne 0x40b783
push 1
lea ebx, [esp + 0x40]
mov eax, edi
call fcn.0044dad0
movzx eax, ax
add esp, 4
mov dword [esp + 0x30], eax
test ax, ax
jne 0x40b767
cmp byte [ebp + 0x10], al
je 0x40b731
mov ecx, dword [0x4c26a8]
push 1
push 0
push 0xffffffffffffffff
push 0x49e5a4
call fcn.00471c00
xor eax, eax
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
mov bl, byte [esi*8 + 0x4bf234]
jmp 0x40b558
push edi
push 0x49e550
mov esi, 0x200
lea edi, [esp + 0x48]
call fcn.0046f100
add esp, 8
cmp byte [0x4c4a9c], 0
je 0x40b6ad
push 0x4a59a4
mov eax, edi
push eax
mov ecx, 0x4c4000
call fcn.0042f010
xor eax, eax
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
fldz
push 0
sub esp, 8
fstp qword [esp]
push 0
lea ecx, [esp + 0x50]
push 0x10000
push ecx
call fcn.004736d0
add esp, 0x18
xor eax, eax
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
mov esi, dword [ebp + 0xc]
test esi, esi
je 0x40b6f3
push 2
push 0x49e59c
push edi
call fcn.004889e2
add esp, 0xc
test eax, eax
sete dl
mov byte [esi + 0x19], dl
lea eax, [ebx - 1]
cmp al, 5
ja 0x40b6ff
cmp bl, 3
jne 0x40b707
lea ecx, [ebx + 0x66]
cmp cl, 5
ja 0x40b70b
mov al, 1
jmp 0x40b70d
xor al, al
mov dl, byte [esp + 0x2f]
test dl, 0x30
je 0x40b721
lea ecx, [ebx - 0x41]
cmp cl, 0x19
ja 0x40b721
and dl, 0xcf
mov esi, dword [ebp + 0xc]
test al, al
je 0x40b787
mov eax, dword [esp + 0x34]
mov byte [eax], 2
jmp 0x40b787
test esi, esi
je 0x40b75e
push edi
push 0x49e5a8
mov esi, 0x200
lea edi, [esp + 0x48]
call fcn.0046f100
add esp, 8
push 0x4a59a4
mov edx, edi
push edx
mov ecx, 0x4c4000
call fcn.0042f010
xor eax, eax
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
mov ecx, dword [esp + 0x34]
mov ebx, dword [esp + 0x3c]
mov eax, 1
add dword [0x4c38a8], eax
mov byte [ecx], 4
mov byte [ebx + 0x4c3898], al
mov dl, byte [esp + 0x2f]
cmp byte [ebp + 8], 0
je 0x40b7a9
test esi, esi
je 0x40b7e6
mov cx, word [esp + 0x30]
mov byte [esi + 0x13], bl
mov word [esi + 0xa], cx
mov eax, 1
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
test esi, esi
je 0x40b7e6
mov ax, word [esp + 0x30]
mov word [esi + 8], ax
mov al, dl
and al, 0xd5
xor ecx, ecx
mov byte [esi + 0x12], bl
test al, 0xc0
je 0x40b7c8
mov ecx, 8
test al, 0xc
je 0x40b7cf
or ecx, 1
test al, 0x30
je 0x40b7d6
or ecx, 4
test al, 3
je 0x40b7dd
or ecx, 2
or dword [esi + 0xc], ecx
and dl, 0x2a
or byte [esi + 0x10], dl
pop edi
pop esi
mov eax, 1
pop ebx
mov esp, ebp
pop ebp
ret