Function at 0x415b30
Capabilities:
Get keyboard layout

Disassembly:
sub esp, 0x4c
push ebx
push ebp
mov ebp, dword [esp + 0x58]
mov bl, dl
push esi
push edi
mov edi, ecx
mov byte [esp + 0x12], bl
mov byte [esp + 0x11], 0
mov esi, edi
nop word [eax + eax]
movzx eax, word [esi]
cmp eax, 0x7f
ja 0x415b6b
push eax
call fcn.004a31c0
add esp, 4
test eax, eax
jne 0x415b6b
cmp word [esi], 0x5f
jne 0x415b70
add esi, 2
jmp 0x415b50
cmp esi, edi
jne 0x415b7d
cmp word [edi], 0
je 0x415b7d
add esi, 2
test bl, bl
jne 0x415bf4
movzx ecx, word [esi]
cmp ecx, 0x20
je 0x415b8e
cmp ecx, 9
jne 0x415bf4
mov eax, esi
cmp cx, 0x20
je 0x415b9c
cmp cx, 9
jne 0x415ba5
movzx ecx, word [eax + 2]
add eax, 2
jmp 0x415b90
push 0x4d351c
push eax
call fcn.0049ee91
add esp, 8
test eax, eax
jne 0x415bf4
cmp byte [esp + 0x64], al
jne 0x415dc5
test ebp, ebp
je 0x415bc9
mov byte [ebp + 0x16], 1
push 0x1f
lea eax, [esp + 0x1c]
push edi
push eax
call fcn.004aa484
sub esi, edi
xor eax, eax
sar esi, 1
add esp, 0xc
mov word [esp + 0x56], ax
cmp esi, 0x20
jae 0x415bee
mov word [esp + esi*2 + 0x18], ax
lea edi, [esp + 0x18]
jmp 0x415c2f
cmp word [esi], 0
je 0x415c24
test ebp, ebp
je 0x415c17
push 0
mov edx, edi
mov ecx, 0x4d401c
call fcn.0040dc30
add esp, 4
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x4c
ret
mov eax, 4
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x4c
ret
cmp byte [esp + 0x64], 0
jne 0x415dc5
lea esi, [ebp + 0x12]
test ebp, ebp
jne 0x415c3a
lea esi, [esp + 0x13]
push 0
call dword [sym.imp.USER32.dll_GetKeyboardLayout]
push eax
push ecx
push 1
lea edx, [esp + 0x1d]
mov ecx, edi
call fcn.0041cb70
mov bl, al
add esp, 0xc
test bl, bl
je 0x415ceb
cmp byte [esp + 0x12], 0
je 0x415c86
lea ecx, [ebx + 0x64]
cmp cl, 3
ja 0x415ca2
push 0
mov edx, edi
mov ecx, 0x4d412c
call fcn.0040dc30
add esp, 4
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x4c
ret
test ebp, ebp
je 0x415ca2
push 2
push 0x4d415c
push edi
call fcn.0049f012
add esp, 0xc
test eax, eax
sete al
mov byte [ebp + 0x17], al
mov al, bl
dec al
cmp al, 5
ja 0x415caf
cmp bl, 3
jne 0x415cb7
mov al, bl
add al, 0x66
cmp al, 5
ja 0x415cbb
mov dl, 1
jmp 0x415cbd
xor dl, dl
mov cl, byte [esp + 0x11]
mov byte [esp + 0x11], cl
test cl, 0x30
je 0x415cd9
mov al, bl
sub al, 0x41
cmp al, 0x19
ja 0x415cd9
and cl, 0xcf
mov byte [esp + 0x11], cl
xor eax, eax
test dl, dl
je 0x415dda
mov byte [esi], 2
jmp 0x415dda
xor edx, edx
mov ecx, edi
call fcn.0041cab0
movzx eax, ax
test ax, ax
jne 0x415dd2
push 1
lea edx, [esp + 0x18]
mov ecx, edi
call fcn.00454840
movzx eax, ax
add esp, 4
test ax, ax
jne 0x415d53
cmp word [edi + 2], ax
jne 0x415d3a
cmp byte [0x4ea604], al
jne 0x415d3a
xor eax, eax
mov ecx, 3
test ebp, ebp
cmove eax, ecx
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x4c
ret
push 0
mov edx, edi
mov ecx, 0x4d4164
call fcn.0040dc30
add esp, 4
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x4c
ret
cmp byte [esp + 0x12], 0
jne 0x415c6d
mov ebx, dword [esp + 0x14]
mov cl, byte [esp + 0x11]
inc dword [0x4e9048]
mov byte [esi], 4
mov byte [ebx + 0x4e9030], 1
mov byte [esp + 0x11], cl
test ebp, ebp
je 0x415dc5
mov word [ebp + 8], ax
mov byte [ebp + 0x10], bl
mov bl, cl
and bl, 0xd5
mov al, bl
and al, 0xc0
movzx ecx, al
neg ecx
sbb ecx, ecx
and ecx, 8
mov edx, ecx
or edx, 1
test bl, 0xc
cmove edx, ecx
mov ecx, edx
or ecx, 4
test bl, 0x30
cmove ecx, edx
mov eax, ecx
or eax, 2
test bl, 3
cmove eax, ecx
or dword [ebp], eax
mov al, byte [esp + 0x11]
and al, 0x2a
or byte [ebp + 0xe], al
mov eax, 1
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x4c
ret
mov cl, byte [esp + 0x11]
mov byte [esp + 0x11], cl
cmp byte [esp + 0x12], 0
je 0x415d7a
test ebp, ebp
je 0x415dc5
pop edi
pop esi
mov byte [ebp + 0x11], bl
mov word [ebp + 0xa], ax
mov eax, 1
pop ebp
pop ebx
add esp, 0x4c
ret