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

Disassembly:
sub esp, 0x764
mov eax, dword [0x45b660]
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 0x80000001
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 0x4023c6
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 0x4023df
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.0041b397
add esp, 0x764
ret
lea eax, [esp + 0x60]
mov ecx, 0x64
jmp 0x4023f0
mov word [eax], di
add eax, 0x12
sub ecx, 1
jne 0x4023f0
push ebx
push ebp
mov ebp, dword [sym.imp.ADVAPI32.dll_RegEnumValueW]
xor ebx, ebx
xor esi, esi
lea edx, [esp + 0x20]
push edx
lea eax, [esp + 0x30]
push eax
lea ecx, [esp + 0x2c]
push ecx
mov ecx, dword [esp + 0x20]
push edi
lea edx, [esp + 0x2c]
push edx
lea eax, [esp + 0x54]
push eax
push esi
push ecx
mov dword [esp + 0x44], edi
mov dword [esp + 0x3c], 0xa
mov dword [esp + 0x40], 0x12
call ebp
test eax, eax
jne 0x40247b
push 0xa
lea edx, [esp + 0x44]
push edi
push edx
call fcn.0041b9e3
lea ecx, [eax - 1]
add esp, 0xc
cmp ecx, 0x62
ja 0x402473
lea edx, [esp + 0x2c]
push edx
lea eax, [eax + eax*8]
lea ecx, [esp + eax*2 + 0x5a]
push 9
push ecx
call fcn.0041bcdd
add esp, 0xc
add ebx, 1
add esi, 1
cmp esi, 0x64
jl 0x402407
mov edx, dword [esp + 0x28]
push edx
lea eax, [esp + 0x30]
push str._08X
push eax
call fcn.00403100
add esp, 0xc
xor esi, esi
cmp ebx, edi
jle 0x4024bc
lea edi, [esp + 0x68]
lea esp, [esp]
lea ecx, [esp + 0x2c]
push ecx
push edi
call fcn.0041bb45
add esp, 8
test eax, eax
je 0x4024bc
add esi, 1
add edi, 0x12
cmp esi, ebx
jl 0x4024a0
cmp esi, ebx
jne 0x4024da
lea edx, [esp + 0x2c]
push edx
lea eax, [ebx + ebx*8]
lea ecx, [esp + eax*2 + 0x6c]
push 9
push ecx
call fcn.0041bcdd
add esp, 0xc
add ebx, 1
lea edi, [esp + 0x68]
mov ebp, 2
push 0x10
push 0
push edi
call fcn.0041b9e3
add esp, 0xc
cmp eax, 0x10000
jge 0x4024fc
add dword [esp + 0x18], 1
add edi, 0x12
sub ebp, 1
jne 0x4024e3
mov eax, dword [esp + 0x18]
cmp esi, eax
je 0x40254b
cmp eax, ebx
jge 0x40254b
lea edi, [eax + eax*8]
lea edi, [esp + edi*2 + 0x68]
push edi
lea edx, [esp + 0x58]
push 9
push edx
call fcn.0041bcdd
lea eax, [esp + 0x38]
push eax
push 9
push edi
call fcn.0041bcdd
lea ecx, [esp + 0x6c]
push ecx
lea edx, [esi + esi*8]
lea eax, [esp + edx*2 + 0x84]
push 9
push eax
call fcn.0041bcdd
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 0x402585
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
sub esi, 1
sub edi, 0x12
test esi, esi
jge 0x402570
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 0x4025c8
mov edx, dword [esp + 0x10]
push edx
call edi
xor al, al
jmp 0x402627
xor eax, eax
test ebx, ebx
jle 0x402617
mov ebp, dword [sym.imp.ADVAPI32.dll_RegSetValueExW]
lea edi, [esp + 0x68]
jmp 0x4025e0
lea esi, [eax + 1]
push esi
push 0x4510d0
lea edx, [esp + 0x48]
call fcn.00403120
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 0x4025e0
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.0041b397
add esp, 0x764
ret