Function at 0x415940
Capabilities:
Get keyboard layout

Disassembly:
sub esp, 0x410
push ebx
push ebp
mov ebp, dword [esp + 0x424]
push esi
push edi
xor edi, edi
mov esi, ecx
mov byte [esp + 0x13], 0
test ebp, ebp
je 0x415967
lea eax, [ebp + 0x12]
mov dword [esp + 0x14], eax
jmp 0x41596f
lea ecx, [esp + 0x1b]
mov dword [esp + 0x14], ecx
cmp byte [esp + 0x428], 0
jne 0x4159c2
mov ebx, 0x4bfcf4
mov eax, esi
call fcn.00405590
mov ebx, eax
test ebx, ebx
je 0x4159c2
mov ecx, ebx
lea ecx, [ecx]
movzx eax, word [ecx]
cmp eax, 0x20
je 0x41599d
cmp eax, 9
jne 0x4159a2
add ecx, 2
jmp 0x415990
push 0x4bd3c0
push ecx
call dword [sym.imp.MSVCR100.dll__wcsicmp]
add esp, 8
test eax, eax
jne 0x4159c2
test ebp, ebp
je 0x4159bd
mov byte [ebp + 0x16], 1
xor edx, edx
mov word [ebx], dx
push 0
call dword [sym.imp.USER32.dll_GetKeyboardLayout]
push eax
lea eax, [esp + 0x17]
push 1
push eax
mov eax, esi
call fcn.0041c480
mov bl, al
add esp, 0xc
test bl, bl
je 0x415acb
cmp byte [esp + 0x428], 0
je 0x415a6c
lea ecx, [ebx + 0x64]
cmp cl, 3
ja 0x415a89
cmp byte [esp + 0x430], 0
je 0x415a2a
mov edx, dword [0x4e86f0]
push 1
push 0
push 0xffffffffffffffff
push 0x4bfcfc
push edx
call fcn.004a2810
pop edi
pop esi
pop ebp
xor eax, eax
pop ebx
add esp, 0x410
ret
push esi
push 0x4bfd00
mov esi, 0x200
lea edi, [esp + 0x28]
call fcn.0049e5c0
mov eax, dword [esp + 0x42c]
add esp, 8
push eax
mov ecx, edi
push ecx
mov ecx, 0x4ea1d0
call fcn.00449df0
test ebp, ebp
jne 0x415b1b
pop edi
pop esi
lea eax, [ebp + 4]
pop ebp
pop ebx
add esp, 0x410
ret
test ebp, ebp
je 0x415a89
push 2
push 0x4bfd4c
push esi
call dword [sym.imp.MSVCR100.dll__wcsnicmp]
add esp, 0xc
test eax, eax
sete dl
mov byte [ebp + 0x17], dl
lea eax, [ebx - 1]
cmp al, 5
ja 0x415a95
cmp bl, 3
jne 0x415a9d
lea ecx, [ebx + 0x66]
cmp cl, 5
ja 0x415aa1
mov al, 1
jmp 0x415aa3
xor al, al
mov dl, byte [esp + 0x13]
test dl, 0x30
je 0x415ab7
lea ecx, [ebx - 0x41]
cmp cl, 0x19
ja 0x415ab7
and dl, 0xcf
test al, al
je 0x415ba5
mov eax, dword [esp + 0x14]
mov byte [eax], 2
jmp 0x415ba5
mov eax, esi
call fcn.0041c3c0
movzx edi, ax
test di, di
jne 0x415ba1
lea edx, [esp + 0x1c]
push 1
push edx
mov eax, esi
call fcn.0046f2c0
movzx edi, ax
add esp, 8
test di, di
jne 0x415b89
cmp byte [esp + 0x430], 0
je 0x415b28
mov eax, dword [0x4e86f0]
push 1
push 0
push 0xffffffffffffffff
push 0x4bfd54
push eax
call fcn.004a2810
pop edi
pop esi
pop ebp
xor eax, eax
pop ebx
add esp, 0x410
ret
cmp word [esi + 2], 0
jne 0x415b4f
cmp byte [0x4eacc4], 0
jne 0x415b4f
mov eax, ebp
neg eax
pop edi
sbb eax, eax
pop esi
and eax, 0xfffffffd
pop ebp
add eax, 3
pop ebx
add esp, 0x410
ret
test ebp, ebp
je 0x415b7c
push esi
push 0x4bfd58
mov esi, 0x200
lea edi, [esp + 0x28]
call fcn.0049e5c0
add esp, 8
push 0x4bd2c4
mov ecx, edi
push ecx
mov ecx, 0x4ea1d0
call fcn.00449df0
pop edi
pop esi
pop ebp
xor eax, eax
pop ebx
add esp, 0x410
ret
mov edx, dword [esp + 0x14]
mov ebx, dword [esp + 0x1c]
inc dword [0x4e8988]
mov byte [edx], 4
mov byte [ebx + 0x4e8978], 1
mov dl, byte [esp + 0x13]
cmp byte [esp + 0x428], 0
je 0x415bca
test ebp, ebp
je 0x415c02
mov word [ebp + 0xa], di
pop edi
pop esi
mov byte [ebp + 0x11], bl
pop ebp
mov eax, 1
pop ebx
add esp, 0x410
ret
test ebp, ebp
je 0x415c02
mov al, dl
and al, 0xd5
xor ecx, ecx
mov byte [ebp + 0x10], bl
mov word [ebp + 8], di
test al, 0xc0
je 0x415be4
mov ecx, 8
test al, 0xc
je 0x415beb
or ecx, 1
test al, 0x30
je 0x415bf2
or ecx, 4
test al, 3
je 0x415bf9
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, 0x410
ret