Function at 0x413791
Capabilities:
Get keyboard layout

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x2a0
mov eax, dword [0x5836e0]
xor eax, ebp
mov dword [ebp - 4], eax
mov eax, dword [0x5a23ec]
push ebx
mov ebx, dword [ebp + 8]
push esi
test byte [eax + 0x113c9], 1
push edi
mov edi, ecx
mov dword [ebp - 0x2a0], ebx
mov dword [ebp - 0x298], edi
je 0x413d4d
push ebx
call fcn.004d825d
pop ecx
test al, al
je 0x413d4d
mov esi, dword [ebp + 0xc]
test esi, esi
jne 0x413814
movzx eax, byte [0x5a22bd]
push eax
push esi
lea eax, [ebp - 0x218]
push 0x5288c8
push eax
call fcn.00409bde
add esp, 0x10
lea eax, [ebp - 0x218]
mov ecx, edi
push 1
push 1
push eax
call fcn.00410feb
jmp 0x413d4d
call fcn.004244be
mov ecx, dword [0x5a23ec]
push 2
test al, al
jne 0x41386e
call fcn.004673c5
test eax, eax
je 0x413855
push esi
lea eax, [ebp - 0x218]
push 0x528930
push eax
call fcn.00409bde
add esp, 0xc
lea eax, [ebp - 0x218]
mov ecx, edi
push 1
push 1
push eax
call fcn.00410feb
push ebx
push esi
push dword [edi + 0x7858]
push dword [0x5a22a4]
call dword [sym.imp.USER32.dll_PostMessageW]
jmp 0x413d4d
call fcn.004673c5
test eax, eax
je 0x41389e
push esi
lea eax, [ebp - 0x218]
push 0x5289b8
push eax
call fcn.00409bde
add esp, 0xc
lea eax, [ebp - 0x218]
mov ecx, edi
push 1
push 1
push eax
call fcn.00410feb
push esi
lea eax, [ebp - 0x18]
push 0x528a24
push eax
call fcn.00409b09
push 0x50
lea eax, [ebp - 0x268]
mov dword [ebp - 0x270], esi
push 0
push eax
call fcn.004f5a90
add esp, 0x18
push 0
call dword [sym.imp.KERNEL32.dll_SetLastError]
lea eax, [ebp - 0x268]
push eax
push 0x14
call dword [sym.imp.USER32.dll_GetKeyboardLayoutList]
mov dword [ebp - 0x278], eax
call dword [sym.imp.KERNEL32.dll_GetLastError]
or dword [ebp - 0x280], 0xffffffff
xor ebx, ebx
or dword [ebp - 0x290], 0xffffffff
xor edx, edx
mov dword [ebp - 0x29c], eax
mov dword [ebp - 0x26c], ebx
lea ecx, [edx + 0x70f]
imul eax, ecx, 0xc
cmp dword [eax + edi], ebx
jne 0x41392d
cmp dword [ebp - 0x280], 0xffffffff
mov eax, edx
cmovne eax, dword [ebp - 0x280]
mov dword [ebp - 0x280], eax
jmp 0x413939
imul eax, edx, 0xc
cmp dword [eax + edi + 0x54b8], esi
je 0x413941
inc edx
cmp edx, 0x14
jb 0x413907
jmp 0x413961
imul eax, edx, 0xc
xor ebx, ebx
inc ebx
or dword [ebp - 0x280], 0xffffffff
mov dword [ebp - 0x26c], ebx
mov eax, dword [eax + edi + 0x54bc]
mov dword [ebp - 0x270], eax
xor edx, edx
mov dword [ebp - 0x27c], edx
test ebx, ebx
jne 0x413be2
cmp edx, 5
ja 0x413bc7
xor eax, eax
mov dword [ebp - 0x284], eax
cmp dword [ebp - 0x278], eax
jbe 0x413bb8
lea eax, [ebp - 0x268]
mov dword [ebp - 0x274], eax
test edx, edx
jne 0x4139a9
movzx eax, si
cmp eax, esi
jne 0x413b80
lea eax, [edi + 0x54bc]
xor edx, edx
mov dword [ebp - 0x294], eax
mov ecx, eax
cmp dword [ecx - 8], 0
je 0x4139d2
mov esi, dword [ebp - 0x274]
mov eax, dword [ecx]
cmp eax, dword [esi]
mov esi, dword [ebp + 0xc]
je 0x413b7a
inc edx
add ecx, 0xc
cmp edx, 0x14
jb 0x4139b9
mov edx, dword [ebp - 0x27c]
mov eax, edx
sub eax, 0
je 0x413b52
sub eax, 1
je 0x413b30
sub eax, 1
je 0x413b1d
sub eax, 1
je 0x413b09
sub eax, 1
je 0x413af6
sub eax, 1
je 0x413a33
push 0
push 0x2691
push 0x527ea8
push 0x528aa4
call fcn.0041f6df
add esp, 0x10
jmp 0x413aee
and dword [ebp - 0x288], 0
lea eax, [ebp - 0x268]
mov edi, dword [ebp - 0x294]
mov dword [ebp - 0x26c], eax
mov eax, dword [ebp - 0x278]
mov dword [ebp - 0x28c], eax
xor bl, bl
mov ecx, edi
xor edx, edx
cmp dword [ecx - 8], 0
je 0x413a73
mov esi, dword [ebp - 0x26c]
mov eax, dword [ecx]
cmp eax, dword [esi]
mov esi, dword [ebp + 0xc]
je 0x413a7e
inc edx
add ecx, 0xc
cmp edx, 0x14
jb 0x413a5e
jmp 0x413a80
mov bl, 1
mov eax, dword [ebp - 0x288]
test bl, bl
lea ecx, [eax + 1]
cmovne ecx, eax
add dword [ebp - 0x26c], 4
sub dword [ebp - 0x28c], 1
mov dword [ebp - 0x290], ecx
mov dword [ebp - 0x288], ecx
jne 0x413a58
mov eax, dword [ebp - 0x274]
xor ebx, ebx
mov edi, dword [ebp - 0x298]
cmp ecx, 1
sete bl
push dword [eax]
lea eax, [ebp - 0x218]
mov dword [ebp - 0x26c], ebx
push esi
push 0x528a30
push eax
call dword [sym.imp.USER32.dll_wsprintfW]
add esp, 0x10
lea eax, [ebp - 0x218]
mov ecx, edi
push 1
push 1
push eax
call fcn.00410feb
mov edx, dword [ebp - 0x27c]
jmp 0x413b74
mov eax, dword [ebp - 0x274]
push 0
pop ebx
mov al, byte [eax]
xor al, byte [ebp - 0x270]
jmp 0x413b6b
mov eax, dword [ebp - 0x274]
xor ebx, ebx
mov ecx, dword [ebp - 0x270]
cmp word [eax + 2], cx
jmp 0x413b6b
mov eax, dword [ebp - 0x274]
xor ebx, ebx
mov ecx, dword [ebp - 0x270]
cmp word [eax], cx
jmp 0x413b6b
mov ecx, dword [ebp - 0x274]
movzx eax, word [ecx]
cmp word [ecx + 2], ax
je 0x413b48
cmp ax, word [ebp - 0x270]
je 0x413ba2
xor ebx, ebx
mov dword [ebp - 0x26c], ebx
jmp 0x413b80
mov eax, dword [ebp - 0x270]
xor ebx, ebx
mov ecx, dword [ebp - 0x274]
shl eax, 0x10
or eax, dword [ebp - 0x270]
cmp dword [ecx], eax
sete bl
mov dword [ebp - 0x26c], ebx
test ebx, ebx
jne 0x413ba5
jmp 0x413b80
mov edx, dword [ebp - 0x27c]
mov eax, dword [ebp - 0x284]
add dword [ebp - 0x274], 4
inc eax
mov dword [ebp - 0x284], eax
cmp eax, dword [ebp - 0x278]
jb 0x41399a
jmp 0x413bb8
xor ebx, ebx
inc ebx
mov eax, dword [ebp - 0x284]
mov eax, dword [ebp + eax*4 - 0x268]
mov dword [ebp - 0x270], eax
inc edx
mov dword [ebp - 0x27c], edx
test ebx, ebx
je 0x413971
mov dword [ebp - 0x26c], ebx
test ebx, ebx
jne 0x413be2
mov ecx, dword [0x5a23ec]
push 1
call fcn.004673c5
test eax, eax
jne 0x413bf7
mov ecx, dword [0x5a23ec]
push 2
call fcn.004673c5
test eax, eax
je 0x413cbb
mov ecx, 0x526584
test ebx, ebx
mov eax, 0x528ad8
cmove eax, ecx
push eax
push esi
lea eax, [ebp - 0x218]
push 0x528af0
push eax
call fcn.00409bde
add esp, 0x10
lea eax, [ebp - 0x218]
mov ecx, edi
push 1
push 1
push eax
call fcn.00410feb
push 0
call dword [sym.imp.USER32.dll_GetKeyboardLayout]
push eax
lea eax, [ebp - 0x218]
push 0x528b38
push eax
call fcn.00409bde
add esp, 0xc
lea eax, [ebp - 0x218]
mov ecx, edi
push 0
push 0
push eax
call fcn.00410feb
push 0
push 0
push 0x528b90
mov ecx, edi
call fcn.00410feb
mov ecx, dword [ebp - 0x278]
xor eax, eax
test ecx, ecx
je 0x413cc1
mov ebx, ecx
push dword [ebp + eax*4 - 0x268]
lea esi, [eax + 1]
push esi
lea eax, [ebp - 0x218]
push 0x528bd0
push eax
call fcn.00409bde
add esp, 0x10
lea eax, [ebp - 0x218]
mov ecx, edi
push 0
push 0
push eax
call fcn.00410feb
mov eax, esi
cmp eax, ebx
jb 0x413c7b
mov ebx, dword [ebp - 0x26c]
mov esi, dword [ebp + 0xc]
mov ecx, dword [ebp - 0x278]
test ebx, ebx
jne 0x413d60
push esi
push dword [ebp - 0x29c]
lea eax, [ebp - 0x218]
push dword [ebp - 0x290]
push ecx
push 0x528bf0
push eax
call fcn.00409bde
add esp, 0x18
lea eax, [ebp - 0x268]
mov ecx, edi
push dword [ebp - 0x278]
push eax
push 0xff
lea eax, [ebp - 0x218]
push eax
call fcn.0040b25c
push ebx
push 0x26e8
lea eax, [ebp - 0x218]
push 0x527ea8
push eax
call fcn.0041f6df
add esp, 0x10
mov ebx, dword [ebp - 0x270]
mov esi, dword [ebp - 0x2a0]
mov ecx, esi
push 0
call fcn.004e1974
test al, al
je 0x413d4d
push ebx
mov ecx, esi
call fcn.004de78b
mov ecx, eax
call fcn.0048b20b
mov ecx, dword [ebp - 4]
xor eax, eax
pop edi
pop esi
xor ecx, ebp
pop ebx
call fcn.004f4166
leave
ret 8
mov eax, dword [ebp - 0x280]
cmp eax, 0xffffffff
je 0x413d25
mov ebx, dword [ebp - 0x270]
mov ecx, edi
push ebx
push esi
push eax
call fcn.0041be15
jmp 0x413d2b