Function at 0x402d51
Capabilities:
Get keyboard layout

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x40
push ebx
lea eax, [ebp - 4]
push esi
push edi
push eax
xor esi, esi
call fcn.004030f3
mov ebx, eax
test ebx, ebx
je 0x402ff0
push esi
push dword [ebp - 4]
push dword [ebp + 8]
call fcn.0040318b
push dword [ebp + 8]
mov dword [0x4040bc], 1
call dword [sym.imp.USER32.dll_SetForegroundWindow]
call dword [sym.imp.USER32.dll_CreatePopupMenu]
mov edi, eax
push esi
push dword [ebp - 4]
call dword [sym.imp.USER32.dll_GetWindowThreadProcessId]
push eax
call dword [sym.imp.USER32.dll_GetKeyboardLayout]
push esi
mov dword [ebp - 0xc], eax
push eax
call fcn.00402b10
push eax
mov dword [ebp - 8], eax
push esi
push edi
call fcn.0040313e
cmp dword [ebp - 8], esi
jne 0x402ed6
mov eax, dword [ebp - 0xc]
and eax, 0xf000ffff
cmp eax, 0xe0000412
je 0x402e0c
sub ebx, 2
push 0x20
lea eax, [ebp - 0x40]
cmp ebx, 1
sbb esi, esi
push eax
add esi, 0x12d
push esi
push dword [0x404078]
call dword [sym.imp.USER32.dll_LoadStringA]
lea eax, [ebp - 0x40]
push eax
push 0x1f4
push 0x400
push 0xffffffffffffffff
push edi
call dword [sym.imp.USER32.dll_InsertMenuA]
push 8
mov ebx, pe_nt_image_headers32
push dword [ebp - 0xc]
mov dword [ebp - 8], 0
call sub.IMM32.dll_ImmGetProperty
test ebx, eax
je 0x402e72
push 0
push 0x14
push 0x287
push dword [ebp - 4]
call dword [sym.imp.USER32.dll_SendMessageA]
and eax, ebx
push 0x20
lea ecx, [ebp - 0x40]
cmp eax, 1
mov eax, 0x12f
push ecx
adc eax, 0xffffffff
push eax
mov dword [ebp - 8], eax
push dword [0x404078]
call dword [sym.imp.USER32.dll_LoadStringA]
lea ecx, [ebp - 0x40]
push ecx
push 0x1f5
push 0x400
push 0xffffffffffffffff
push edi
call dword [sym.imp.USER32.dll_InsertMenuA]
test esi, esi
jne 0x402e7c
cmp dword [ebp - 8], 0
je 0x402e8e
push 0
push 0
push 0x800
push 0xffffffffffffffff
push edi
call dword [sym.imp.USER32.dll_InsertMenuA]
push 0x20
lea eax, [ebp - 0x40]
push eax
mov ebx, 0x1f6
push 0x130
push dword [0x404078]
call dword [sym.imp.USER32.dll_LoadStringA]
lea ecx, [ebp - 0x40]
push ecx
push ebx
push 0x400
push 0xffffffffffffffff
push edi
call dword [sym.imp.USER32.dll_InsertMenuA]
call fcn.00402ff9
mov dword [ebp - 0xc], eax
cmp eax, 1
jne 0x402ed9
push 8
push ebx
push edi
call dword [sym.imp.USER32.dll_CheckMenuItem]
jmp 0x402ed9
mov esi, dword [ebp - 4]
lea eax, [ebp - 0x1c]
push eax
push dword [0x404074]
call dword [sym.imp.USER32.dll_GetClientRect]
push 2
lea ecx, [ebp - 0x1c]
push ecx
push 0
push dword [0x404074]
call dword [sym.imp.USER32.dll_MapWindowPoints]
mov dword [ebp - 0x20], 0x14
lea ecx, [ebp - 0x20]
push ecx
push dword [ebp + 8]
push dword [ebp - 0x18]
push dword [ebp - 0x1c]
push 0x160
push edi
call dword [sym.imp.USER32.dll_TrackPopupMenuEx]
mov ebx, eax
push edi
call dword [sym.imp.USER32.dll_DestroyMenu]
mov dword [0x4040bc], 0
test ebx, ebx
je 0x402f44
cmp ebx, 0xffffffff
je 0x402f44
push dword [ebp - 4]
push dword [ebp + 8]
call fcn.00402a98
cmp ebx, 0x1f4
je 0x402f84
cmp ebx, 0x1f5
je 0x402fa4
cmp ebx, 0x1f6
je 0x402fda
cmp ebx, 0x3e8
jl 0x402feb
push ebx
call fcn.00403175
push dword [ebp - 4]
mov esi, eax
call sub.IMM32.dll_ImmGetDefaultIMEWnd
push dword [ebp - 4]
push esi
push eax
call fcn.00401093
jmp 0x402feb
cmp dword [ebp - 4], 0
je 0x402feb
push dword [ebp - 4]
sub esi, 0x12c
cmp esi, 1
sbb eax, eax
inc eax
push eax
push dword [ebp + 8]
call fcn.00403202
jmp 0x402feb
cmp dword [ebp - 4], 0
je 0x402feb
push dword [ebp - 4]
mov eax, dword [ebp - 8]
sub eax, 0x12e
cmp eax, 1
sbb esi, esi
call sub.IMM32.dll_ImmGetDefaultIMEWnd
inc esi
test eax, eax
je 0x402feb
cmp eax, 0xffffffff
je 0x402feb
push esi
push 0x13
push 0x287
push eax
call dword [sym.imp.USER32.dll_SendMessageA]
jmp 0x402feb
cmp dword [ebp - 0xc], 1
sbb eax, eax
neg eax
push eax
push dword [ebp - 4]
call fcn.00403067
call fcn.00403132
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 4