Function at 0x40f5c0
Capabilities:
Query or enumerate registry key
Query or enumerate registry value

Disassembly:
sub esp, 0x224
push ebx
push ebp
push esi
xor esi, esi
push edi
mov dword [esp + 0x1c], esi
call fcn.004116f0
test eax, eax
lea eax, [esp + 0x10]
push eax
push 0xf003f
push esi
je 0x40f6ce
push str.Keyboard_LayoutPreload
push 0x80000001
call dword [sym.imp.ADVAPI32.dll_RegOpenKeyExA]
lea ecx, [esp + 0x18]
lea edx, [esp + 0x130]
mov edi, dword [sym.imp.ADVAPI32.dll_RegEnumValueA]
push ecx
push edx
mov edx, dword [esp + 0x18]
push esi
lea eax, [esp + 0x20]
push esi
lea ecx, [esp + 0x3c]
push eax
push ecx
mov ebx, 0x104
push esi
push edx
mov dword [esp + 0x34], ebx
mov dword [esp + 0x38], ebx
call edi
cmp eax, 0x103
je 0x40f6c4
mov ebp, dword [esp + 0x23c]
lea eax, [esp + 0x130]
push eax
call fcn.0040f820
add esp, 4
test eax, eax
je 0x40f689
test ebp, ebp
mov dword [esp + 0x1c], 1
jne 0x40f6c4
mov eax, dword [esp + 0x238]
test eax, eax
je 0x40f6c4
mov edx, dword [esp + 0x10]
lea ecx, [esp + 0x2c]
push ecx
push edx
call dword [sym.imp.ADVAPI32.dll_RegDeleteValueA]
push 0x80000001
call dword [sym.imp.ADVAPI32.dll_RegFlushKey]
or esi, 0xffffffff
jmp 0x40f68d
test ebp, ebp
jne 0x40f6c4
lea eax, [esp + 0x18]
lea ecx, [esp + 0x130]
push eax
push ecx
mov ecx, dword [esp + 0x18]
push 0
lea edx, [esp + 0x20]
push 0
lea eax, [esp + 0x3c]
inc esi
push edx
push eax
push esi
push ecx
mov dword [esp + 0x34], ebx
mov dword [esp + 0x38], ebx
call edi
cmp eax, 0x103
jne 0x40f63e
mov edx, dword [esp + 0x10]
push edx
jmp 0x40f7eb
mov edi, dword [sym.imp.ADVAPI32.dll_RegOpenKeyExA]
push str.keyboard_layoutpreload
push 0x80000001
call edi
lea ecx, [esp + 0x24]
mov ebp, dword [sym.imp.ADVAPI32.dll_RegEnumKeyExA]
push ecx
mov ecx, dword [esp + 0x14]
push esi
push esi
lea edx, [esp + 0x20]
push esi
lea eax, [esp + 0x3c]
push edx
push eax
mov ebx, 0x104
push esi
push ecx
mov dword [esp + 0x34], ebx
call ebp
cmp eax, 0x103
je 0x40f7e6
mov ecx, dword [esp + 0x10]
lea edx, [esp + 0x20]
push edx
push 0xf003f
lea eax, [esp + 0x34]
push 0
push eax
push ecx
call edi
mov ecx, dword [esp + 0x20]
lea edx, [esp + 0x18]
lea eax, [esp + 0x130]
push edx
push eax
push 0
push 0
push 0x4313e8
push ecx
mov dword [esp + 0x30], ebx
call dword [sym.imp.ADVAPI32.dll_RegQueryValueExA]
mov edx, dword [esp + 0x20]
push edx
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
lea eax, [esp + 0x130]
push eax
call fcn.0040f820
add esp, 4
test eax, eax
je 0x40f7ae
mov eax, dword [esp + 0x23c]
mov dword [esp + 0x1c], 1
test eax, eax
jne 0x40f7e6
mov eax, dword [esp + 0x238]
test eax, eax
je 0x40f7e6
mov edx, dword [esp + 0x10]
lea ecx, [esp + 0x2c]
push ecx
push edx
call dword [sym.imp.ADVAPI32.dll_RegDeleteKeyA]
push 0x80000001
call dword [sym.imp.ADVAPI32.dll_RegFlushKey]
or esi, 0xffffffff
jmp 0x40f7b9
mov eax, dword [esp + 0x23c]
test eax, eax
jne 0x40f7e6
lea eax, [esp + 0x24]
lea ecx, [esp + 0x14]
push eax
mov eax, dword [esp + 0x14]
push 0
push 0
push 0
lea edx, [esp + 0x3c]
inc esi
push ecx
push edx
push esi
push eax
mov dword [esp + 0x34], ebx
call ebp
cmp eax, 0x103
jne 0x40f714
mov ecx, dword [esp + 0x10]
push ecx
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
mov eax, dword [esp + 0x238]
pop edi
pop esi
pop ebp
test eax, eax
pop ebx
je 0x40f80d
push 0x80000001
call fcn.00401840
add esp, 4
mov eax, dword [esp + 0xc]
add esp, 0x224
ret