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

Disassembly:
push ebp
lea ebp, [esp - 0x78]
mov eax, 0x21c0
call fcn.0041d880
mov eax, dword [0x43fb20]
xor eax, ebp
mov dword [ebp + 0x74], eax
push ebx
push esi
call fcn.00409933
mov esi, eax
xor ebx, ebx
cmp esi, ebx
mov dword [ebp - 0x213c], esi
je 0x40e4e6
push esi
lea eax, [ebp - 0x12c]
push str.SYSTEMCurrentControlSetControlKeyboard_Layouts_x
push eax
call fcn.0041a16c
add esp, 0xc
lea eax, [ebp - 0x12c]
push eax
push 0x80000002
call dword [sym.imp.ADVAPI32.dll_RegDeleteKeyW]
push esi
lea eax, [ebp - 0x12c]
push str._08x
push eax
call fcn.0041a16c
xor eax, eax
inc eax
push eax
mov dword [ebp - 0x2130], eax
mov esi, 0x434100
lea eax, [ebp - 0x2c]
push esi
push eax
mov dword [ebp - 0x2148], ebx
call fcn.0041a16c
add esp, 0x18
lea eax, [ebp - 0x2134]
push eax
push 3
push ebx
push str.Keyboard_LayoutPreload
push 0x80000001
call dword [sym.imp.ADVAPI32.dll_RegOpenKeyExW]
test eax, eax
jne 0x40e4e6
push edi
push 0x50
pop edi
push edi
call fcn.0040f40a
pop ecx
push dword [ebp - 0x213c]
mov dword [ebp - 0x2138], eax
mov dword [ebp - 0x2140], 1
mov dword [ebp - 0x2144], edi
call dword [sym.imp.USER32.dll_UnloadKeyboardLayout]
mov edi, dword [sym.imp.ADVAPI32.dll_RegQueryValueExW]
jmp 0x40e2e7
lea eax, [ebp - 0x12c]
push eax
push dword [ebp - 0x2138]
call fcn.00418f4c
pop ecx
test eax, eax
pop ecx
lea eax, [ebp - 0x2c]
je 0x40e30e
inc dword [ebp - 0x2130]
push dword [ebp - 0x2130]
push esi
push eax
call fcn.0041a16c
add esp, 0xc
lea eax, [ebp - 0x2144]
push eax
push dword [ebp - 0x2138]
lea eax, [ebp - 0x2140]
push eax
push ebx
lea eax, [ebp - 0x2c]
push eax
push dword [ebp - 0x2134]
call edi
test eax, eax
je 0x40e2b6
jmp 0x40e33b
push eax
push dword [ebp - 0x2134]
call dword [sym.imp.ADVAPI32.dll_RegDeleteValueW]
lea eax, [ebp - 0x213c]
push eax
push 0x5dc
push ebx
push str.HKEY_CURRENT_USERKeyboard_LayoutPreload
push ebx
push 0x1a
push 0xffff
call dword [sym.imp.USER32.dll_SendMessageTimeoutW]
lea eax, [ebp - 0x212c]
mov dword [ebp - 0x2130], 1
mov dword [ebp - 0x213c], eax
push dword [ebp - 0x2130]
lea eax, [ebp - 0x2c]
push esi
push eax
call fcn.0041a16c
add esp, 0xc
lea eax, [ebp - 0x2144]
push eax
push dword [ebp - 0x2138]
lea eax, [ebp - 0x2140]
push eax
push ebx
lea eax, [ebp - 0x2c]
push eax
push dword [ebp - 0x2134]
call edi
test eax, eax
jne 0x40e3ac
push dword [ebp - 0x2138]
push dword [ebp - 0x213c]
call fcn.0041a076
inc dword [ebp - 0x2148]
add dword [ebp - 0x213c], 0x100
pop ecx
pop ecx
inc dword [ebp - 0x2130]
cmp dword [ebp - 0x2130], 0x20
jl 0x40e351
mov dword [ebp - 0x2130], 1
push dword [ebp - 0x2130]
lea eax, [ebp - 0x2c]
push esi
push eax
call fcn.0041a16c
add esp, 0xc
lea eax, [ebp - 0x2144]
push eax
push dword [ebp - 0x2138]
lea eax, [ebp - 0x2140]
push eax
push ebx
lea eax, [ebp - 0x2c]
push eax
push dword [ebp - 0x2134]
call edi
test eax, eax
jne 0x40e40d
lea eax, [ebp - 0x2c]
push eax
push dword [ebp - 0x2134]
call dword [sym.imp.ADVAPI32.dll_RegDeleteValueW]
inc dword [ebp - 0x2130]
cmp dword [ebp - 0x2130], 0x20
jl 0x40e3c5
push dword [ebp - 0x2134]
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
lea eax, [ebp - 0x2134]
push eax
push 0xf003f
push ebx
push str.Keyboard_LayoutPreload
push 0x80000001
call dword [sym.imp.ADVAPI32.dll_RegOpenKeyExW]
test eax, eax
jne 0x40e4d9
cmp dword [ebp - 0x2148], ebx
jle 0x40e4ad
lea ecx, [ebp - 0x212c]
mov dword [ebp - 0x2130], ecx
lea edi, [eax + 1]
push edi
lea eax, [ebp - 0x2c]
push esi
push eax
call fcn.0041a16c
push dword [ebp - 0x2130]
call fcn.0041970d
add esp, 0x10
add eax, eax
push eax
push dword [ebp - 0x2130]
lea eax, [ebp - 0x2c]
push 1
push ebx
push eax
push dword [ebp - 0x2134]
call dword [sym.imp.ADVAPI32.dll_RegSetValueExW]
add dword [ebp - 0x2130], 0x100
mov eax, edi
cmp eax, dword [ebp - 0x2148]
jl 0x40e461
push dword [ebp - 0x2134]
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
lea eax, [ebp - 0x213c]
push eax
push 0x5dc
push ebx
push str.HKEY_CURRENT_USERKeyboard_LayoutPreload
push ebx
push 0x1a
push 0xffff
call dword [sym.imp.USER32.dll_SendMessageTimeoutW]
push dword [ebp - 0x2138]
call fcn.0040f40f
pop ecx
pop edi
mov ecx, dword [ebp + 0x74]
pop esi
xor ecx, ebp
pop ebx
call fcn.00418c19
add ebp, 0x78
leave
ret