Function at 0x4f002b20
Capabilities:
Get keyboard layout

Disassembly:
mov edi, edi
push ebp
mov ebp, esp
sub esp, 0x18
mov ecx, dword [0x4f01ac28]
mov eax, ecx
or eax, dword [0x4f01ac2c]
push ebx
push esi
push edi
mov dword [ebp - 0x10], 0
mov dword [ebp - 0xc], 0
je 0x4f006252
test byte [ecx], 4
je 0x4f006252
mov edi, dword [ebp + 0xc]
mov dword [ebp - 8], 0xc000000f
test edi, edi
je 0x4f002e37
mov ecx, dword fs:[0x18]
mov eax, dword [ecx + 0xfdc]
test eax, eax
jns 0x4f002b7b
add ecx, eax
mov eax, dword [0x4f01ac28]
xor esi, esi
movzx edx, di
cmp esi, dword [eax + 0xc]
jb 0x4f002b99
ja 0x4f00618b
cmp edx, dword [eax + 8]
jae 0x4f00618b
mov eax, dword [0x4f01a9f0]
imul eax, edx
add eax, dword [0x4f01a9e8]
cdq
mov esi, eax
mov dword [ebp - 0x14], edx
mov eax, edi
shr eax, 0x10
cmp ax, word [esi + 0x1a]
jne 0x4f006174
test byte [esi + 0x19], 1
jne 0x4f00618b
cmp byte [esi + 0x18], 0x11
jne 0x4f00618b
mov edx, dword [ecx + 0x820]
mov eax, edx
or eax, dword [ecx + 0x824]
je 0x4f006198
mov eax, dword [esi + 0x10]
cmp eax, dword [edx]
jne 0x4f006198
mov eax, dword [esi + 0x14]
cmp eax, dword [edx + 4]
jne 0x4f006198
mov ebx, dword [ecx + 0x828]
add ebx, dword [esi]
mov ecx, dword [ecx + 0x82c]
adc ecx, dword [esi + 4]
mov eax, ebx
or eax, ecx
je 0x4f00618b
movzx esi, word [ebx]
imul esi, dword [0x4f01a9f0]
mov eax, dword fs:[0x18]
add esi, dword [0x4f01a9e8]
mov ecx, dword [eax + 0xfdc]
test ecx, ecx
jns 0x4f002c38
add eax, ecx
cmp dword [eax + 0x78], 0
je 0x4f0061aa
mov eax, dword fs:[0x18]
mov ecx, dword [eax + 0xfdc]
test ecx, ecx
jns 0x4f002c54
add eax, ecx
mov ecx, dword [eax + 0x78]
mov dword [ebp - 4], ecx
mov ecx, dword [eax + 0x7c]
mov eax, dword [esi + 8]
cdq
cmp eax, dword [ebp - 4]
jne 0x4f0061c4
cmp edx, ecx
jne 0x4f0061c4
mov esi, dword [ebx + 0x18]
mov dword [ebp - 4], esi
test esi, esi
je 0x4f0061e4
test byte [esi + 8], 0x40
jne 0x4f002e37
lock inc dword [esi + 4]
mov ebx, dword [ebp + 0x10]
test ebx, ebx
jne 0x4f002dd7
test esi, esi
je 0x4f002ca1
and dword [esi + 8], 0xfffffffd
mov esi, dword [ebp + 8]
push esi
push ebx
push edi
call dword [sym.imp.MSCTF.dll_CtfImeAssociateFocus]
push 0
call dword [sym.imp.USER32.dll_GetKeyboardLayout]
cmp byte [0x4f01a5a0], 0
mov esi, eax
mov dword [ebp - 0x14], esi
je 0x4f002d8a
push 0x4f01a5c0
call dword [sym.imp.ntdll.dll_RtlEnterCriticalSection]
mov ecx, esi
shr ecx, 0x10
and ecx, 0xf000
cmp ecx, 0xe000
je 0x4f006259
mov edx, 1
mov esi, dword [0x4f01ac30]
test esi, esi
je 0x4f002d31
mov eax, dword [ebp - 0x14]
jmp 0x4f002d00
cmp dword [esi + 8], eax
jne 0x4f006274
test byte [esi + 0x50], 4
je 0x4f00626d
mov ecx, 1
cmp edx, ecx
jne 0x4f006274
test esi, esi
je 0x4f002d31
test byte [esi + 0x50], 1
jne 0x4f006283
inc dword [esi + 0x4c]
push 0x4f01a5c0
call dword [sym.imp.ntdll.dll_RtlLeaveCriticalSection]
test esi, esi
je 0x4f002d8a
push ebx
push edi
mov edi, dword [esi + 0x80]
mov ecx, edi
call dword [0x4f01b2cc]
call edi
cmp byte [0x4f01a5a0], 0
je 0x4f002d8a
push 0x4f01a5c0
call dword [sym.imp.ntdll.dll_RtlEnterCriticalSection]
add dword [esi + 0x4c], 0xffffffff
jne 0x4f002d7f
mov eax, dword [esi + 0x50]
test al, 1
jne 0x4f006294
test al, 2
jne 0x4f00628a
push 0x4f01a5c0
call dword [sym.imp.ntdll.dll_RtlLeaveCriticalSection]
mov edi, dword [ebp + 8]
push edi
call dword [sym.imp.USER32.dll_IsWindow]
test eax, eax
je 0x4f0062dd
test ebx, ebx
jne 0x4f002e25
push dword [ebp - 8]
push ebx
push 0x281
push edi
call dword [sym.imp.USER32.dll_SendMessageW]
mov ebx, dword [ebp - 4]
test ebx, ebx
je 0x4f002dc9
or eax, 0xffffffff
lock xadd dword [ebx + 4], eax
je 0x4f006302
mov eax, 1
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 0xc
test edi, edi
je 0x4f002e41
test esi, esi
je 0x4f006252
mov edx, 1
mov ecx, edi
call fcn.4f002e80
mov ecx, eax
test ecx, ecx
je 0x4f00624c
mov eax, dword [ebp - 4]
mov esi, dword [ebp + 8]
mov dword [ecx], esi
or dword [eax + 8], 2
test byte [ecx + 0x14c], 2
jne 0x4f002e76
mov eax, dword [ecx + 4]
mov dword [ebp - 0x10], eax
mov eax, dword [ecx + 0x18]
push edi
mov dword [ebp - 0xc], eax
call sym.IMM32.dll_ImmUnlockIMC
jmp 0x4f002ca4
push dword [ebp - 0xc]
push dword [ebp - 0x10]
push edi
call dword [sym.imp.win32u.dll_NtUserNotifyIMEStatus]
jmp 0x4f002da4
xor esi, esi
mov dword [ebp - 4], esi
jmp 0x4f002c8e
mov esi, dword [ebp + 8]
mov edx, 1
mov ecx, esi
call fcn.4f0026f0
mov edx, 1
mov dword [ebp - 0x14], eax
mov ecx, eax
call fcn.4f002e80
test eax, eax
je 0x4f002ca4
push dword [ebp - 0x14]
mov dword [eax], esi
call sym.IMM32.dll_ImmUnlockIMC
jmp 0x4f002ca4
mov dword [ebp - 8], 0x4000000f
jmp 0x4f002e0e
test ax, ax
je 0x4f002bbc
mov edx, 0xffff
cmp ax, dx
je 0x4f002bbc
push 6
call dword [sym.imp.ntdll.dll_RtlSetLastWin32Error]
jmp 0x4f002e37
push 0x38
push edi
call dword [sym.imp.win32u.dll_NtUserCallOneParam]
mov ebx, eax
xor ecx, ecx
jmp 0x4f002c0c
push 0xe
call dword [sym.imp.win32u.dll_NtUserGetThreadState]
test eax, eax
jne 0x4f002c42
mov dword [ebp - 4], eax
xor ecx, ecx
jmp 0x4f002c5d
mov eax, dword [ebx]
mov esi, dword fs:[0x18]
push 0
push eax
call dword [sym.imp.win32u.dll_NtUserQueryInputContext]
cmp eax, dword [esi + 0x20]
jne 0x4f002e37
jmp 0x4f002c72
mov edx, 0x34
lea ecx, [edx - 0x2c]
call fcn.4f002470
mov esi, eax
mov dword [ebp - 4], eax
test esi, esi
je 0x4f002e37
lea ebx, [esi + 0x10]
push ebx
call dword [sym.imp.ntdll.dll_RtlInitializeCriticalSection]
lock inc dword [esi + 4]
push 0xb
call dword [sym.imp.win32u.dll_NtUserGetThreadState]
push esi
push 0
push edi
mov dword [esi + 0xc], eax
call dword [sym.imp.win32u.dll_NtUserUpdateInputContext]
test eax, eax
jne 0x4f006240
push ebx
call dword [sym.imp.ntdll.dll_RtlDeleteCriticalSection]
push esi
push 0
push dword [0x4f01a9dc]
call dword [sym.imp.KERNEL32.dll_HeapFree]
jmp 0x4f002e37
or dword [esi + 8], 0x100
jmp 0x4f002c8a
push esi
call sym.IMM32.dll_ImmUnlockClientImc
xor eax, eax
jmp 0x4f002dce
call fcn.4f004180
test eax, eax
jne 0x4f002ce9
xor edx, edx
jmp 0x4f002cee
xor ecx, ecx
jmp 0x4f002d18
mov esi, dword [esi]
test esi, esi
jne 0x4f002d00
jmp 0x4f002d20
xor esi, esi
jmp 0x4f002d31
test byte [esi + 0x10], 1
je 0x4f002d7f
mov ecx, dword [0x4f01ac30]
cmp ecx, esi
jne 0x4f0062a7
mov eax, dword [esi]
mov dword [0x4f01ac30], eax
jmp 0x4f0062bd
test ecx, ecx
je 0x4f0062bd
mov eax, dword [ecx]
cmp eax, esi
je 0x4f0062b9
mov ecx, eax
test ecx, ecx
jne 0x4f0062ab
jmp 0x4f0062bd
mov eax, dword [esi]
mov dword [ecx], eax
mov edx, 1
mov ecx, esi
call fcn.4f00bfc0
push esi
push 0
push dword [0x4f01a9dc]
call dword [sym.imp.KERNEL32.dll_HeapFree]
jmp 0x4f002d7f
test ebx, ebx
jne 0x4f002db4
push ebx
call sym.IMM32.dll_ImmGetDefaultIMEWnd
test eax, eax
je 0x4f002db4
push dword [ebp - 8]
push ebx
push 0x281
push eax
jmp 0x4f002dae
test byte [ebx + 8], 0x40
je 0x4f002dc9
mov eax, dword [ebx]
test eax, eax
je 0x4f006319
push eax
call dword [sym.imp.KERNEL32.dll_LocalFree]
lea ecx, [ebx + 0x10]
push ecx
call dword [sym.imp.ntdll.dll_RtlDeleteCriticalSection]
push ebx
push 0
push dword [0x4f01a9dc]
call dword [sym.imp.KERNEL32.dll_HeapFree]
jmp 0x4f002dc9