Function at 0x40bb40
Capabilities:
Get keyboard layout

Disassembly:
sub esp, 0x214
push ebx
push ebp
mov ebp, dword [esp + 0x220]
push esi
mov esi, dword [esp + 0x230]
push edi
mov dword [esp + 0x14], 0
mov byte [esp + 0x13], 0
test esi, esi
je 0x40bb72
lea eax, [esi + 0x14]
mov dword [esp + 0x18], eax
jmp 0x40bb7a
lea ecx, [esp + 0x1f]
mov dword [esp + 0x18], ecx
cmp byte [esp + 0x230], 0
jne 0x40bbc2
mov edi, 0x499ff4
mov eax, ebp
call fcn.00409440
mov edi, eax
test edi, edi
je 0x40bbc2
mov ecx, edi
mov al, byte [ecx]
cmp al, 0x20
je 0x40bba2
cmp al, 9
jne 0x40bba5
inc ecx
jmp 0x40bb98
push 0x498ac8
push ecx
call fcn.004850c1
add esp, 8
test eax, eax
jne 0x40bbc2
test esi, esi
je 0x40bbbf
mov byte [esi + 0x18], 1
mov byte [edi], 0
push 0
call dword [sym.imp.USER32.dll_GetKeyboardLayout]
mov dl, byte [ebp]
test dl, dl
jne 0x40bbd8
xor bl, bl
jmp 0x40bcaa
cmp byte [ebp + 1], 0
jne 0x40bc40
mov ecx, eax
lea esi, [esp + 0x13]
mov al, dl
call fcn.00411f00
mov bl, al
test bl, bl
je 0x40bca3
cmp byte [esp + 0x230], 0
je 0x40bd64
lea eax, [ebx + 0x64]
cmp al, 3
ja 0x40bd87
cmp byte [esp + 0x238], 0
je 0x40bd1e
mov ecx, dword [0x4aa51c]
push 1
push 0
push 0xffffffffffffffff
push 0x499ff8
push ecx
call fcn.00474fa0
pop edi
pop esi
pop ebp
xor eax, eax
pop ebx
add esp, 0x214
ret
movzx esi, dl
test esi, 0xffffff80
jne 0x40bc5d
push 2
push esi
call fcn.004865fe
add esp, 8
test eax, eax
je 0x40bc5d
and esi, 0xffffffdf
mov eax, esi
cmp al, 0x56
jne 0x40bc84
mov al, byte [ebp + 1]
call fcn.00409410
cmp al, 0x4b
jne 0x40bc84
push 0x10
lea edx, [ebp + 2]
push 0
push edx
call fcn.00486a44
add esp, 0xc
jmp 0x40bbeb
xor esi, esi
mov eax, dword [esi*8 + 0x4a7180]
push ebp
push eax
call fcn.004850c1
add esp, 8
test eax, eax
je 0x40bd12
inc esi
cmp esi, 0x6d
jl 0x40bc86
xor bl, bl
mov esi, dword [esp + 0x234]
mov eax, ebp
call fcn.00411da0
movzx eax, ax
mov dword [esp + 0x14], eax
test ax, ax
jne 0x40be4c
push 1
lea ebx, [esp + 0x24]
mov eax, ebp
call fcn.0044e620
movzx eax, ax
add esp, 4
mov dword [esp + 0x14], eax
test ax, ax
jne 0x40be30
cmp byte [esp + 0x238], al
je 0x40bdd0
mov edx, dword [0x4aa51c]
push 1
push 0
push 0xffffffffffffffff
push 0x49a028
push edx
call fcn.00474fa0
pop edi
pop esi
pop ebp
xor eax, eax
pop ebx
add esp, 0x214
ret
mov bl, byte [esi*8 + 0x4a7184]
jmp 0x40bbed
push ebp
push str.__s__is_not_allowed_as_a_prefix_key.
mov esi, 0x200
lea edi, [esp + 0x2c]
call fcn.00472330
mov edx, dword [esp + 0x234]
add esp, 8
push edx
mov eax, edi
push eax
mov ecx, 0x4abd80
call fcn.0042e860
cmp dword [esp + 0x234], 0
jne 0x40bd05
pop edi
pop esi
pop ebp
mov eax, 4
pop ebx
add esp, 0x214
ret
mov esi, dword [esp + 0x234]
test esi, esi
je 0x40bd87
push 2
push 0x49a024
push ebp
call fcn.00485b40
add esp, 0xc
test eax, eax
sete cl
mov byte [esi + 0x19], cl
lea edx, [ebx - 1]
cmp dl, 5
ja 0x40bd94
cmp bl, 3
jne 0x40bd9b
lea eax, [ebx + 0x66]
cmp al, 5
ja 0x40bd9f
mov al, 1
jmp 0x40bda1
xor al, al
mov dl, byte [esp + 0x13]
test dl, 0x30
je 0x40bdb5
lea ecx, [ebx - 0x41]
cmp cl, 0x19
ja 0x40bdb5
and dl, 0xcf
mov esi, dword [esp + 0x234]
test al, al
je 0x40be50
mov eax, dword [esp + 0x18]
mov byte [eax], 2
jmp 0x40be50
cmp byte [ebp + 1], 0
jne 0x40bdf6
cmp byte [0x4ac380], 0
jne 0x40bdf6
mov eax, esi
neg eax
pop edi
sbb eax, eax
pop esi
and eax, 0xfffffffd
pop ebp
add eax, 3
pop ebx
add esp, 0x214
ret
test esi, esi
je 0x40be23
push ebp
push str.__s__is_not_a_valid_key_name.
mov esi, 0x200
lea edi, [esp + 0x2c]
call fcn.00472330
add esp, 8
push 0x498831
mov eax, edi
push eax
mov ecx, 0x4abd80
call fcn.0042e860
pop edi
pop esi
pop ebp
xor eax, eax
pop ebx
add esp, 0x214
ret
mov ecx, dword [esp + 0x18]
mov ebx, dword [esp + 0x20]
mov eax, 1
add dword [0x4ab614], eax
mov byte [ecx], 4
mov byte [ebx + 0x4ab604], al
mov dl, byte [esp + 0x13]
cmp byte [esp + 0x230], 0
je 0x40be7a
test esi, esi
je 0x40beb7
mov cx, word [esp + 0x14]
pop edi
mov byte [esi + 0x13], bl
mov word [esi + 0xa], cx
pop esi
pop ebp
mov eax, 1
pop ebx
add esp, 0x214
ret
test esi, esi
je 0x40beb7
mov ax, word [esp + 0x14]
mov word [esi + 8], ax
mov al, dl
and al, 0xd5
xor ecx, ecx
mov byte [esi + 0x12], bl
test al, 0xc0
je 0x40be99
mov ecx, 8
test al, 0xc
je 0x40bea0
or ecx, 1
test al, 0x30
je 0x40bea7
or ecx, 4
test al, 3
je 0x40beae
or ecx, 2
or dword [esi + 0xc], ecx
and dl, 0x2a
or byte [esi + 0x10], dl
pop edi
pop esi
pop ebp
mov eax, 1
pop ebx
add esp, 0x214
ret