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

Disassembly:
sub esp, 0x420
mov eax, dword [esp + 0x440]
push ebx
mov ebx, dword [esp + 0x43c]
push ebp
push esi
push edi
test ebx, ebx
mov dword [esp + 0x18], 0
mov dword [eax], 0
je 0x40610c
mov eax, dword [esp + 0x44c]
test eax, eax
je 0x40610c
mov edi, str.isuninst.exe
or ecx, 0xffffffff
xor eax, eax
lea edx, [esp + 0x228]
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
mov ebp, dword [esp + 0x444]
mov eax, ecx
mov esi, edi
mov edi, edx
lea edx, [esp + 0x32c]
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
xor eax, eax
and ecx, 3
push str.isuninst.exe
rep movsb byte es:[edi], byte [esi]
mov edi, ebp
or ecx, 0xffffffff
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
push ebp
mov eax, ecx
mov esi, edi
mov edi, edx
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
and ecx, 3
rep movsb byte es:[edi], byte [esi]
call fcn.004084e0
add esp, 8
test eax, eax
je 0x4060e0
lea ecx, [esp + 0x228]
push ecx
call fcn.00409463
add esp, 4
lea edx, [esp + 0x32c]
push eax
push edx
call fcn.00409463
add esp, 4
push eax
call fcn.00408570
add esp, 8
test eax, eax
jne 0x4060e0
lea eax, [esp + 0x18]
push eax
push 0x20019
push 0
push str.SoftwareMicrosoftMicrosoft_SQL_Server71Setup
push 0x80000002
call dword [sym.imp.ADVAPI32.dll_RegOpenKeyExA]
test eax, eax
mov dword [esp + 0x10], eax
jne 0x405fb8
mov ecx, dword [esp + 0x44c]
lea eax, [esp + 0x14]
push eax
push ebx
mov edx, dword [ecx]
mov ecx, dword [esp + 0x448]
mov dword [esp + 0x1c], edx
mov edx, dword [esp + 0x20]
push 0
push 0
push ecx
push edx
call dword [sym.imp.ADVAPI32.dll_RegQueryValueExA]
test eax, eax
mov dword [esp + 0x10], eax
jne 0x405fb8
cmp dword [esp + 0x14], 1
jbe 0x405e14
mov edi, 0x413040
or ecx, 0xffffffff
xor eax, eax
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
mov esi, edi
mov edx, ecx
mov edi, ebx
or ecx, 0xffffffff
repne scasb al, byte es:[edi]
mov ecx, edx
dec edi
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, edx
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov edi, ebx
or ecx, 0xffffffff
repne scasb al, byte es:[edi]
mov edi, dword [esp + 0x444]
not ecx
dec ecx
mov ebp, ecx
or ecx, 0xffffffff
add ebp, ebx
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
mov esi, edi
mov edx, ecx
mov edi, ebx
or ecx, 0xffffffff
repne scasb al, byte es:[edi]
mov ecx, edx
dec edi
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, edx
and ecx, 3
rep movsb byte es:[edi], byte [esi]
jmp 0x405e18
mov ebp, dword [esp + 0x18]
push ebx
call dword [sym.imp.KERNEL32.dll_GetFileAttributesA]
cmp eax, 0xffffffff
je 0x405e46
test ebp, ebp
mov dword [esp + 0x10], 0
je 0x405e34
mov byte [ebp], 0
mov eax, dword [esp + 0x450]
mov dword [eax], 1
jmp 0x406068
mov eax, dword [esp + 0x43c]
test eax, eax
je 0x406068
mov eax, dword [esp + 0x18]
lea ecx, [esp + 0x1c]
lea edx, [esp + 0x124]
push ecx
push edx
push 0
push 0
push str.SetupPath
push eax
call dword [sym.imp.ADVAPI32.dll_RegQueryValueExA]
test eax, eax
mov dword [esp + 0x10], eax
jne 0x405fb8
mov edi, 0x413040
or ecx, 0xffffffff
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
lea edx, [esp + 0x124]
mov esi, edi
mov ebp, ecx
mov edi, edx
or ecx, 0xffffffff
repne scasb al, byte es:[edi]
mov ecx, ebp
dec edi
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, ebp
lea edx, [esp + 0x124]
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov edi, str.setupsql.exe
or ecx, 0xffffffff
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
mov esi, edi
mov ebp, ecx
mov edi, edx
or ecx, 0xffffffff
repne scasb al, byte es:[edi]
mov ecx, ebp
dec edi
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, ebp
lea eax, [esp + 0x124]
and ecx, 3
push eax
rep movsb byte es:[edi], byte [esi]
call dword [sym.imp.KERNEL32.dll_GetFileAttributesA]
cmp eax, 0xffffffff
je 0x405fc6
mov ecx, 0x13
xor eax, eax
mov edi, 0x4161e8
push eax
rep stosd dword es:[edi], eax
mov ecx, dword [esp + 0x450]
push 0x406120
mov byte [ebx], al
push eax
mov eax, dword [esp + 0x444]
mov dword [0x416204], ebx
mov edx, dword [ecx]
push 0x6a
push eax
mov dword [0x416208], edx
mov dword [0x4161e8], 0x4c
mov dword [0x41621c], 0x804
mov dword [0x4161f4], 0x4135f4
call dword [sym.imp.USER32.dll_DialogBoxParamA]
cmp eax, 2
je 0x405f81
cmp eax, 0x4c7
je 0x405f81
push 0x5c
push ebx
call fcn.00409540
add esp, 8
test eax, eax
je 0x405f6f
mov byte [eax], 0
mov ecx, dword [esp + 0x450]
mov dword [ecx], 1
jmp 0x406068
mov dword [esp + 0x10], 0x4c7
mov edx, dword [esp + 0x14]
cmp edx, 1
ja 0x405f9a
mov dword [esp + 0x10], 2
mov eax, dword [esp + 0x18]
test eax, eax
je 0x405fa9
push eax
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
mov eax, dword [esp + 0x10]
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x420
ret
cmp dword [esp + 0x10], 0x4c7
je 0x40605c
mov edx, dword [esp + 0x44c]
mov ecx, dword [esp + 0x434]
mov eax, dword [edx]
push eax
push ebx
push ecx
call dword [sym.imp.KERNEL32.dll_GetModuleFileNameA]
test eax, eax
je 0x406052
push 0x5c
push ebx
call fcn.00409540
mov ebp, eax
add esp, 8
mov edx, ebp
inc ebp
test edx, edx
je 0x405ffb
mov byte [ebp], 0
mov edi, dword [esp + 0x444]
or ecx, 0xffffffff
xor eax, eax
push ebx
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
mov esi, edi
mov edx, ecx
mov edi, ebx
or ecx, 0xffffffff
repne scasb al, byte es:[edi]
mov ecx, edx
dec edi
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, edx
and ecx, 3
rep movsb byte es:[edi], byte [esi]
call dword [sym.imp.KERNEL32.dll_GetFileAttributesA]
cmp eax, 0xffffffff
je 0x406052
test ebp, ebp
je 0x40603b
mov byte [ebp], 0
mov eax, dword [esp + 0x450]
mov dword [esp + 0x10], 0
mov dword [eax], 0
jmp 0x406068
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [esp + 0x10], eax
mov eax, dword [esp + 0x10]
test eax, eax
jne 0x405f89
mov ebp, dword [esp + 0x44c]
mov esi, dword [sym.imp.KERNEL32.dll_GetShortPathNameA]
lea edx, [esp + 0x20]
mov ecx, dword [ebp]
push ecx
push edx
push ebx
call esi
mov edx, eax
test edx, edx
mov dword [esp + 0x14], edx
je 0x405f8d
lea edi, [esp + 0x20]
or ecx, 0xffffffff
xor eax, eax
push edx
repne scasb al, byte es:[edi]
not ecx
dec ecx
je 0x4060c2
lea eax, [esp + 0x24]
push eax
push ebx
call fcn.00408160
mov edx, dword [esp + 0x20]
add esp, 0xc
mov byte [edx + ebx], 0
mov edx, dword [esp + 0x14]
mov dword [ebp], edx
jmp 0x405f8d
lea ecx, [esp + 0x24]
push ecx
push ebx
call esi
mov edx, eax
mov dword [esp + 0x14], eax
mov byte [edx + ebx], 0
mov edx, dword [esp + 0x14]
mov dword [ebp], edx
jmp 0x405f8d
mov edi, ebp
or ecx, 0xffffffff
xor eax, eax
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
mov eax, ecx
mov esi, edi
mov edi, ebx
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
and ecx, 3
xor eax, eax
rep movsb byte es:[edi], byte [esi]
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x420
ret
pop edi
pop esi
pop ebp
or eax, 0xffffffff
pop ebx
add esp, 0x420
ret