Function at 0x4040c1
Capabilities:
Check if file exists
Delete registry value
Get file attributes
Query or enumerate registry value
Set registry value

Disassembly:
mov edi, edi
push ebp
mov ebp, esp
sub esp, 0x224
mov eax, dword [0x40f014]
xor eax, ebp
mov dword [ebp - 4], eax
mov eax, dword [ebp + 0x14]
push ebx
mov ebx, dword [ebp + 0x10]
push esi
push edi
mov edi, dword [ebp + 8]
xor esi, esi
mov dword [ebp - 0x220], eax
lea eax, [ebp - 0x210]
push eax
push 0x2001f
push esi
push 0x402470
push edi
mov dword [ebp - 0x210], esi
mov dword [ebp - 0x218], esi
call dword [sym.imp.ADVAPI32.dll_RegOpenKeyExW]
test eax, eax
je 0x404133
cmp dword [ebp + 0xc], esi
je 0x404133
lea eax, [ebp - 0x210]
push eax
push 0x402470
push edi
call dword [sym.imp.ADVAPI32.dll_RegCreateKeyW]
test eax, eax
jne 0x4042f1
lea eax, [ebp - 0x218]
push eax
push 0xf003f
push esi
push 0x40247c
push edi
call dword [sym.imp.ADVAPI32.dll_RegOpenKeyExW]
test eax, eax
je 0x404170
cmp dword [ebp + 0xc], esi
je 0x404170
lea eax, [ebp - 0x218]
push eax
push 0x40247c
push edi
call dword [sym.imp.ADVAPI32.dll_RegCreateKeyW]
test eax, eax
jne 0x4042f1
mov edi, dword [ebp - 0x210]
test edi, edi
je 0x404228
push 0x208
lea eax, [ebp - 0x20c]
mov dword [ebp - 0x21c], 1
push esi
push eax
mov dword [ebp - 0x214], 0x104
call sub.msvcrt.dll_memset
add esp, 0xc
lea eax, [ebp - 0x21c]
push esi
push esi
push eax
push esi
lea eax, [ebp - 0x214]
push eax
lea eax, [ebp - 0x20c]
push eax
push esi
push edi
call dword [sym.imp.ADVAPI32.dll_RegEnumValueW]
test eax, eax
jne 0x404228
mov edi, esi
lea eax, [ebp - 0x20c]
mov dword [ebp - 0x214], 0x104
push eax
inc edi
call dword [sym.imp.KERNEL32.dll_GetFileAttributesW]
cmp eax, 0xffffffff
jne 0x4041ff
lea eax, [ebp - 0x20c]
mov edi, esi
push eax
push dword [ebp - 0x210]
call dword [sym.imp.ADVAPI32.dll_RegDeleteValueW]
push esi
push esi
lea eax, [ebp - 0x21c]
push eax
push esi
lea eax, [ebp - 0x214]
push eax
lea eax, [ebp - 0x20c]
push eax
push edi
push dword [ebp - 0x210]
call dword [sym.imp.ADVAPI32.dll_RegEnumValueW]
test eax, eax
je 0x4041cd
mov edi, esi
cmp dword [ebp + 0xc], esi
jbe 0x404300
mov eax, dword [ebp - 0x220]
sub eax, ebx
mov dword [ebp - 0x21c], eax
cmp dword [ebx], esi
je 0x4042e2
push 1
push 0x4023a0
push 1
push esi
push dword [ebx]
push dword [ebp - 0x210]
call dword [sym.imp.ADVAPI32.dll_RegSetValueExW]
test eax, eax
jne 0x4042f1
cmp dword [ebp - 0x220], esi
je 0x4042e2
push 0x5c
push dword [ebx]
call dword [sym.imp.msvcrt.dll_wcsrchr]
pop ecx
pop ecx
test eax, eax
je 0x404286
add eax, 2
jmp 0x404288
mov eax, dword [ebx]
lea ecx, [ebp - 0x214]
mov dword [ebp - 0x214], esi
push ecx
push eax
push dword [ebp - 0x218]
call dword [sym.imp.ADVAPI32.dll_RegCreateKeyW]
test eax, eax
jne 0x4042f1
mov eax, dword [ebp - 0x21c]
push 4
mov eax, dword [eax + ebx]
mov dword [ebp - 0x224], eax
lea eax, [ebp - 0x224]
push eax
push 4
push esi
push 0x402494
push dword [ebp - 0x214]
call dword [sym.imp.ADVAPI32.dll_RegSetValueExW]
test eax, eax
jne 0x4042f1
push dword [ebp - 0x214]
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
inc edi
add ebx, 4
cmp edi, dword [ebp + 0xc]
jb 0x404241
jmp 0x404300
jg 0x4042f7
mov esi, eax
jmp 0x404300
movzx esi, ax
or esi, 0x80070000
mov edi, dword [ebp - 0x210]
test edi, edi
je 0x404311
push edi
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
cmp dword [ebp - 0x218], 0
je 0x404326
push dword [ebp - 0x218]
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
mov ecx, dword [ebp - 4]
mov eax, esi
pop edi
pop esi
xor ecx, ebp
pop ebx
call fcn.0040de60
leave
ret 0x10