Function at 0x1401777c0
Capabilities:
Get common file path
Get keyboard layout
Query or enumerate registry value

Disassembly:
push r15
push r14
push r13
push r12
push rbp
push rdi
push rsi
push rbx
sub rsp, 0x398
mov rdi, qword [sym.imp.USER32.dll_GetKeyboardLayoutList]
xor edx, edx
xor ecx, ecx
xor r14d, r14d
call rdi
mov ebx, eax
test eax, eax
jle 0x140177aae
mov r9d, 0x1a2
lea r8, str.refresh_locale_list
lea rdx, str._s___u_:_GetKeyboardLayoutList_0__NULL__found__i_layouts._n
mov ecx, 2
mov dword [rsp + 0x20], eax
call qword [case.0x140177f95.0]
call qword [sym.imp.USER32.dll_GetForegroundWindow]
xor edx, edx
mov rcx, rax
call qword [sym.imp.USER32.dll_GetWindowThreadProcessId]
mov rbp, qword [sym.imp.USER32.dll_GetKeyboardLayout]
mov ecx, eax
call rbp
xor ecx, ecx
mov rsi, rax
call rbp
movsxd rcx, ebx
shl rcx, 3
mov qword [rsp + 0x38], rax
call sub.msvcrt.dll_malloc
mov ecx, ebx
mov r12, rax
mov rdx, rax
call rdi
mov edi, eax
test eax, eax
jle 0x140177a77
mov rax, qword [case.0x140177f95.0]
cmp ebx, edi
je 0x140177bf7
mov dword [rsp + 0x28], edi
mov r9d, 0x1af
lea r8, str.refresh_locale_list
lea rdx, str._s___u_:_Locale_size_mismatch___Expected__i__received__i__n
mov dword [rsp + 0x20], ebx
mov ecx, 3
call rax
mov r15, qword [0x1403d4368]
test r15, r15
je 0x140177c51
lea eax, [rdi - 1]
lea rdi, [r12 + 8]
xor r13d, r13d
xor r14d, r14d
mov dword [rsp + 0x48], eax
lea rbx, [rdi + rax*8]
lea rbp, str._s___u_:_Found_locale_ID__p_in_the_cache._n
mov qword [rsp + 0x40], rdi
lea rdi, str.refresh_locale_list
nop dword [rax + rax]
mov rdx, qword [r15]
mov rax, r12
jmp 0x1401778dd
add rax, 8
cmp rax, rbx
je 0x140177ac5
cmp rdx, qword [rax]
jne 0x1401778d0
mov qword [rax], 0
mov rax, qword [r15]
mov r9d, 0x1c9
mov r8, rdi
mov rdx, rbp
mov ecx, 1
mov qword [rsp + 0x20], rax
call qword [case.0x140177f95.0]
cmp qword [r15], rsi
je 0x140177b08
add r14d, 1
mov r13, r15
mov r15, qword [r13 + 0x28]
test r15, r15
jne 0x1401778c8
mov eax, dword [rsp + 0x48]
mov rdi, qword [rsp + 0x40]
mov qword [rsp + 0x48], rsi
mov r15, r13
mov rbp, qword [sym.imp.USER32.dll_ActivateKeyboardLayout]
mov rsi, r12
lea rdi, [rdi + rax*8]
jmp 0x14017797c
mov rax, qword [rsi]
mov r9d, 0x23c
lea r8, str.refresh_locale_list
lea rdx, str._s___u_:_Could_not_find_keyboard_map_for_locale__p__n
mov ecx, 4
mov qword [rsp + 0x20], rax
call qword [case.0x140177f95.0]
add rsi, 8
cmp rsi, rdi
je 0x140177a9d
mov rcx, qword [rsi]
test rcx, rcx
je 0x14017796f
lea rbx, [rsp + 0x170]
xor edx, edx
call rbp
mov dword [rsp + 0x54], 0x104
mov rcx, rbx
mov dword [rsp + 0x50], 1
call qword [sym.imp.USER32.dll_GetKeyboardLayoutNameA]
test eax, eax
je 0x140177948
lea r13, [rsp + 0x280]
mov r9, rbx
mov edx, 0x3c
lea r8, str.SYSTEMCurrentControlSetControlKeyboard_Layouts_s
mov rcx, r13
call fcn.140177560
lea rax, [rsp + 0x58]
xor r8d, r8d
mov rdx, r13
mov qword [rsp + 0x20], rax
mov r9d, 1
mov rcx, 0xffffffff80000002
call qword [sym.imp.ADVAPI32.dll_RegOpenKeyExA]
test eax, eax
jne 0x140177948
lea rax, [rsp + 0x54]
xor r8d, r8d
mov rcx, qword [rsp + 0x58]
lea r9, [rsp + 0x50]
mov qword [rsp + 0x28], rax
lea rax, [rsp + 0x60]
lea rdx, str.Layout_File
mov qword [rsp + 0x40], rax
mov qword [rsp + 0x20], rax
call qword [sym.imp.ADVAPI32.dll_RegQueryValueExA]
test eax, eax
jne 0x140177948
mov rcx, qword [rsp + 0x58]
call qword [sym.imp.ADVAPI32.dll_RegCloseKey]
mov edx, 0x104
mov rcx, rbx
call qword [sym.imp.KERNEL32.dll_GetSystemDirectoryA]
test eax, eax
jne 0x140177b25
mov r9d, 0x237
lea r8, str.refresh_locale_list
mov ecx, 4
lea rdx, str._s___u_:_GetSystemDirectory___failed__n
call qword [case.0x140177f95.0]
jmp 0x14017796f
mov r9d, 0x243
lea r8, str.refresh_locale_list
mov ecx, 4
lea rdx, str._s___u_:_GetKeyboardLayoutList___failed__n
call qword [case.0x140177f95.0]
mov rbp, qword [sym.imp.USER32.dll_ActivateKeyboardLayout]
mov rcx, r12
call fcn.14018d6b8
mov rcx, qword [rsp + 0x38]
xor edx, edx
call rbp
mov eax, r14d
add rsp, 0x398
pop rbx
pop rsi
pop rdi
pop rbp
pop r12
pop r13
pop r14
pop r15
ret
mov qword [rsp + 0x20], rdx
mov r9d, 0x1d6
mov r8, rdi
lea rdx, str._s___u_:_Removing_locale_ID__p_from_the_cache._n
mov ecx, 1
call qword [case.0x140177f95.0]
mov rax, qword [r15 + 0x28]
cmp qword [0x1403d4360], r15
mov qword [r13 + 0x28], rax
je 0x140177b18
mov rcx, r15
call fcn.14018d6b8
jmp 0x140177918
mov qword [0x1403d4360], r15
jmp 0x140177911
mov qword [0x1403d4360], 0
jmp 0x140177af6
mov rax, qword [rsp + 0x40]
mov r9, rbx
mov edx, 0x104
mov rcx, r13
lea r8, str._s_s
mov qword [rsp + 0x20], rax
call fcn.140177560
mov rax, qword [rsp + 0x40]
lea rdx, str._s___u_:_Loading_layout_for__p:__s._n
mov r9d, 0x1fe
lea r8, str.refresh_locale_list
mov ecx, 1
mov qword [rsp + 0x28], rax
mov rax, qword [rsi]
mov qword [rsp + 0x20], rax
call qword [case.0x140177f95.0]
mov ecx, 0x30
call sub.msvcrt.dll_malloc
mov rcx, r13
mov rbx, rax
mov rax, qword [rsi]
mov qword [rbx], rax
call qword [sym.imp.KERNEL32.dll_LoadLibraryA]
lea rdx, str.KbdLayerDescriptor
mov qword [rbx + 8], rax
mov rcx, rax
call qword [sym.imp.KERNEL32.dll_GetProcAddress]
test rax, rax
je 0x140177c1b
call rax
mov rdx, qword [rax]
mov rdx, qword [rdx]
mov qword [rbx + 0x10], rdx
mov rdx, qword [rax + 8]
mov rax, qword [rax + 0x10]
mov qword [rbx + 0x28], 0
mov qword [rbx + 0x18], rdx
mov qword [rbx + 0x20], rax
test r15, r15
je 0x140177c79
mov qword [r15 + 0x28], rbx
mov rax, qword [rsp + 0x48]
cmp qword [rbx], rax
je 0x140177c6d
add r14d, 1
mov r15, rbx
jmp 0x14017796f
mov dword [rsp + 0x20], edi
mov r9d, 0x1b2
lea r8, str.refresh_locale_list
lea rdx, str._s___u_:_Received__i_locales._n
mov ecx, 2
call rax
jmp 0x14017788a
mov r9d, 0x22e
lea r8, str.refresh_locale_list
mov ecx, 4
lea rdx, str._s___u_:_GetProcAddress___failed_for_KbdLayerDescriptor__n
call qword [case.0x140177f95.0]
mov rcx, qword [rbx + 8]
call qword [sym.imp.KERNEL32.dll_FreeLibrary]
mov rcx, rbx
call fcn.14018d6b8
jmp 0x14017796f
lea eax, [rdi - 1]
xor r13d, r13d
xor r14d, r14d
mov dword [rsp + 0x48], eax
lea rax, [r12 + 8]
mov qword [rsp + 0x40], rax
jmp 0x140177921
mov qword [0x1403d4360], rbx
jmp 0x140177beb
mov qword [0x1403d4368], rbx
jmp 0x140177bdd