Function at 0x40b780
Capabilities:
Get keyboard layout

Disassembly:
sub esp, 0x418
push ebx
push ebp
mov ebp, dword [esp + 0x428]
push esi
push edi
mov edi, ecx
mov dword [esp + 0x18], 0
mov byte [esp + 0x17], 0
test ebp, ebp
je 0x40b7ad
lea eax, [ebp + 0x14]
mov dword [esp + 0x1c], eax
jmp 0x40b7b5
lea ecx, [esp + 0x23]
mov dword [esp + 0x1c], ecx
cmp byte [esp + 0x42c], 0
jne 0x40b804
mov ebx, 0x4a14dc
mov eax, edi
call fcn.00409160
mov esi, eax
test esi, esi
je 0x40b804
mov ecx, esi
movzx eax, word [ecx]
cmp eax, 0x20
je 0x40b7e0
cmp eax, 9
jne 0x40b7e5
add ecx, 2
jmp 0x40b7d3
push 0x49ed20
push ecx
call fcn.0048a789
add esp, 8
test eax, eax
jne 0x40b804
test ebp, ebp
je 0x40b7ff
mov byte [ebp + 0x18], 1
xor edx, edx
mov word [esi], dx
push 0
call dword [sym.imp.USER32.dll_GetKeyboardLayout]
movzx edx, word [edi]
test dx, dx
jne 0x40b87e
xor bl, bl
mov eax, edi
call fcn.00411b40
movzx eax, ax
mov dword [esp + 0x18], eax
test ax, ax
jne 0x40ba74
push 1
lea ebx, [esp + 0x28]
mov eax, edi
call fcn.0044f010
movzx eax, ax
add esp, 4
mov dword [esp + 0x18], eax
test ax, ax
jne 0x40ba58
cmp byte [esp + 0x434], al
je 0x40ba1e
mov edx, dword [0x4c46ec]
push 1
push 0
push 0xffffffffffffffff
push 0x4a153c
push edx
call fcn.004742b0
xor eax, eax
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x418
ret
cmp word [edi + 2], 0
jne 0x40b8e7
mov ecx, eax
lea esi, [esp + 0x17]
mov eax, edx
call fcn.00411ca0
mov bl, al
test bl, bl
je 0x40b816
cmp byte [esp + 0x42c], 0
je 0x40b9c6
lea edx, [ebx + 0x64]
cmp dl, 3
ja 0x40b9e2
cmp byte [esp + 0x434], 0
je 0x40b95c
mov eax, dword [0x4c46ec]
push 1
push 0
push 0xffffffffffffffff
push 0x4a14e4
push eax
call fcn.004742b0
xor eax, eax
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x418
ret
mov esi, edx
test esi, 0xffffff80
jne 0x40b903
push 2
push esi
call fcn.0048b9ce
add esp, 8
test eax, eax
je 0x40b903
and esi, 0xffffffdf
cmp si, 0x56
jne 0x40b92d
mov ax, word [edi + 2]
call fcn.00409130
cmp ax, 0x4b
jne 0x40b92d
push 0x10
lea eax, [edi + 4]
push 0
push eax
call fcn.0048bdab
add esp, 0xc
jmp 0x40b892
xor esi, esi
nop
mov ecx, dword [esi*8 + 0x4c11f0]
push edi
push ecx
call fcn.0048a789
add esp, 8
test eax, eax
je 0x40b950
inc esi
cmp esi, 0x6d
jl 0x40b930
jmp 0x40b814
mov bl, byte [esi*8 + 0x4c11f4]
jmp 0x40b894
push edi
push 0x4a14e8
mov esi, 0x200
lea edi, [esp + 0x30]
call fcn.004717a0
add esp, 8
cmp byte [0x4c6ae8], 0
je 0x40b99b
push 0x49e828
mov ecx, edi
push ecx
mov ecx, 0x4c6048
call fcn.0042f1f0
xor eax, eax
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x418
ret
fldz
push 0
sub esp, 8
fstp qword [esp]
push 0
lea edx, [esp + 0x38]
push 0x10000
push edx
call fcn.00475de0
add esp, 0x18
xor eax, eax
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x418
ret
test ebp, ebp
je 0x40b9e2
push 2
push 0x4a1534
push edi
call fcn.0048afc2
add esp, 0xc
test eax, eax
sete al
mov byte [ebp + 0x19], al
lea ecx, [ebx - 1]
cmp cl, 5
ja 0x40b9ef
cmp bl, 3
jne 0x40b9f7
lea edx, [ebx + 0x66]
cmp dl, 5
ja 0x40b9fb
mov al, 1
jmp 0x40b9fd
xor al, al
mov dl, byte [esp + 0x17]
test dl, 0x30
je 0x40ba11
lea ecx, [ebx - 0x41]
cmp cl, 0x19
ja 0x40ba11
and dl, 0xcf
test al, al
je 0x40ba78
mov eax, dword [esp + 0x1c]
mov byte [eax], 2
jmp 0x40ba78
test ebp, ebp
je 0x40ba4b
push edi
push 0x4a1540
mov esi, 0x200
lea edi, [esp + 0x30]
call fcn.004717a0
add esp, 8
push 0x49e828
mov eax, edi
push eax
mov ecx, 0x4c6048
call fcn.0042f1f0
xor eax, eax
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x418
ret
mov ecx, dword [esp + 0x1c]
mov ebx, dword [esp + 0x24]
mov eax, 1
add dword [0x4c58e8], eax
mov byte [ecx], 4
mov byte [ebx + 0x4c58d8], al
mov dl, byte [esp + 0x17]
cmp byte [esp + 0x42c], 0
je 0x40baa2
test ebp, ebp
je 0x40badf
mov cx, word [esp + 0x18]
mov byte [ebp + 0x13], bl
mov word [ebp + 0xa], cx
mov eax, 1
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x418
ret
test ebp, ebp
je 0x40badf
mov ax, word [esp + 0x18]
mov word [ebp + 8], ax
mov al, dl
and al, 0xd5
xor ecx, ecx
mov byte [ebp + 0x12], bl
test al, 0xc0
je 0x40bac1
mov ecx, 8
test al, 0xc
je 0x40bac8
or ecx, 1
test al, 0x30
je 0x40bacf
or ecx, 4
test al, 3
je 0x40bad6
or ecx, 2
or dword [ebp + 0xc], ecx
and dl, 0x2a
or byte [ebp + 0x10], dl
pop edi
pop esi
pop ebp
mov eax, 1
pop ebx
add esp, 0x418
ret