Function at 0x4c9ed0
Capabilities:
Get keyboard layout

Disassembly:
sub esp, 0x10
mov eax, dword [0x563d54]
test eax, eax
mov dword [esp + 8], 0
jne 0x4c9ee9
call fcn.004c9560
cmp dword [0x563d54], 2
push ebx
push ebp
push esi
push edi
jne 0x4ca22b
mov eax, dword [0x563d68]
test eax, eax
je 0x4ca22b
mov eax, dword [esp + 0x24]
push eax
call dword [0x563d58]
mov edi, eax
test edi, edi
mov dword [esp + 0x1c], edi
je 0x4ca22b
mov cl, byte [esp + 0x2c]
neg cl
push 0
push 0
sbb ecx, ecx
and ecx, 0x7f8
add ecx, 8
mov ebp, ecx
push ebp
push edi
call dword [0x563d68]
mov ebx, eax
mov esi, ebx
shr esi, 1
lea edx, [esi + esi + 2]
push edx
call fcn.0052b380
add esp, 4
test eax, eax
mov dword [esp + 0x18], eax
je 0x4ca22b
push ebx
mov ebx, eax
push ebx
push ebp
push edi
call dword [0x563d68]
mov al, byte [esp + 0x2c]
test al, al
mov word [ebx + esi*2], 0
je 0x4ca21f
mov ecx, dword [esp + 0x28]
call fcn.00497d20
cmp eax, 7
jle 0x4ca21f
push 0
push 0
push 0x200
push edi
call dword [0x563d68]
mov esi, eax
test esi, esi
je 0x4ca21f
mov ebx, esi
shr ebx, 1
lea eax, [ebx + ebx + 2]
push eax
call fcn.0052b380
mov ebp, eax
add esp, 4
test ebp, ebp
mov dword [esp + 0x10], ebp
je 0x4ca21f
push esi
push ebp
push 0x200
push edi
call dword [0x563d68]
cmp ebx, 1
mov word [ebp + ebx*2], 0
jne 0x4ca006
cmp word [ebp], 0x3000
jne 0x4ca006
mov ecx, dword [esp + 0x18]
push ecx
call fcn.00439d00
push ebp
call fcn.00439d00
add esp, 8
pop edi
pop esi
pop ebp
xor eax, eax
pop ebx
add esp, 0x10
ret
call fcn.004c9670
cmp eax, 0x3a4
jne 0x4ca1ae
call dword [sym.imp.KERNEL32.dll_GetCurrentThreadId]
push eax
call dword [sym.imp.USER32.dll_GetKeyboardLayout]
movzx edx, ax
mov eax, dword [esp + 0x24]
push eax
mov dword [esp + 0x18], edx
call fcn.004c9760
add esp, 4
mov edi, str.ALPHANUMERIC_FULL
mov esi, eax
mov ecx, 0x12
xor edx, edx
repe cmpsb byte [esi], byte es:[edi]
jne 0x4ca050
mov ebp, 0x800000
jmp 0x4ca09d
mov edi, str.JAPANESE_HIRAGANA
mov esi, eax
mov ecx, 0x12
xor edx, edx
repe cmpsb byte [esi], byte es:[edi]
jne 0x4ca069
mov ebp, 0x900000
jmp 0x4ca09d
mov edi, str.JAPANESE_KATAKANA_FULL
mov esi, eax
mov ecx, 0x17
xor edx, edx
repe cmpsb byte [esi], byte es:[edi]
jne 0x4ca082
mov ebp, 0xa00000
jmp 0x4ca09d
mov esi, eax
mov edi, str.JAPANESE_KATAKANA_HALF
mov ecx, 0x17
xor eax, eax
repe cmpsb byte [esi], byte es:[edi]
jne 0x4ca1ae
mov ebp, 0x200000
call fcn.004cb0e0
test al, al
push 0
je 0x4ca107
mov ecx, dword [esp + 0x14]
mov edx, dword [esp + 0x18]
push 0
push ebx
push ecx
push ebp
push edx
call dword [sym.imp.KERNEL32.dll_LCMapStringW]
mov edi, eax
lea eax, [edi + edi + 2]
push eax
call fcn.0052b380
mov esi, eax
add esp, 4
test esi, esi
je 0x4ca1aa
mov ecx, dword [esp + 0x10]
mov edx, dword [esp + 0x14]
push edi
push esi
push ebx
push ecx
push ebp
push edx
call dword [sym.imp.KERNEL32.dll_LCMapStringW]
push 0
push esi
mov word [esi + edi*2], 0
call fcn.004b8350
push esi
mov edi, eax
call fcn.00439d00
add esp, 0xc
jmp 0x4ca1a6
mov eax, dword [esp + 0x14]
push eax
call fcn.004b8350
mov esi, eax
add esp, 8
test esi, esi
je 0x4ca1aa
push 0
push esi
call fcn.004d9d70
push esi
mov ebx, eax
call fcn.00439d00
add esp, 0xc
test ebx, ebx
je 0x4ca1aa
mov eax, ebx
lea edx, [eax + 1]
lea ebx, [ebx]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x4ca140
mov ecx, dword [esp + 0x14]
push 0
push 0
sub eax, edx
push eax
push ebx
push ebp
push ecx
call dword [sym.imp.KERNEL32.dll_LCMapStringA]
mov edi, eax
lea edx, [edi + 1]
push edx
call fcn.0052b380
mov esi, eax
add esp, 4
test esi, esi
je 0x4ca1aa
mov eax, ebx
lea edx, [eax + 1]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x4ca174
push edi
push esi
sub eax, edx
push eax
mov eax, dword [esp + 0x20]
push ebx
push ebp
push eax
call dword [sym.imp.KERNEL32.dll_LCMapStringA]
push 0
push 6
push esi
mov byte [esi + edi], 0
call fcn.004b8440
push esi
mov edi, eax
call fcn.00439d00
add esp, 0x10
test edi, edi
jne 0x4ca1c1
mov ebp, dword [esp + 0x10]
push 0
push ebp
call fcn.004b8350
mov edi, eax
add esp, 8
test edi, edi
je 0x4ca212
jmp 0x4ca1c5
mov ebp, dword [esp + 0x10]
push 0x405720
push 1
push 4
lea ecx, [esp + 0x20]
push ecx
call fcn.00401000
mov esi, dword [esp + 0x28]
mov ecx, esi
call fcn.00497d20
push eax
push edi
push esi
lea ecx, [esp + 0x20]
call fcn.00462f50
push 0
push 1
lea edx, [esp + 0x1c]
push edx
push str.onIMEComposition
push str.System.IME
mov ecx, esi
call fcn.004a7770
push edi
call fcn.00439d00
add esp, 4
push ebp
call fcn.00439d00
mov edi, dword [esp + 0x20]
add esp, 4
mov eax, dword [esp + 0x24]
push edi
push eax
call dword [0x563d5c]
mov eax, dword [esp + 0x18]
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x10
ret