Function at 0x404056
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 0x402460
push edi
mov dword [ebp - 0x210], esi
mov dword [ebp - 0x218], esi
call dword [sym.imp.ADVAPI32.dll_RegOpenKeyExW]
test eax, eax
je 0x4040c8
cmp dword [ebp + 0xc], esi
je 0x4040c8
lea eax, [ebp - 0x210]
push eax
push 0x402460
push edi
call dword [sym.imp.ADVAPI32.dll_RegCreateKeyW]
test eax, eax
jne 0x404286
lea eax, [ebp - 0x218]
push eax
push 0xf003f
push esi
push 0x40246c
push edi
call dword [sym.imp.ADVAPI32.dll_RegOpenKeyExW]
test eax, eax
je 0x404105
cmp dword [ebp + 0xc], esi
je 0x404105
lea eax, [ebp - 0x218]
push eax
push 0x40246c
push edi
call dword [sym.imp.ADVAPI32.dll_RegCreateKeyW]
test eax, eax
jne 0x404286
mov edi, dword [ebp - 0x210]
test edi, edi
je 0x4041bd
push 0x208
lea eax, [ebp - 0x20c]
mov dword [ebp - 0x21c], 1
push esi
push eax
mov dword [ebp - 0x214], 0x104
call fcn.004034e0
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 0x4041bd
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 0x404194
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 0x404162
mov edi, esi
cmp dword [ebp + 0xc], esi
jbe 0x404295
mov eax, dword [ebp - 0x220]
sub eax, ebx
mov dword [ebp - 0x21c], eax
cmp dword [ebx], esi
je 0x404277
push 1
push 0x402390
push 1
push esi
push dword [ebx]
push dword [ebp - 0x210]
call dword [sym.imp.ADVAPI32.dll_RegSetValueExW]
test eax, eax
jne 0x404286
cmp dword [ebp - 0x220], esi
je 0x404277
push 0x5c
push dword [ebx]
call dword [sym.imp.msvcrt.dll_wcsrchr]
pop ecx
pop ecx
test eax, eax
je 0x40421b
add eax, 2
jmp 0x40421d
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 0x404286
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 0x402484
push dword [ebp - 0x214]
call dword [sym.imp.ADVAPI32.dll_RegSetValueExW]
test eax, eax
jne 0x404286
push dword [ebp - 0x214]
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
inc edi
add ebx, 4
cmp edi, dword [ebp + 0xc]
jb 0x4041d6
jmp 0x404295
jg 0x40428c
mov esi, eax
jmp 0x404295
movzx esi, ax
or esi, 0x80070000
mov edi, dword [ebp - 0x210]
test edi, edi
je 0x4042a6
push edi
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
cmp dword [ebp - 0x218], 0
je 0x4042bb
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.0040dd40
mov esp, ebp
pop ebp
ret 0x10