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

Disassembly:
sub esp, 0x764
mov eax, dword [0x56957c]
xor eax, esp
mov dword [esp + 0x760], eax
mov eax, dword [esp + 0x768]
push esi
mov esi, dword [sym.imp.ADVAPI32.dll_RegOpenKeyExW]
push edi
lea ecx, [esp + 8]
push ecx
xor edi, edi
push 0xf003f
push edi
push str.Keyboard_Layout
push SysReAllocString
mov dword [esp + 0x34], eax
mov dword [esp + 0x24], edi
mov dword [esp + 0x1c], edi
mov dword [esp + 0x20], edi
call esi
test eax, eax
jne 0x408df6
mov eax, dword [esp + 8]
lea edx, [esp + 0xc]
push edx
push 0xf003f
push edi
push str.preload
push eax
call esi
test eax, eax
je 0x408e0f
mov ecx, dword [esp + 8]
push ecx
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
pop edi
xor al, al
pop esi
mov ecx, dword [esp + 0x760]
xor ecx, esp
call fcn.004ecddb
add esp, 0x764
ret
lea eax, [esp + 0x60]
mov ecx, 0x64
xor edx, edx
mov word [eax], dx
add eax, 0x12
sub ecx, 1
jne 0x408e18
push ebx
push ebp
mov ebp, dword [sym.imp.ADVAPI32.dll_RegEnumValueW]
xor ebx, ebx
xor esi, esi
lea eax, [esp + 0x20]
push eax
lea ecx, [esp + 0x30]
push ecx
lea edx, [esp + 0x2c]
push edx
mov edx, dword [esp + 0x20]
push edi
lea eax, [esp + 0x2c]
push eax
lea ecx, [esp + 0x54]
push ecx
push esi
push edx
mov dword [esp + 0x44], edi
mov dword [esp + 0x3c], 0xa
mov dword [esp + 0x40], 0x12
call ebp
test eax, eax
jne 0x408ea1
push 0xa
lea eax, [esp + 0x44]
push edi
push eax
call fcn.004ed75f
lea ecx, [eax - 1]
add esp, 0xc
cmp ecx, 0x62
ja 0x408e9b
lea edx, [esp + 0x2c]
push edx
lea eax, [eax + eax*8]
lea ecx, [esp + eax*2 + 0x5a]
push 9
push ecx
call fcn.004ee6af
add esp, 0xc
inc ebx
inc esi
cmp esi, 0x64
jl 0x408e31
mov edx, dword [esp + 0x28]
push edx
lea eax, [esp + 0x30]
push str._08X
push eax
call fcn.00411ab0
add esp, 0xc
xor esi, esi
cmp ebx, edi
jle 0x408edc
lea edi, [esp + 0x68]
lea ecx, [esp + 0x2c]
push ecx
push edi
call fcn.004ecf82
add esp, 8
test eax, eax
je 0x408edc
inc esi
add edi, 0x12
cmp esi, ebx
jl 0x408ec2
cmp esi, ebx
jne 0x408ef8
lea edx, [esp + 0x2c]
push edx
lea eax, [ebx + ebx*8]
lea ecx, [esp + eax*2 + 0x6c]
push 9
push ecx
call fcn.004ee6af
add esp, 0xc
inc ebx
lea edi, [esp + 0x68]
mov ebp, 2
push 0x10
push 0
push edi
call fcn.004ed75f
add esp, 0xc
cmp eax, 0x10000
jge 0x408f19
inc dword [esp + 0x18]
add edi, 0x12
sub ebp, 1
jne 0x408f01
mov eax, dword [esp + 0x18]
cmp esi, eax
je 0x408f68
cmp eax, ebx
jge 0x408f68
lea edi, [eax + eax*8]
lea edi, [esp + edi*2 + 0x68]
push edi
lea edx, [esp + 0x58]
push 9
push edx
call fcn.004ee6af
lea eax, [esp + 0x38]
push eax
push 9
push edi
call fcn.004ee6af
lea ecx, [esp + 0x6c]
push ecx
lea edx, [esi + esi*8]
lea eax, [esp + edx*2 + 0x84]
push 9
push eax
call fcn.004ee6af
add esp, 0x24
mov ecx, dword [esp + 0x14]
mov edi, dword [sym.imp.ADVAPI32.dll_RegCloseKey]
push ecx
call edi
lea esi, [ebx - 1]
test esi, esi
jl 0x408fa3
mov ebp, dword [sym.imp.USER32.dll_LoadKeyboardLayoutW]
lea edi, [esi + esi*8]
lea edi, [esp + edi*2 + 0x68]
lea esp, [esp]
push 9
push edi
call ebp
dec esi
sub edi, 0x12
test esi, esi
jge 0x408f90
mov edi, dword [sym.imp.ADVAPI32.dll_RegCloseKey]
mov edx, dword [esp + 0x10]
push str.preload
push edx
call dword [sym.imp.ADVAPI32.dll_RegDeleteKeyW]
mov ecx, dword [esp + 0x10]
push 0
lea eax, [esp + 0x18]
push eax
push 0
push 0xf003f
push 0
push 0
push 0
push str.Preload
push ecx
call dword [sym.imp.ADVAPI32.dll_RegCreateKeyExW]
test eax, eax
je 0x408fe6
mov edx, dword [esp + 0x10]
push edx
call edi
xor al, al
jmp 0x40903d
xor eax, eax
test ebx, ebx
jle 0x40902d
mov ebp, dword [sym.imp.ADVAPI32.dll_RegSetValueExW]
lea edi, [esp + 0x68]
lea esi, [eax + 1]
push esi
push 0x544fb4
lea edx, [esp + 0x48]
call fcn.00411ad0
mov ecx, dword [esp + 0x1c]
add esp, 8
push 0x10
push edi
push 1
push 0
lea eax, [esp + 0x50]
push eax
push ecx
call ebp
mov eax, esi
add edi, 0x12
cmp eax, ebx
jl 0x408ff6
mov edi, dword [sym.imp.ADVAPI32.dll_RegCloseKey]
mov edx, dword [esp + 0x14]
push edx
call edi
mov eax, dword [esp + 0x10]
push eax
call edi
mov al, 1
mov ecx, dword [esp + 0x770]
pop ebp
pop ebx
pop edi
pop esi
xor ecx, esp
call fcn.004ecddb
add esp, 0x764
ret