Function at 0x40c8b0
Capabilities:
Get keyboard layout

Disassembly:
sub esp, 0x40c
push ebx
push ebp
mov ebp, dword [esp + 0x420]
push esi
push edi
xor edi, edi
mov esi, ecx
mov byte [esp + 0x12], 0
test ebp, ebp
je 0x40c8d7
lea eax, [ebp + 0x12]
mov dword [esp + 0x14], eax
jmp 0x40c8df
lea ecx, [esp + 0x13]
mov dword [esp + 0x14], ecx
cmp byte [esp + 0x424], 0
jne 0x40c931
mov ebx, 0x4a681c
mov eax, esi
call fcn.00409e00
mov ebx, eax
test ebx, ebx
je 0x40c931
mov ecx, ebx
lea ecx, [ecx]
movzx eax, word [ecx]
cmp eax, 0x20
je 0x40c90d
cmp eax, 9
jne 0x40c912
add ecx, 2
jmp 0x40c900
push 0x4a3ecc
push ecx
call fcn.00490459
add esp, 8
test eax, eax
jne 0x40c931
test ebp, ebp
je 0x40c92c
mov byte [ebp + 0x16], 1
xor edx, edx
mov word [ebx], dx
push 0
call dword [sym.imp.USER32.dll_GetKeyboardLayout]
push eax
push 1
lea ecx, [esp + 0x1a]
mov eax, esi
call fcn.00414420
mov bl, al
add esp, 8
mov byte [esp + 0x13], bl
test bl, bl
je 0x40ca3b
cmp byte [esp + 0x424], 0
je 0x40c9dd
lea eax, [ebx + 0x64]
cmp al, 3
ja 0x40c9f9
cmp byte [esp + 0x42c], 0
je 0x40c99b
mov ecx, dword [0x4cacf4]
push 1
push 0
push 0xffffffffffffffff
push 0x4a6824
push ecx
call fcn.00479c20
pop edi
pop esi
pop ebp
xor eax, eax
pop ebx
add esp, 0x40c
ret
push esi
push 0x4a6828
mov esi, 0x200
lea edi, [esp + 0x24]
call fcn.00476ad0
mov edx, dword [esp + 0x428]
add esp, 8
push edx
mov eax, edi
push eax
mov ecx, 0x4cb490
call fcn.00430b90
test ebp, ebp
jne 0x40ca8d
pop edi
pop esi
lea eax, [ebp + 4]
pop ebp
pop ebx
add esp, 0x40c
ret
test ebp, ebp
je 0x40c9f9
push 2
push 0x4a6874
push esi
call fcn.0049065d
add esp, 0xc
test eax, eax
sete cl
mov byte [ebp + 0x17], cl
lea edx, [ebx - 1]
cmp dl, 5
ja 0x40ca06
cmp bl, 3
jne 0x40ca0d
lea eax, [ebx + 0x66]
cmp al, 5
ja 0x40ca11
mov al, 1
jmp 0x40ca13
xor al, al
mov dl, byte [esp + 0x12]
test dl, 0x30
je 0x40ca27
lea ecx, [ebx - 0x41]
cmp cl, 0x19
ja 0x40ca27
and dl, 0xcf
test al, al
je 0x40cb23
mov eax, dword [esp + 0x14]
mov byte [eax], 2
jmp 0x40cb23
xor ebx, ebx
mov eax, esi
call fcn.00414360
movzx edi, ax
test di, di
jne 0x40cb1b
push 1
lea ebx, [esp + 0x1c]
mov eax, esi
call fcn.00451c70
movzx edi, ax
add esp, 4
test di, di
jne 0x40cafb
cmp byte [esp + 0x42c], 0
je 0x40ca9a
mov edx, dword [0x4cacf4]
push 1
push 0
push 0xffffffffffffffff
push 0x4a687c
push edx
call fcn.00479c20
pop edi
pop esi
pop ebp
xor eax, eax
pop ebx
add esp, 0x40c
ret
cmp word [esi + 2], 0
jne 0x40cac1
cmp byte [0x4cbf74], 0
jne 0x40cac1
mov eax, ebp
neg eax
pop edi
sbb eax, eax
pop esi
and eax, 0xfffffffd
pop ebp
add eax, 3
pop ebx
add esp, 0x40c
ret
test ebp, ebp
je 0x40caee
push esi
push 0x4a6880
mov esi, 0x200
lea edi, [esp + 0x24]
call fcn.00476ad0
add esp, 8
push 0x4a3910
mov eax, edi
push eax
mov ecx, 0x4cb490
call fcn.00430b90
pop edi
pop esi
pop ebp
xor eax, eax
pop ebx
add esp, 0x40c
ret
mov edx, dword [esp + 0x14]
mov eax, dword [esp + 0x18]
mov ecx, 1
add dword [0x4cad5c], ecx
mov byte [edx], 4
mov byte [eax + 0x4cad4c], cl
mov bl, al
jmp 0x40cb1f
mov bl, byte [esp + 0x13]
mov dl, byte [esp + 0x12]
cmp byte [esp + 0x424], 0
je 0x40cb48
test ebp, ebp
je 0x40cb80
mov word [ebp + 0xa], di
pop edi
pop esi
mov byte [ebp + 0x11], bl
pop ebp
mov eax, 1
pop ebx
add esp, 0x40c
ret
test ebp, ebp
je 0x40cb80
mov al, dl
and al, 0xd5
xor ecx, ecx
mov byte [ebp + 0x10], bl
mov word [ebp + 8], di
test al, 0xc0
je 0x40cb62
mov ecx, 8
test al, 0xc
je 0x40cb69
or ecx, 1
test al, 0x30
je 0x40cb70
or ecx, 4
test al, 3
je 0x40cb77
or ecx, 2
or dword [ebp], ecx
and dl, 0x2a
or byte [ebp + 0xe], dl
pop edi
pop esi
pop ebp
mov eax, 1
pop ebx
add esp, 0x40c
ret