Function at 0x418730
Capabilities:
Get keyboard layout

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x1c
push esi
mov esi, dword [ebp + 0x10]
test esi, esi
jne 0x418745
xor eax, eax
pop esi
mov esp, ebp
pop ebp
ret
push ebx
mov ebx, dword [esi]
call fcn.00417f60
mov eax, dword [ebp + 8]
test eax, eax
js 0x418bba
cmp ebx, 0xe7
je 0x418bba
push edi
call fcn.004180e0
push dword [0x4dfeb0]
call dword [sym.imp.USER32.dll_GetKeyboardLayout]
mov edi, eax
mov eax, dword [0x4dfd9c]
cmp edi, eax
je 0x41878f
cmp edi, dword [0x4dfd98]
cmovne eax, edi
mov dword [0x4dfd9c], eax
push esi
call fcn.00417bb0
add esp, 4
test eax, eax
jne 0x418b96
push esi
call fcn.004179c0
add esp, 4
test eax, eax
jne 0x418b96
mov eax, dword [0x4dfda0]
cmp dword [eax], 0
jne 0x4188ab
cmp dword [eax + 0x10], 0
je 0x4187cf
cmp dword [eax + 0x18], 0
jne 0x4188ab
mov ecx, dword [ebp + 8]
test ecx, ecx
jne 0x418ba0
test byte [esi + 8], 0x80
jne 0x418ba0
mov ecx, dword [0x4dfd98]
cmp edi, ecx
jne 0x418ba0
test edi, edi
je 0x418ba0
cmp dword [0x4dff5c], 0
mov eax, dword [0x4dfd9c]
mov dword [ebp - 0xc], eax
je 0x418834
test eax, eax
je 0x41883c
cmp eax, ecx
je 0x418834
push 0
push eax
call dword [sym.imp.USER32.dll_ActivateKeyboardLayout]
mov eax, dword [0x4dfd9c]
mov ecx, dword [0x4dfd98]
mov dword [0x4dff5c], 0
mov dword [ebp - 0xc], eax
test eax, eax
je 0x41883c
cmp eax, ecx
jne 0x418844
mov eax, dword [0x4dfd94]
mov dword [ebp - 0xc], eax
push ecx
push 0
lea eax, [ebp - 8]
push eax
push 0x4dfda8
push dword [esi + 4]
mov esi, dword [sym.imp.USER32.dll_ToAsciiEx]
push ebx
call esi
push dword [ebp - 0xc]
mov edi, eax
lea eax, [ebp - 4]
push 0
push eax
mov eax, dword [ebp + 0x10]
push 0x4dfda8
push dword [eax + 4]
push ebx
call esi
cmp edi, 1
jne 0x418b91
cmp eax, edi
jne 0x418b91
mov al, byte [ebp - 8]
cmp al, byte [ebp - 4]
je 0x418b91
push edi
lea eax, [ebp - 4]
push eax
call fcn.004193f0
add esp, 8
pop edi
pop ebx
mov eax, 1
pop esi
mov esp, ebp
pop ebp
ret
mov ecx, dword [ebp + 8]
test ecx, ecx
jne 0x418ba0
test byte [esi + 8], 0x80
jne 0x418ba0
mov eax, dword [eax + 0x840]
cmp eax, 4
je 0x4188ef
cmp eax, 5
je 0x4188ef
cmp dword [0x4dff5c], ecx
je 0x4188ef
push ecx
push dword [0x4dfd9c]
call dword [sym.imp.USER32.dll_ActivateKeyboardLayout]
mov dword [0x4dff5c], 0
mov dl, byte [0x4dff39]
mov cl, byte [0x4dff3a]
test dl, dl
jne 0x41890b
test cl, cl
jne 0x41890b
cmp byte [0x4dff3e], cl
je 0x418934
mov al, byte [0x4ce5d8]
cmp edi, dword [0x4dfd94]
je 0x418b5c
test dl, dl
je 0x418b5c
test cl, cl
je 0x418b5c
test al, al
je 0x418b5c
push edi
push 0
lea eax, [ebp - 0x10]
push eax
push 0x4dfda8
push dword [esi + 4]
push ebx
call dword [sym.imp.USER32.dll_ToAsciiEx]
mov dword [ebp - 0xc], eax
cmp eax, 1
jne 0x4189ae
mov ecx, dword [0x4dfd94]
test ecx, ecx
je 0x4189ae
mov eax, dword [0x4dfd98]
test eax, eax
je 0x4189ae
cmp byte [0x4dff39], 0
jne 0x4189ae
cmp byte [0x4dff3a], 0
jne 0x4189ae
cmp edi, eax
jne 0x4189ae
push ecx
push 0
lea eax, [ebp + 0x10]
push eax
push 0x4dfda8
push dword [esi + 4]
push ebx
call dword [sym.imp.USER32.dll_ToAsciiEx]
cmp eax, 1
jne 0x4189ae
mov ax, word [ebp + 0x10]
mov ecx, dword [ebp - 0x10]
cmp al, cl
je 0x4189b1
movzx ecx, ax
mov edi, 1
mov dword [ebp - 0x10], ecx
jmp 0x4189b3
mov ecx, dword [ebp - 0x10]
xor edi, edi
cmp byte [0x4df565], 0
je 0x418a1c
cmp ebx, 8
je 0x418b05
movzx eax, byte [0x4ce5d9]
cmp ebx, eax
je 0x418b05
movzx eax, byte [0x4ce5da]
cmp ebx, eax
je 0x418b05
cmp dword [0x4e1fa8], 0x80
jae 0x418b05
mov eax, dword [ebp - 0xc]
test eax, eax
lea eax, [ebp - 0x1c]
mov byte [ebp - 0x1c], cl
push eax
mov ecx, 0x4e1f98
mov dword [ebp - 0x18], ebx
sets byte [ebp - 0x14]
call fcn.0041d660
pop edi
pop ebx
mov eax, 1
pop esi
mov esp, ebp
pop ebp
ret
mov eax, dword [ebp - 0xc]
cmp eax, 1
je 0x418ab3
test eax, eax
js 0x418ab3
cmp ebx, 0x10
je 0x418ba0
cmp ebx, 0xa0
je 0x418ba0
cmp ebx, 0xa1
je 0x418ba0
cmp ebx, 0x2d
je 0x418ba0
cmp ebx, 0x12
je 0x418ba0
cmp ebx, 0xa4
je 0x418ba0
cmp ebx, 0xa5
je 0x418ba0
cmp ebx, 0x11
je 0x418ba0
cmp ebx, 0xa2
je 0x418ba0
cmp ebx, 0xa3
je 0x418ba0
cmp byte [0x4ce5d8], 0
je 0x418ba0
call fcn.00419040
jmp 0x418ba0
lea eax, [ebx - 0x60]
mov byte [ebp + 0x13], cl
cmp eax, 9
ja 0x418ace
movzx eax, cl
mov ecx, 0x4dff60
push eax
call fcn.00496920
jmp 0x418b3d
mov dword [0x4dfd8c], 0x400
push 0x4dfd90
push 0x4dfd8c
push 0x4df588
push 0x4dfd88
cmp ebx, 8
jne 0x418b1e
mov ecx, 0x4dff60
call fcn.00496aa0
mov eax, dword [0x4dfd88]
cmp eax, 1
jne 0x418b31
push esi
push dword [ebp + 0xc]
push 0
push dword [0x4df568]
call dword [sym.imp.USER32.dll_CallNextHookEx]
pop edi
pop ebx
pop esi
mov esp, ebp
pop ebp
ret
movzx eax, cl
mov ecx, 0x4dff60
push eax
call fcn.00496a40
mov eax, dword [0x4dfd88]
test eax, eax
jne 0x418b4b
cmp dword [0x4dfd8c], eax
jne 0x418b4b
test edi, edi
je 0x418ba0
push 1
lea eax, [ebp + 0x13]
jmp 0x418896
call fcn.00418d70
pop edi
pop ebx
mov eax, 1
pop esi
mov esp, ebp
pop ebp
ret
cmp ebx, 0x12
je 0x418ba0
cmp ebx, 0xa4
je 0x418ba0
cmp ebx, 0xa5
je 0x418ba0
cmp ebx, 0x11
je 0x418ba0
cmp ebx, 0xa2
je 0x418ba0
cmp ebx, 0xa3
je 0x418ba0
test al, al
je 0x418ba0
call fcn.00419040
jmp 0x418ba0
mov esi, dword [ebp + 0x10]
jmp 0x418ba0
test byte [esi + 8], 0x80
je 0x41889f
push esi
push dword [ebp + 0xc]
push dword [ebp + 8]
push dword [0x4df568]
call dword [sym.imp.USER32.dll_CallNextHookEx]
pop edi
pop ebx
pop esi
mov esp, ebp
pop ebp
ret
push esi
push dword [ebp + 0xc]
push eax
push dword [0x4df568]
call dword [sym.imp.USER32.dll_CallNextHookEx]
pop ebx
pop esi
mov esp, ebp
pop ebp
ret