Function at 0x407e80
Capabilities:
Get keyboard layout

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x280
mov eax, dword [0x50b3a0]
test byte [eax + 0x11811], 1
push ebx
mov ebx, ecx
mov dword [ebp - 0x10], ebx
je 0x408322
push edi
mov edi, dword [ebp + 8]
push edi
call fcn.0049f4c0
add esp, 4
test al, al
je 0x408321
push esi
call dword [sym.imp.KERNEL32.dll_GetCurrentThreadId]
mov esi, dword [ebp + 0xc]
cmp eax, dword [ebx + 0x740c]
je 0x407f2a
mov ecx, dword [0x50b3a4]
cmp byte [ecx + 0x127d2], 1
jbe 0x407f09
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]
mov ecx, dword [ebx + 0x4244]
add esp, 0xc
test ecx, ecx
je 0x407f09
push 1
push 0
push 1
lea eax, [ebp - 0x280]
push eax
call fcn.004adc30
mov ecx, dword [ebx + 0x7464]
mov edx, dword [0x50b384]
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 [0x50b3a4]
cmp byte [eax + 0x127d2], 1
jbe 0x407f6a
push esi
lea ecx, [ebp - 0x280]
push str.CConEmuMain::OnLangChangeConsole__0x_08X___MainThread
push ecx
call dword [sym.imp.USER32.dll_wsprintfW]
mov ecx, dword [ebx + 0x4244]
add esp, 0xc
test ecx, ecx
je 0x407f6a
push 1
push 0
push 1
lea edx, [ebp - 0x280]
push edx
call fcn.004adc30
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.004b03e0
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 + 0x50c0]
cmp dword [ecx - 4], edi
jne 0x407fd0
cmp dword [ebp - 0x18], 0xffffffff
jne 0x407fd4
mov dword [ebp - 0x18], eax
jmp 0x407fd4
cmp dword [ecx], esi
je 0x407fdf
inc eax
add ecx, 0xc
cmp eax, 0x14
jb 0x407fc0
jmp 0x407ff8
lea eax, [eax + eax*2 + 0x1431]
mov ecx, dword [ebx + eax*4]
mov edi, 1
mov dword [ebp - 4], ecx
mov dword [ebp - 0x18], 0xffffffff
mov dword [ebp - 0x14], 0
test edi, edi
jne 0x408197
jmp 0x408010
cmp dword [ebp - 0x14], 5
ja 0x408184
xor esi, esi
cmp dword [ebp - 8], esi
jbe 0x408174
cmp dword [ebp - 0x14], 0
jne 0x408039
mov eax, dword [ebp + 0xc]
movzx edx, ax
cmp edx, eax
jne 0x408159
xor ecx, ecx
add ebx, 0x50c4
mov eax, ebx
cmp dword [eax - 8], 0
je 0x408055
mov edx, dword [eax]
cmp edx, dword [ebp + esi*4 - 0x6c]
je 0x408156
inc ecx
add eax, 0xc
cmp ecx, 0x14
jb case.default.0x408061
mov eax, dword [ebp - 0x14]
jmp dword [eax*4 + 0x40832c]
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 0x408152
movzx eax, word [ebp + esi*4 - 0x6c]
cmp word [ebp + esi*4 - 0x6a], ax
je 0x408098
cmp ax, word [ebp - 4]
je 0x408165
xor edi, edi
jmp 0x408156
mov cx, word [ebp - 4]
xor eax, eax
cmp word [ebp + esi*4 - 0x6c], cx
sete al
mov edi, eax
jmp 0x408152
mov ax, word [ebp - 4]
xor edx, edx
cmp word [ebp + esi*4 - 0x6a], ax
sete dl
mov edi, edx
jmp 0x408152
mov cl, byte [ebp + esi*4 - 0x6c]
xor cl, byte [ebp - 4]
mov edx, 0
sete dl
mov edi, edx
jmp 0x408152
xor edx, edx
mov dword [ebp - 0xc], edx
xor ecx, ecx
mov eax, ebx
cmp dword [eax - 8], 0
je 0x4080f6
mov edi, dword [eax]
cmp edi, dword [ebp + edx*4 - 0x6c]
je 0x408102
inc ecx
add eax, 0xc
cmp ecx, 0x14
jb 0x4080e8
inc dword [ebp - 0xc]
inc edx
cmp edx, dword [ebp - 8]
jb 0x4080e4
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 + 0x4244]
add esp, 0x10
test ecx, ecx
je 0x408152
push 1
push 0
push 1
lea edx, [ebp - 0x280]
push edx
call fcn.004adc30
jmp 0x408152
test edi, edi
jne 0x40816a
mov ebx, dword [ebp - 0x10]
inc esi
cmp esi, dword [ebp - 8]
jb 0x408025
jmp 0x408174
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 0x408010
jmp 0x408197
test edi, edi
jne 0x408197
mov ecx, dword [0x50b3a4]
cmp byte [ecx + 0x127d2], 0
jne 0x4081b3
mov edx, dword [0x50b3a4]
cmp byte [edx + 0x127d2], 2
jb 0x40828a
mov eax, str.Succeeded
test edi, edi
jne 0x4081b8
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 + 0x4244]
add esp, 0x10
test ecx, ecx
je 0x4081eb
push 1
push 0
push 1
lea edx, [ebp - 0x280]
push edx
call fcn.004adc30
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 + 0x4244]
add esp, 0xc
test ecx, ecx
je 0x408225
push 0
push 0
push 0
lea edx, [ebp - 0x280]
push edx
call fcn.004adc30
mov ecx, dword [ebx + 0x4244]
test ecx, ecx
je 0x40823f
push 0
push 0
push 0
push str.__Installed_keyboard_layouts:_r_n
call fcn.004adc30
xor eax, eax
cmp dword [ebp - 8], eax
jbe 0x40828a
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 + 0x4244]
add esp, 0x10
test ecx, ecx
je 0x408280
push 0
push 0
push 0
lea edx, [ebp - 0x280]
push edx
call fcn.004adc30
mov eax, esi
cmp eax, dword [ebp - 8]
jb 0x408246
mov esi, dword [ebp + 0xc]
test edi, edi
jne 0x4082e7
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.00407ac0
push edi
push 0x374a
lea ecx, [ebp - 0x280]
push str.ConEmu.cpp
push ecx
call fcn.004223a0
add esp, 0x10
jmp 0x4082fc
mov eax, dword [ebp - 0x18]
cmp eax, 0xffffffff
je 0x4082fc
mov edx, dword [ebp - 4]
push edx
push esi
push eax
mov ecx, ebx
call fcn.00407bd0
mov esi, dword [ebp + 8]
push 1
push esi
call fcn.0049fc10
add esp, 8
test al, al
je 0x408320
mov eax, dword [ebp - 4]
push eax
mov ecx, esi
call fcn.004a4a70
mov ecx, eax
call fcn.00479090
pop esi
pop edi
xor eax, eax
pop ebx
mov esp, ebp
pop ebp
ret 8