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

Disassembly:
push ebp
lea ebp, [esp - 0x2d8]
sub esp, 0x2d8
push 0xffffffffffffffff
push 0x667040
mov eax, dword fs:[0]
push eax
sub esp, 0x34
mov eax, dword [0x758898]
xor eax, ebp
mov dword [ebp + 0x2d4], eax
push ebx
push esi
push edi
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov dword [ebp - 0x10], esp
mov edi, ecx
mov dword [ebp - 4], 0
mov eax, dword [ebp + 0x2e0]
mov ebx, dword [ebp + 0x2e4]
test eax, eax
jne 0x5d1724
test ebx, ebx
je 0x5d16d3
mov esi, dword [ebp + 0x2e8]
test esi, esi
jne 0x5d172a
mov edi, dword [edi + 0x30]
test edi, edi
je 0x5d16fd
mov eax, edi
lea edx, [eax + 2]
nop
mov cx, word [eax]
add eax, 2
test cx, cx
jne 0x5d16e0
sub eax, edx
sar eax, 1
cmp eax, 3
jbe 0x5d16fd
push edi
call fcn.00623da3
add esp, 4
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov ecx, dword [ebp + 0x2d4]
xor ecx, ebp
call fcn.0062023e
add ebp, 0x2d8
mov esp, ebp
pop ebp
ret 0xc
mov esi, dword [ebp + 0x2e8]
mov dword [ebp - 0x20], 0x104
test eax, eax
je 0x5d1789
cmp dword [edi + 0x48c], 0
jne 0x5d174a
push eax
mov ecx, edi
call fcn.005cee30
test al, al
je 0x5d16fd
lea eax, [ebp - 0x20]
push eax
lea ecx, [ebp + 0xc]
push ecx
push 0
push 0
push 0x687b9c
mov edx, dword [edi + 0x48c]
push edx
call dword [sym.imp.ADVAPI32.dll_RegQueryValueExW]
test eax, eax
je 0x5d17f1
mov ecx, dword [edi + 0x484]
test ecx, ecx
je 0x5d16fd
push str.Can_not_find_in_registry_old_localFileName._n
call fcn.0056a780
jmp 0x5d16fd
push esi
push ebx
push str.SoftwareDownloadManagerGrabberStsProjects_ld_ld
lea eax, [ebp + 0x214]
push eax
call fcn.0062311b
add esp, 0x10
lea ecx, [ebp - 0x18]
push ecx
push 0xf003f
push 0
lea edx, [ebp + 0x214]
push edx
push 0x80000001
call dword [sym.imp.ADVAPI32.dll_RegOpenKeyExA]
test eax, eax
jne 0x5d16fd
lea eax, [ebp - 0x20]
push eax
lea ecx, [ebp + 0xc]
push ecx
push 0
push 0
push 0x687b9c
mov edx, dword [ebp - 0x18]
push edx
call dword [sym.imp.ADVAPI32.dll_RegQueryValueExW]
test eax, eax
jne 0x5d16fd
mov eax, dword [ebp - 0x18]
push eax
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
xor eax, eax
mov dword [ebp], eax
mov dword [ebp + 8], eax
xor ecx, ecx
mov word [ebp + 4], cx
mov byte [ebp - 4], 1
lea edx, [ebp + 0xc]
push edx
lea ecx, [ebp]
call fcn.00401800
mov eax, dword [ebp]
test eax, eax
jne 0x5d1819
lea eax, [ebp + 4]
push 0x5c
push eax
call fcn.0061fd52
add esp, 8
test eax, eax
je 0x5d1abb
xor ecx, ecx
mov word [eax], cx
mov eax, dword [ebp]
test eax, eax
jne 0x5d183b
lea eax, [ebp + 4]
push eax
call dword [sym.imp.KERNEL32.dll_GetFileAttributesW]
cmp eax, 0xffffffff
je 0x5d1abb
lea ecx, [ebp - 0x14]
call fcn.00402510
mov byte [ebp - 4], 2
lea edx, [ebp + 0xc]
push edx
call fcn.00623da3
add esp, 4
cmp eax, 0xffffffff
jne 0x5d18ad
cmp dword [ebp + 0x2e0], 0
je 0x5d1a74
cmp dword [edi + 0x484], 0
je 0x5d1903
lea eax, [ebp + 0xc]
push eax
lea ecx, [ebp - 0x18]
call fcn.00417be0
mov byte [ebp - 4], 3
mov ecx, dword [ebp - 0x18]
push ecx
push str.Could_not_delete_temp_file__s_n
lea edx, [ebp - 0x14]
push edx
call fcn.00402f80
add esp, 0xc
mov eax, dword [ebp - 0x14]
push eax
jmp 0x5d18ec
cmp dword [ebp + 0x2e0], 0
je 0x5d1a74
cmp dword [edi + 0x484], 0
je 0x5d1903
lea ecx, [ebp + 0xc]
push ecx
lea ecx, [ebp - 0x18]
call fcn.00417be0
mov byte [ebp - 4], 4
mov edx, dword [ebp - 0x18]
push edx
push str.Deleting_temp_file__s_n
lea eax, [ebp - 0x14]
push eax
call fcn.00402f80
add esp, 0xc
mov ecx, dword [ebp - 0x14]
push ecx
mov ecx, dword [edi + 0x484]
call fcn.0056a780
mov byte [ebp - 4], 2
lea ecx, [ebp - 0x18]
call fcn.00402580
mov edx, dword [ebp + 0x2e0]
push edx
push str.SoftwareDownloadManager_ldChList
lea eax, [ebp + 0x214]
push eax
call fcn.0062311b
add esp, 0xc
lea ecx, [ebp - 0x40]
push ecx
lea edx, [ebp - 0x24]
push edx
push 0
push 0xf003f
push 0
push 0x67997c
push 0
lea eax, [ebp + 0x214]
push eax
push 0x80000001
call dword [sym.imp.ADVAPI32.dll_RegCreateKeyExA]
mov dword [ebp - 0x20], 0x10
lea ecx, [ebp - 0x20]
push ecx
lea edx, [ebp - 0x3c]
push edx
push 0
push 0
push 0x687b48
mov eax, dword [ebp - 0x24]
push eax
call dword [sym.imp.ADVAPI32.dll_RegQueryValueExA]
test eax, eax
jne 0x5d1ce9
lea eax, [ebp + 0xc]
lea edx, [eax + 2]
jmp 0x5d1980
mov cx, word [eax]
add eax, 2
test cx, cx
jne 0x5d1980
sub eax, edx
sar eax, 1
add eax, 0xa
xor ecx, ecx
mov edx, 2
mul edx
seto cl
neg ecx
or ecx, eax
push ecx
call fcn.005f4522
add esp, 4
mov esi, eax
test esi, esi
je 0x5d1aaf
mov eax, dword [ebp - 0x38]
jmp 0x5d19c0
cmp eax, 0xffffffff
je 0x5d1c35
mov ebx, eax
push eax
push 0x6b6b18
lea eax, [ebp + 0x294]
push eax
call fcn.0062311b
add esp, 0xc
lea ecx, [ebp - 0x20]
push ecx
lea edx, [ebp - 0x3c]
push edx
push 0
push 0
lea eax, [ebp + 0x294]
push eax
mov ecx, dword [ebp - 0x24]
push ecx
call dword [sym.imp.ADVAPI32.dll_RegQueryValueExA]
test eax, eax
jne 0x5d1b12
mov edx, dword [ebp - 0x3c]
push edx
lea eax, [ebp + 0xc]
push eax
push str._s_d
push esi
call fcn.0040f8d0
push esi
call fcn.00623da3
add esp, 0x14
cmp eax, 0xffffffff
jne 0x5d1acc
cmp dword [edi + 0x484], 0
je 0x5d1b12
push esi
lea ecx, [ebp - 0x18]
call fcn.00417be0
mov byte [ebp - 4], 5
mov ecx, dword [ebp - 0x18]
push ecx
push str.Could_not_delete_temp_file__s_n
lea edx, [ebp - 0x14]
push edx
call fcn.00402f80
add esp, 0xc
mov eax, dword [ebp - 0x14]
push eax
mov ecx, dword [edi + 0x484]
call fcn.0056a780
mov byte [ebp - 4], 2
lea ecx, [ebp - 0x18]
jmp 0x5d1b0d
push esi
push ebx
push str.SoftwareDownloadManagerGrabberStsProjects_ld_ldChList
lea ecx, [ebp + 0x214]
push ecx
call fcn.0062311b
add esp, 0x10
lea edx, [ebp - 0x24]
push edx
push 0xf003f
push 0
lea eax, [ebp + 0x214]
push eax
push 0x80000001
call dword [sym.imp.ADVAPI32.dll_RegOpenKeyExA]
test eax, eax
je 0x5d1948
mov byte [ebp - 4], 1
lea ecx, [ebp - 0x14]
call fcn.00402580
mov byte [ebp - 4], 0
lea ecx, [ebp]
call fcn.00401210
jmp 0x5d16fd
cmp dword [edi + 0x484], 0
je 0x5d1b12
push esi
lea ecx, [ebp - 0x28]
call fcn.00417be0
mov byte [ebp - 4], 6
mov ecx, dword [ebp - 0x28]
push ecx
push str.Deleting_temp_file__s_n
lea edx, [ebp - 0x14]
push edx
call fcn.00402f80
add esp, 0xc
mov eax, dword [ebp - 0x14]
push eax
mov ecx, dword [edi + 0x484]
call fcn.0056a780
mov byte [ebp - 4], 2
lea ecx, [ebp - 0x28]
call fcn.00402580
push ebx
push 0x67942c
lea ecx, [ebp + 0x294]
push ecx
call fcn.0062311b
add esp, 0xc
lea edx, [ebp - 0x20]
push edx
lea eax, [ebp - 0x3c]
push eax
push 0
push 0
lea ecx, [ebp + 0x294]
push ecx
mov edx, dword [ebp - 0x24]
push edx
call dword [sym.imp.ADVAPI32.dll_RegQueryValueExA]
test eax, eax
je 0x5d1b7b
cmp dword [edi + 0x484], 0
je 0x5d1c35
push eax
push str.Error_read_registry__errCode___d._End_rebuilding._n
lea eax, [ebp - 0x14]
push eax
call fcn.00402f80
add esp, 0xc
mov ecx, dword [ebp - 0x14]
push ecx
mov ecx, dword [edi + 0x484]
call fcn.0056a780
jmp 0x5d1c35
mov edx, dword [ebp - 0x3c]
push edx
lea eax, [ebp + 0xc]
push eax
push str._s_d
push esi
call fcn.0040f8d0
push esi
call fcn.00623da3
add esp, 0x14
cmp eax, 0xffffffff
jne 0x5d1be3
cmp dword [edi + 0x484], 0
je 0x5d1c29
push esi
lea ecx, [ebp - 0x2c]
call fcn.00417be0
mov byte [ebp - 4], 7
mov ecx, dword [ebp - 0x2c]
push ecx
push str.Could_not_delete_temp_file__s_n
lea edx, [ebp - 0x14]
push edx
call fcn.00402f80
add esp, 0xc
mov eax, dword [ebp - 0x14]
push eax
mov ecx, dword [edi + 0x484]
call fcn.0056a780
mov byte [ebp - 4], 2
lea ecx, [ebp - 0x2c]
jmp 0x5d1c24
cmp dword [edi + 0x484], 0
je 0x5d1c29
push esi
lea ecx, [ebp - 0x1c]
call fcn.00417be0
mov byte [ebp - 4], 8
mov ecx, dword [ebp - 0x1c]
push ecx
push str.Deleting_temp_file__s_n
lea edx, [ebp - 0x14]
push edx
call fcn.00402f80
add esp, 0xc
mov eax, dword [ebp - 0x14]
push eax
mov ecx, dword [edi + 0x484]
call fcn.0056a780
mov byte [ebp - 4], 2
lea ecx, [ebp - 0x1c]
call fcn.00402580
mov eax, dword [ebp - 0x38]
cmp dword [ebp - 0x3c], eax
jne 0x5d19c0
lea ecx, [ebp - 0x20]
push ecx
lea edx, [ebp - 0x3c]
push edx
push 0
push 0
push 0x6b6ae0
mov eax, dword [ebp - 0x24]
push eax
call dword [sym.imp.ADVAPI32.dll_RegQueryValueExA]
test eax, eax
jne 0x5d1ce0
mov ecx, dword [ebp - 0x3c]
push ecx
lea edx, [ebp + 0xc]
push edx
push str._s_d
push esi
call fcn.0040f8d0
push esi
call fcn.00623da3
add esp, 0x14
cmp eax, 0xffffffff
jne 0x5d1c9a
cmp dword [edi + 0x484], 0
je 0x5d1ce0
push esi
lea ecx, [ebp - 0x1c]
call fcn.00417be0
mov byte [ebp - 4], 9
mov eax, dword [ebp - 0x1c]
push eax
push str.Could_not_delete_temp_file__s_n
jmp 0x5d1cb9
cmp dword [edi + 0x484], 0
je 0x5d1ce0
push esi
lea ecx, [ebp - 0x1c]
call fcn.00417be0
mov byte [ebp - 4], 0xa
mov eax, dword [ebp - 0x1c]
push eax
push str.Deleting_temp_file__s_n
lea ecx, [ebp - 0x14]
push ecx
call fcn.00402f80
add esp, 0xc
mov edx, dword [ebp - 0x14]
push edx
mov ecx, dword [edi + 0x484]
call fcn.0056a780
mov byte [ebp - 4], 2
lea ecx, [ebp - 0x1c]
call fcn.00402580
push esi
call fcn.005f4517
add esp, 4
mov eax, dword [ebp - 0x24]
push eax
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
mov byte [ebp - 4], 1
lea ecx, [ebp - 0x14]
call fcn.00402580
mov byte [ebp - 4], 0
lea ecx, [ebp]
call fcn.00401210
mov dword [ebp - 4], 0xffffffff
jmp 0x5d16fd