Function at 0x40be70
Capabilities:
Get keyboard layout

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x280
mov eax, dword [0x52fe30]
test byte [eax + 0x11629], 1
push ebx
mov ebx, ecx
mov dword [ebp - 0x10], ebx
je 0x40c34f
push edi
mov edi, dword [ebp + 8]
push edi
call fcn.004b63d0
add esp, 4
test al, al
je 0x40c34e
push esi
mov esi, dword [ebp + 0xc]
test esi, esi
jne 0x40befe
movzx ecx, byte [0x52fe54]
push ecx
push esi
lea edx, [ebp - 0x280]
push str.CConEmuMain::OnLangChangeConsole__0x_08X___Wine_i
push edx
call dword [sym.imp.USER32.dll_wsprintfW]
add esp, 0x10
test ebx, ebx
je 0x40c34d
mov ecx, dword [ebx + 0x40b0]
test ecx, ecx
je 0x40c34d
push 1
push esi
push 1
lea eax, [ebp - 0x280]
push eax
call fcn.004c77f0
pop esi
pop edi
xor eax, eax
pop ebx
mov esp, ebp
pop ebp
ret 8
call dword [sym.imp.KERNEL32.dll_GetCurrentThreadId]
cmp eax, dword [ebx + 0x78b8]
je 0x40bf64
mov ecx, dword [0x52fe34]
cmp byte [ecx + 0x125fa], 1
jbe 0x40bf43
push esi
lea edx, [ebp - 0x280]
push str.CConEmuMain::OnLangChangeConsole__0x_08X___Posting_to_main_thread
push edx
call dword [sym.imp.USER32.dll_wsprintfW]
add esp, 0xc
push 1
push 1
lea eax, [ebp - 0x280]
push eax
mov ecx, ebx
call fcn.00409280
mov ecx, dword [ebx + 0x790c]
mov edx, dword [0x52fe14]
push edi
push esi
push ecx
push edx
call dword [sym.imp.USER32.dll_PostMessageW]
pop esi
pop edi
xor eax, eax
pop ebx
mov esp, ebp
pop ebp
ret 8
mov eax, dword [0x52fe34]
cmp byte [eax + 0x125fa], 1
jbe 0x40bf9a
push esi
lea ecx, [ebp - 0x280]
push str.CConEmuMain::OnLangChangeConsole__0x_08X___MainThread
push ecx
call dword [sym.imp.USER32.dll_wsprintfW]
add esp, 0xc
push 1
push 1
lea edx, [ebp - 0x280]
push edx
mov ecx, ebx
call fcn.00409280
push esi
lea eax, [ebp - 0x80]
push str._08X
push eax
call dword [sym.imp.USER32.dll_wsprintfW]
push 0x50
lea ecx, [ebp - 0x6c]
push 0
push ecx
mov dword [ebp - 4], esi
call fcn.004c9b50
add esp, 0x18
push 0
call dword [sym.imp.KERNEL32.dll_SetLastError]
lea edx, [ebp - 0x6c]
push edx
push 0x14
call dword [sym.imp.USER32.dll_GetKeyboardLayoutList]
mov dword [ebp - 8], eax
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [ebp - 0x1c], eax
or eax, 0xffffffff
xor edi, edi
mov dword [ebp - 0x18], eax
mov dword [ebp - 0xc], eax
xor eax, eax
lea ecx, [ebx + 0x556c]
cmp dword [ecx - 4], edi
jne 0x40c000
cmp dword [ebp - 0x18], 0xffffffff
jne 0x40c004
mov dword [ebp - 0x18], eax
jmp 0x40c004
cmp dword [ecx], esi
je 0x40c00f
inc eax
add ecx, 0xc
cmp eax, 0x14
jb 0x40bff0
jmp 0x40c028
lea eax, [eax + eax*2]
mov ecx, dword [ebx + eax*4 + 0x5570]
mov edi, 1
mov dword [ebp - 4], ecx
mov dword [ebp - 0x18], 0xffffffff
mov dword [ebp - 0x14], 0
test edi, edi
jne 0x40c1c4
jmp 0x40c040
cmp dword [ebp - 0x14], 5
ja 0x40c1b1
xor esi, esi
cmp dword [ebp - 8], esi
jbe 0x40c1a1
cmp dword [ebp - 0x14], 0
jne 0x40c069
mov eax, dword [ebp + 0xc]
movzx edx, ax
cmp edx, eax
jne 0x40c186
xor ecx, ecx
add ebx, 0x5570
mov eax, ebx
cmp dword [eax - 8], 0
je 0x40c085
mov edx, dword [eax]
cmp edx, dword [ebp + esi*4 - 0x6c]
je 0x40c183
inc ecx
add eax, 0xc
cmp ecx, 0x14
jb case.default.0x40c091
mov eax, dword [ebp - 0x14]
jmp dword [eax*4 + 0x40c358]
mov eax, dword [ebp - 4]
mov ecx, eax
shl ecx, 0x10
xor edx, edx
or ecx, eax
cmp dword [ebp + esi*4 - 0x6c], ecx
sete dl
mov edi, edx
jmp 0x40c17f
movzx eax, word [ebp + esi*4 - 0x6c]
cmp word [ebp + esi*4 - 0x6a], ax
je 0x40c0c8
cmp ax, word [ebp - 4]
je 0x40c192
xor edi, edi
jmp 0x40c183
mov cx, word [ebp - 4]
xor eax, eax
cmp word [ebp + esi*4 - 0x6c], cx
sete al
mov edi, eax
jmp 0x40c17f
mov ax, word [ebp - 4]
xor edx, edx
cmp word [ebp + esi*4 - 0x6a], ax
sete dl
mov edi, edx
jmp 0x40c17f
mov cl, byte [ebp + esi*4 - 0x6c]
xor cl, byte [ebp - 4]
mov edx, 0
sete dl
mov edi, edx
jmp 0x40c17f
xor edx, edx
mov dword [ebp - 0xc], edx
xor ecx, ecx
mov eax, ebx
cmp dword [eax - 8], 0
je 0x40c123
mov edi, dword [eax]
cmp edi, dword [ebp + edx*4 - 0x6c]
je 0x40c12f
inc ecx
add eax, 0xc
cmp ecx, 0x14
jb 0x40c115
inc dword [ebp - 0xc]
inc edx
cmp edx, dword [ebp - 8]
jb 0x40c111
mov ecx, dword [ebp + esi*4 - 0x6c]
mov edx, dword [ebp + 0xc]
xor eax, eax
cmp dword [ebp - 0xc], 1
push ecx
sete al
push edx
push str.hkl0x_08X__dwLayout0x_08X____Warning__strange_layout_ID
mov edi, eax
lea eax, [ebp - 0x280]
push eax
call dword [sym.imp.USER32.dll_wsprintfW]
mov ecx, dword [ebp - 0x10]
mov ecx, dword [ecx + 0x40b0]
add esp, 0x10
test ecx, ecx
je 0x40c17f
push 1
push 0
push 1
lea edx, [ebp - 0x280]
push edx
call fcn.004c77f0
jmp 0x40c17f
test edi, edi
jne 0x40c197
mov ebx, dword [ebp - 0x10]
inc esi
cmp esi, dword [ebp - 8]
jb 0x40c055
jmp 0x40c1a1
mov edi, 1
mov eax, dword [ebp + esi*4 - 0x6c]
mov ebx, dword [ebp - 0x10]
mov dword [ebp - 4], eax
inc dword [ebp - 0x14]
mov esi, dword [ebp + 0xc]
test edi, edi
je 0x40c040
jmp 0x40c1c4
test edi, edi
jne 0x40c1c4
mov ecx, dword [0x52fe34]
cmp byte [ecx + 0x125fa], 0
jne 0x40c1e0
mov edx, dword [0x52fe34]
cmp byte [edx + 0x125fa], 2
jb 0x40c2b7
mov eax, str.Succeeded
test edi, edi
jne 0x40c1e5
mov eax, str.FAILED
push eax
push esi
lea eax, [ebp - 0x280]
push str.Keyboard_layout_lookup__0x_08X___s
push eax
call dword [sym.imp.USER32.dll_wsprintfW]
mov ecx, dword [ebx + 0x40b0]
add esp, 0x10
test ecx, ecx
je 0x40c218
push 1
push 0
push 1
lea edx, [ebp - 0x280]
push edx
call fcn.004c77f0
push 0
call dword [sym.imp.USER32.dll_GetKeyboardLayout]
push eax
lea eax, [ebp - 0x280]
push str.__Current_keyboard_layout:_r_n_______0x_08X_n
push eax
call dword [sym.imp.USER32.dll_wsprintfW]
mov ecx, dword [ebx + 0x40b0]
add esp, 0xc
test ecx, ecx
je 0x40c252
push 0
push 0
push 0
lea edx, [ebp - 0x280]
push edx
call fcn.004c77f0
mov ecx, dword [ebx + 0x40b0]
test ecx, ecx
je 0x40c26c
push 0
push 0
push 0
push str.__Installed_keyboard_layouts:_r_n
call fcn.004c77f0
xor eax, eax
cmp dword [ebp - 8], eax
jbe 0x40c2b7
lea esi, [eax + 1]
mov eax, dword [ebp + eax*4 - 0x6c]
push eax
push esi
lea ecx, [ebp - 0x280]
push str._____u:_0x_08X_n
push ecx
call dword [sym.imp.USER32.dll_wsprintfW]
mov ecx, dword [ebx + 0x40b0]
add esp, 0x10
test ecx, ecx
je 0x40c2ad
push 0
push 0
push 0
lea edx, [ebp - 0x280]
push edx
call fcn.004c77f0
mov eax, esi
cmp eax, dword [ebp - 8]
jb 0x40c273
mov esi, dword [ebp + 0xc]
test edi, edi
jne 0x40c314
mov eax, dword [ebp - 0x1c]
mov ecx, dword [ebp - 0xc]
mov edx, dword [ebp - 8]
push esi
push eax
push ecx
push edx
lea eax, [ebp - 0x280]
push str.dwLayoutName_not_found:_Count_u_Left_i_Err_u__08X_r_n
push eax
call dword [sym.imp.USER32.dll_wsprintfW]
mov ecx, dword [ebp - 8]
add esp, 0x18
push ecx
lea edx, [ebp - 0x6c]
push edx
push 0xff
lea eax, [ebp - 0x280]
push eax
mov ecx, ebx
call fcn.0040bab0
push edi
push 0x3a77
lea ecx, [ebp - 0x280]
push str.ConEmu.cpp
push ecx
call fcn.00428c10
add esp, 0x10
jmp 0x40c329
mov eax, dword [ebp - 0x18]
cmp eax, 0xffffffff
je 0x40c329
mov edx, dword [ebp - 4]
push edx
push esi
push eax
mov ecx, ebx
call fcn.0040bbc0
mov esi, dword [ebp + 8]
push 1
push esi
call fcn.004b6cc0
add esp, 8
test al, al
je 0x40c34d
mov eax, dword [ebp - 4]
push eax
mov ecx, esi
call fcn.004bcc80
mov ecx, eax
call fcn.004892b0
pop esi
pop edi
xor eax, eax
pop ebx
mov esp, ebp
pop ebp
ret 8