Function at 0x406250
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 0x4066ec
mov eax, dword [esp + 0x44c]
test eax, eax
je 0x4066ec
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.00408b40
add esp, 8
test eax, eax
je 0x4066c0
lea ecx, [esp + 0x228]
push ecx
call fcn.00409ac3
add esp, 4
lea edx, [esp + 0x32c]
push eax
push edx
call fcn.00409ac3
add esp, 4
push eax
call fcn.00408bd0
add esp, 8
test eax, eax
jne 0x4066c0
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 0x406598
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 0x406598
cmp dword [esp + 0x14], 1
jbe 0x4063f4
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 0x4063f8
mov ebp, dword [esp + 0x18]
push ebx
call dword [sym.imp.KERNEL32.dll_GetFileAttributesA]
cmp eax, 0xffffffff
je 0x406426
test ebp, ebp
mov dword [esp + 0x10], 0
je 0x406414
mov byte [ebp], 0
mov eax, dword [esp + 0x450]
mov dword [eax], 1
jmp 0x406648
mov eax, dword [esp + 0x43c]
test eax, eax
je 0x406648
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 0x406598
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, 0x4136c4
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 0x4065a6
mov ecx, 0x13
xor eax, eax
mov edi, 0x416288
push eax
rep stosd dword es:[edi], eax
mov ecx, dword [esp + 0x450]
push 0x406700
mov byte [ebx], al
push eax
mov eax, dword [esp + 0x444]
mov dword [0x4162a4], ebx
mov edx, dword [ecx]
push 0x6a
push eax
mov dword [0x4162a8], edx
mov dword [0x416288], 0x4c
mov dword [0x4162bc], 0x804
mov dword [0x416294], 0x4136a4
call dword [sym.imp.USER32.dll_DialogBoxParamA]
cmp eax, 2
je 0x406561
cmp eax, 0x4c7
je 0x406561
push 0x5c
push ebx
call fcn.00409ba0
add esp, 8
test eax, eax
je 0x40654f
mov byte [eax], 0
mov ecx, dword [esp + 0x450]
mov dword [ecx], 1
jmp 0x406648
mov dword [esp + 0x10], 0x4c7
mov edx, dword [esp + 0x14]
cmp edx, 1
ja 0x40657a
mov dword [esp + 0x10], 2
mov eax, dword [esp + 0x18]
test eax, eax
je 0x406589
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 0x40663c
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 0x406632
push 0x5c
push ebx
call fcn.00409ba0
mov ebp, eax
add esp, 8
mov edx, ebp
inc ebp
test edx, edx
je 0x4065db
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 0x406632
test ebp, ebp
je 0x40661b
mov byte [ebp], 0
mov eax, dword [esp + 0x450]
mov dword [esp + 0x10], 0
mov dword [eax], 0
jmp 0x406648
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [esp + 0x10], eax
mov eax, dword [esp + 0x10]
test eax, eax
jne 0x406569
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 0x40656d
lea edi, [esp + 0x20]
or ecx, 0xffffffff
xor eax, eax
push edx
repne scasb al, byte es:[edi]
not ecx
dec ecx
je 0x4066a2
lea eax, [esp + 0x24]
push eax
push ebx
call fcn.004087c0
mov edx, dword [esp + 0x20]
add esp, 0xc
mov byte [edx + ebx], 0
mov edx, dword [esp + 0x14]
mov dword [ebp], edx
jmp 0x40656d
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 0x40656d
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