Function at 0x4016d4
Capabilities:
Delete registry key
Query or enumerate registry value
Set registry value

Disassembly:
push ebp
lea ebp, [esp - 0x6d8]
sub esp, 0x758
mov eax, dword [0x41f060]
xor eax, ebp
mov dword [ebp + 0x6d4], eax
mov eax, dword [ebp + 0x6e0]
push ebx
push esi
mov esi, edx
push edi
mov dword [ebp - 0x68], ecx
push eax
mov ecx, esi
mov dword [ebp - 0x78], eax
mov dword [ebp - 0x80], esi
call fcn.00401469
pop ecx
lea eax, [ebp - 0x6c]
push eax
xor ebx, ebx
mov edi, 0xf003f
push edi
push ebx
push str.Keyboard_Layout
push esi
mov esi, dword [sym.imp.ADVAPI32.dll_RegOpenKeyExW]
mov dword [ebp - 0x6c], ebx
mov dword [ebp - 0x64], ebx
call esi
test eax, eax
je 0x401751
cmp byte [ebp + 0x6e4], bl
je 0x401939
push dword [ebp - 0x68]
push str.USERKeyboard_Layout
call fcn.00401f9e
pop ecx
pop ecx
jmp 0x401939
lea eax, [ebp - 0x64]
push eax
push edi
push ebx
push str.preload
push dword [ebp - 0x6c]
call esi
test eax, eax
je 0x40178a
cmp byte [ebp + 0x6e4], bl
je 0x40177c
push dword [ebp - 0x68]
push str.USERpreload
call fcn.00401f9e
pop ecx
pop ecx
push dword [ebp - 0x6c]
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
jmp 0x401939
push 0x64
lea eax, [ebp - 0x5c]
pop ecx
mov word [eax], bx
add eax, 0x12
dec ecx
jne 0x401790
mov dword [ebp - 0x60], ebx
xor edi, edi
push 0xa
pop esi
lea eax, [ebp - 0x70]
push eax
lea eax, [ebp + 0x6c0]
push eax
lea eax, [ebp - 0x74]
push eax
push ebx
lea eax, [ebp - 0x7c]
push eax
lea eax, [ebp + 0x6ac]
push eax
push edi
push dword [ebp - 0x64]
mov dword [ebp - 0x74], ebx
mov dword [ebp - 0x7c], esi
mov dword [ebp - 0x70], 0x12
call dword [sym.imp.ADVAPI32.dll_RegEnumValueW]
test eax, eax
jne 0x401814
push esi
lea eax, [ebp + 0x6ac]
push ebx
push eax
call fcn.00404cce
lea ecx, [eax - 1]
add esp, 0xc
cmp ecx, 0x62
ja 0x40180c
imul eax, eax, 0x12
lea ecx, [ebp + 0x6c0]
push ecx
lea eax, [ebp + eax - 0x6e]
push 9
push eax
call fcn.00405009
add esp, 0xc
inc dword [ebp - 0x60]
inc edi
cmp edi, 0x64
jl 0x40179e
jmp 0x40181a
call dword [sym.imp.KERNEL32.dll_GetLastError]
push dword [ebp - 0x64]
mov edi, dword [sym.imp.ADVAPI32.dll_RegCloseKey]
call edi
push str.preload
push dword [ebp - 0x6c]
call dword [sym.imp.ADVAPI32.dll_RegDeleteKeyW]
push dword [ebp - 0x78]
lea eax, [ebp + 0x6c0]
push str._08X
push 9
push eax
call fcn.004043d6
add esp, 0x10
xor esi, esi
cmp dword [ebp - 0x60], ebx
jle 0x401878
lea eax, [ebp - 0x5c]
mov dword [ebp - 0x70], eax
lea eax, [ebp + 0x6c0]
push eax
push dword [ebp - 0x70]
call fcn.00404d0d
test eax, eax
pop ecx
pop ecx
je 0x401878
add dword [ebp - 0x70], 0x12
inc esi
cmp esi, dword [ebp - 0x60]
jl 0x401859
cmp esi, dword [ebp - 0x60]
jne 0x40189c
lea eax, [ebp + 0x6c0]
push eax
mov eax, dword [ebp - 0x60]
imul eax, eax, 0x12
lea eax, [ebp + eax - 0x5c]
push 9
push eax
call fcn.00405009
add esp, 0xc
inc dword [ebp - 0x60]
push ebx
lea eax, [ebp - 0x64]
push eax
push ebx
push 0xf003f
push ebx
push ebx
push ebx
push str.Preload
push dword [ebp - 0x6c]
call dword [sym.imp.ADVAPI32.dll_RegCreateKeyExW]
test eax, eax
je 0x4018d5
cmp byte [ebp + 0x6e4], bl
je 0x40192f
push dword [ebp - 0x68]
push str._sKeyboard_LayoutPreload
call fcn.00401f9e
pop ecx
pop ecx
jmp 0x40192f
xor eax, eax
cmp dword [ebp - 0x60], ebx
jle 0x40191f
lea ecx, [ebp - 0x5c]
mov dword [ebp - 0x68], ecx
lea esi, [eax + 1]
push esi
push 0x41c33c
lea eax, [ebp + 0x6ac]
push 0xa
push eax
call fcn.004043d6
add esp, 0x10
push 0x10
push dword [ebp - 0x68]
lea eax, [ebp + 0x6ac]
push 1
push ebx
push eax
push dword [ebp - 0x64]
call dword [sym.imp.ADVAPI32.dll_RegSetValueExW]
add dword [ebp - 0x68], 0x12
mov eax, esi
cmp eax, dword [ebp - 0x60]
jl 0x4018e2
push dword [ebp - 0x64]
mov esi, dword [sym.imp.ADVAPI32.dll_RegFlushKey]
call esi
push dword [ebp - 0x80]
call esi
push dword [ebp - 0x64]
call edi
push dword [ebp - 0x6c]
call edi
mov ecx, dword [ebp + 0x6d4]
pop edi
pop esi
xor ecx, ebp
pop ebx
call fcn.00404331
add ebp, 0x6d8
leave
ret