Function at 0x40b700
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 0x40b72e
lea eax, [esi + 0x14]
mov dword [esp + 0x34], eax
jmp 0x40b736
lea ecx, [esp + 0x3b]
mov dword [esp + 0x34], ecx
cmp byte [ebp + 8], 0
jne 0x40b78b
mov ebx, 0x49f4d4
mov eax, edi
call fcn.00409140
mov esi, eax
test esi, esi
je 0x40b788
mov ecx, esi
movzx eax, word [ecx]
cmp eax, 0x20
je 0x40b75d
cmp eax, 9
jne 0x40b762
add ecx, 2
jmp 0x40b750
push 0x49cd18
push ecx
call fcn.00488ac9
add esp, 8
test eax, eax
jne 0x40b788
mov eax, dword [ebp + 0xc]
test eax, eax
je 0x40b77f
mov byte [eax + 0x18], 1
xor edx, edx
mov word [esi], dx
mov esi, eax
jmp 0x40b78b
mov esi, dword [ebp + 0xc]
push 0
call dword [sym.imp.USER32.dll_GetKeyboardLayout]
movzx edx, word [edi]
test dx, dx
jne 0x40b7a2
xor bl, bl
jmp 0x40b867
cmp word [edi + 2], 0
jne 0x40b7ff
mov ecx, eax
lea esi, [esp + 0x2f]
mov eax, edx
call fcn.00411c10
mov bl, al
test bl, bl
je 0x40b864
cmp byte [ebp + 8], 0
je 0x40b934
lea edx, [ebx + 0x64]
cmp dl, 3
ja 0x40b953
cmp byte [ebp + 0x10], 0
je 0x40b8d2
mov ecx, dword [0x4c264c]
push 1
push 0
push 0xffffffffffffffff
push 0x49f4dc
call fcn.00472870
xor eax, eax
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
mov esi, edx
test esi, 0xffffff80
jne 0x40b81b
push 2
push esi
call fcn.00489d0e
add esp, 8
test eax, eax
je 0x40b81b
and esi, 0xffffffdf
cmp si, 0x56
jne 0x40b845
mov ax, word [edi + 2]
call fcn.00409110
cmp ax, 0x4b
jne 0x40b845
push 0x10
lea eax, [edi + 4]
push 0
push eax
call fcn.0048a0eb
add esp, 0xc
jmp 0x40b7b6
xor esi, esi
mov ecx, dword [esi*8 + 0x4bf1f0]
push edi
push ecx
call fcn.00488ac9
add esp, 8
test eax, eax
je 0x40b8c6
inc esi
cmp esi, 0x6d
jl 0x40b847
xor bl, bl
mov esi, dword [ebp + 0xc]
mov eax, edi
call fcn.00411ab0
movzx eax, ax
mov dword [esp + 0x30], eax
test ax, ax
jne 0x40b9e3
push 1
lea ebx, [esp + 0x40]
mov eax, edi
call fcn.0044e080
movzx eax, ax
add esp, 4
mov dword [esp + 0x30], eax
test ax, ax
jne 0x40b9c7
cmp byte [ebp + 0x10], al
je 0x40b991
mov ecx, dword [0x4c264c]
push 1
push 0
push 0xffffffffffffffff
push 0x49f534
call fcn.00472870
xor eax, eax
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
mov bl, byte [esi*8 + 0x4bf1f4]
jmp 0x40b7b8
push edi
push 0x49f4e0
mov esi, 0x200
lea edi, [esp + 0x48]
call fcn.0046fd90
add esp, 8
cmp byte [0x4c4a5c], 0
je 0x40b90d
push 0x49c820
mov eax, edi
push eax
mov ecx, 0x4c3fc0
call fcn.0042f410
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.00474360
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 0x40b953
push 2
push 0x49f52c
push edi
call fcn.00489302
add esp, 0xc
test eax, eax
sete dl
mov byte [esi + 0x19], dl
lea eax, [ebx - 1]
cmp al, 5
ja 0x40b95f
cmp bl, 3
jne 0x40b967
lea ecx, [ebx + 0x66]
cmp cl, 5
ja 0x40b96b
mov al, 1
jmp 0x40b96d
xor al, al
mov dl, byte [esp + 0x2f]
test dl, 0x30
je 0x40b981
lea ecx, [ebx - 0x41]
cmp cl, 0x19
ja 0x40b981
and dl, 0xcf
mov esi, dword [ebp + 0xc]
test al, al
je 0x40b9e7
mov eax, dword [esp + 0x34]
mov byte [eax], 2
jmp 0x40b9e7
test esi, esi
je 0x40b9be
push edi
push 0x49f538
mov esi, 0x200
lea edi, [esp + 0x48]
call fcn.0046fd90
add esp, 8
push 0x49c820
mov edx, edi
push edx
mov ecx, 0x4c3fc0
call fcn.0042f410
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 [0x4c3848], eax
mov byte [ecx], 4
mov byte [ebx + 0x4c3838], al
mov dl, byte [esp + 0x2f]
cmp byte [ebp + 8], 0
je 0x40ba09
test esi, esi
je 0x40ba46
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 0x40ba46
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 0x40ba28
mov ecx, 8
test al, 0xc
je 0x40ba2f
or ecx, 1
test al, 0x30
je 0x40ba36
or ecx, 4
test al, 3
je 0x40ba3d
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