Function at 0x140182c30
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 r12, qword [sym.imp.USER32.dll_GetKeyboardLayoutList]
xor edx, edx
xor ecx, ecx
xor ebp, ebp
call r12
mov edi, eax
test eax, eax
jle 0x140182f2d
mov r9d, 0x1a2
lea r8, str.refresh_locale_list
lea rdx, [0x14036a6e0]
mov ecx, 2
mov dword [rsp + 0x20], eax
call qword [case.0x1401833e5.0]
call qword [sym.imp.USER32.dll_GetForegroundWindow]
xor edx, edx
mov rcx, rax
call qword [sym.imp.USER32.dll_GetWindowThreadProcessId]
mov rsi, qword [sym.imp.USER32.dll_GetKeyboardLayout]
mov ecx, eax
call rsi
xor ecx, ecx
mov rbx, rax
call rsi
movsxd rcx, edi
shl rcx, 3
mov qword [rsp + 0x40], rax
call sub.api_ms_win_crt_heap_l1_1_0.dll_malloc
mov ecx, edi
mov qword [rsp + 0x38], rax
mov rdx, rax
call r12
mov r12d, eax
test eax, eax
jle 0x140182ef3
mov rax, qword [case.0x1401833e5.0]
cmp edi, r12d
je 0x140183059
mov dword [rsp + 0x28], r12d
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], edi
mov ecx, 3
call rax
mov r15, qword [0x140404fc8]
test r15, r15
je 0x1401830b4
movsxd rdx, r12d
mov rax, qword [rsp + 0x38]
xor edi, edi
xor ebp, ebp
mov qword [rsp + 0x48], rdx
lea r13, str.refresh_locale_list
lea rsi, str._s___u_:_Removing_locale_ID__p_from_the_cache._n
lea r12, [rax + rdx*8]
lea r14, str._s___u_:_Found_locale_ID__p_in_the_cache._n
nop word [rax + rax]
mov rdx, qword [r15]
mov rax, qword [rsp + 0x38]
nop dword [rax + rax]
cmp rdx, qword [rax]
je 0x140182f48
add rax, 8
cmp r12, rax
jne 0x140182d50
mov qword [rsp + 0x20], rdx
mov r8, r13
mov rdx, rsi
mov ecx, 1
mov r9d, 0x1d6
call qword [case.0x1401833e5.0]
mov rax, qword [r15 + 0x28]
cmp qword [0x140404fc0], r15
mov qword [rdi + 0x28], rax
je 0x140182f80
mov rcx, r15
call fcn.14018a3c0
mov r15, qword [rdi + 0x28]
test r15, r15
jne 0x140182d40
mov rdx, qword [rsp + 0x48]
mov rax, qword [rsp + 0x38]
mov qword [rsp + 0x48], rbx
mov r15, qword [sym.imp.USER32.dll_ActivateKeyboardLayout]
mov r14, rax
lea r13, [rax + rdx*8]
jmp 0x140182dfc
mov rax, qword [r14]
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.0x1401833e5.0]
add r14, 8
cmp r14, r13
je 0x140182f19
mov rcx, qword [r14]
test rcx, rcx
je 0x140182def
lea rsi, [rsp + 0x170]
xor edx, edx
call r15
mov dword [rsp + 0x54], 0x104
mov rcx, rsi
mov dword [rsp + 0x50], 1
call qword [sym.imp.USER32.dll_GetKeyboardLayoutNameA]
test eax, eax
je 0x140182dc8
lea r12, [rsp + 0x280]
mov r9, rsi
mov edx, 0x3c
lea r8, str.SYSTEMCurrentControlSetControlKeyboard_Layouts_s
mov rcx, r12
call fcn.140189fb0
lea rax, [rsp + 0x58]
xor r8d, r8d
mov rdx, r12
mov qword [rsp + 0x20], rax
mov r9d, 1
mov rcx, 0xffffffff80000002
call qword [sym.imp.ADVAPI32.dll_RegOpenKeyExA]
test eax, eax
jne 0x140182dc8
lea rax, [rsp + 0x54]
lea rbx, [rsp + 0x60]
xor r8d, r8d
mov rcx, qword [rsp + 0x58]
mov qword [rsp + 0x28], rax
lea r9, [rsp + 0x50]
lea rdx, str.Layout_File
mov qword [rsp + 0x20], rbx
call qword [sym.imp.ADVAPI32.dll_RegQueryValueExA]
test eax, eax
jne 0x140182dc8
mov rcx, qword [rsp + 0x58]
call qword [sym.imp.ADVAPI32.dll_RegCloseKey]
mov edx, 0x104
mov rcx, rsi
call qword [sym.imp.KERNEL32.dll_GetSystemDirectoryA]
test eax, eax
jne 0x140182f99
mov r9d, 0x237
lea r8, str.refresh_locale_list
mov ecx, 4
lea rdx, str._s___u_:_GetSystemDirectory___failed__n
call qword [case.0x1401833e5.0]
jmp 0x140182def
mov r9d, 0x243
lea r8, str.refresh_locale_list
mov ecx, 4
lea rdx, str._s___u_:_GetKeyboardLayoutList___failed__n
call qword [case.0x1401833e5.0]
mov r15, qword [sym.imp.USER32.dll_ActivateKeyboardLayout]
mov rcx, qword [rsp + 0x38]
call fcn.14018a3c0
mov rcx, qword [rsp + 0x40]
xor edx, edx
call r15
mov eax, ebp
add rsp, 0x398
pop rbx
pop rsi
pop rdi
pop rbp
pop r12
pop r13
pop r14
pop r15
ret
mov qword [rax], 0
mov rax, qword [r15]
mov r9d, 0x1c9
mov r8, r13
mov rdx, r14
mov ecx, 1
mov qword [rsp + 0x20], rax
call qword [case.0x1401833e5.0]
cmp qword [r15], rbx
je 0x140182f90
add ebp, 1
mov rdi, r15
jmp 0x140182d9b
mov qword [0x140404fc0], 0
jmp 0x140182d93
mov qword [0x140404fc0], r15
jmp 0x140182f73
mov qword [rsp + 0x20], rbx
mov r9, rsi
mov edx, 0x104
mov rcx, r12
lea r8, str._s_s
call fcn.140189fb0
mov qword [rsp + 0x28], rbx
mov rax, qword [r14]
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 + 0x20], rax
call qword [case.0x1401833e5.0]
mov ecx, 0x30
call sub.api_ms_win_crt_heap_l1_1_0.dll_malloc
mov rcx, r12
mov rbx, rax
mov rax, qword [r14]
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 0x14018307e
call rax
mov rdx, qword [rax]
movq xmm0, qword [rdx]
movhps xmm0, qword [rax + 8]
movups xmmword [rbx + 0x10], xmm0
mov rax, qword [rax + 0x10]
mov qword [rbx + 0x28], 0
mov qword [rbx + 0x20], rax
test rdi, rdi
je 0x1401830c9
mov qword [rdi + 0x28], rbx
mov rax, qword [rsp + 0x48]
cmp qword [rbx], rax
je 0x1401830c0
add ebp, 1
mov rdi, rbx
jmp 0x140182def
mov dword [rsp + 0x20], r12d
mov r9d, 0x1b2
lea r8, str.refresh_locale_list
lea rdx, str._s___u_:_Received__i_locales._n
mov ecx, 2
call rax
jmp 0x140182d00
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.0x1401833e5.0]
mov rcx, qword [rbx + 8]
call qword [sym.imp.KERNEL32.dll_FreeLibrary]
mov rcx, rbx
call fcn.14018a3c0
jmp 0x140182def
xor edi, edi
xor ebp, ebp
movsxd rdx, r12d
jmp 0x140182da9
mov qword [0x140404fc0], rbx
jmp 0x14018304e
mov qword [0x140404fc8], rbx
jmp 0x140183044