Function at 0x406080
Capabilities:
Check if file exists
Set current directory

Disassembly:
push ebp
lea ebp, [esp - 0x808]
sub esp, 0x888
mov eax, dword [0x416188]
xor eax, ebp
mov dword [ebp + 0x804], eax
push 0x104
lea eax, [ebp + 0x1ec]
push eax
mov ecx, dword [ebp + 0x810]
push ecx
call dword [sym.imp.KERNEL32.dll_GetModuleFileNameW]
test eax, eax
jne 0x4060d6
push 0x10
push 0x40f700
push str.GetModuleFileName_failed_
push 0
call dword [sym.imp.USER32.dll_MessageBoxW]
mov eax, 0x643
jmp 0x406394
mov edx, 0x208
shr edx, 1
mov dword [ebp - 0x2c], edx
mov dword [ebp - 0x44], 0
cmp dword [ebp - 0x2c], 0
je 0x4060f6
cmp dword [ebp - 0x2c], 0x7fffffff
jbe 0x4060fd
mov dword [ebp - 0x44], 0x80070057
mov eax, dword [ebp - 0x44]
mov dword [ebp - 0x48], eax
cmp dword [ebp - 0x48], 0
jl 0x40612a
push 0x7ffffffe
lea ecx, [ebp + 0x1ec]
push ecx
push 0
mov edx, dword [ebp - 0x2c]
push edx
lea eax, [ebp + 0x3f4]
push eax
call fcn.00405300
mov dword [ebp - 0x48], eax
lea ecx, [ebp + 0x3f4]
push ecx
call dword [sym.imp.SHLWAPI.dll_PathRemoveFileSpecW]
mov edx, 0x208
shr edx, 1
mov dword [ebp - 0x24], edx
mov dword [ebp - 0x50], 0
cmp dword [ebp - 0x24], 0
je 0x406157
cmp dword [ebp - 0x24], 0x7fffffff
jbe 0x40615e
mov dword [ebp - 0x50], 0x80070057
mov eax, dword [ebp - 0x50]
mov dword [ebp - 0x58], eax
cmp dword [ebp - 0x58], 0
jl 0x406188
push 0x7ffffffe
lea ecx, [ebp + 0x3f4]
push ecx
push 0
mov edx, dword [ebp - 0x24]
push edx
lea eax, [ebp - 0x1c]
push eax
call fcn.00405300
mov dword [ebp - 0x58], eax
mov ecx, 0x208
shr ecx, 1
mov dword [ebp - 0x28], ecx
mov dword [ebp - 0x54], 0
cmp dword [ebp - 0x28], 0
je 0x4061a8
cmp dword [ebp - 0x28], 0x7fffffff
jbe 0x4061af
mov dword [ebp - 0x54], 0x80070057
mov edx, dword [ebp - 0x54]
mov dword [ebp - 0x40], edx
cmp dword [ebp - 0x40], 0
jl 0x4061dc
push 0x7ffffffe
lea eax, [ebp + 0x3f4]
push eax
push 0
mov ecx, dword [ebp - 0x28]
push ecx
lea edx, [ebp + 0x5fc]
push edx
call fcn.00405300
mov dword [ebp - 0x40], eax
push str.SetupUi.dll
lea eax, [ebp + 0x5fc]
push eax
call dword [sym.imp.SHLWAPI.dll_PathAppendW]
lea ecx, [ebp + 0x5fc]
push ecx
call dword [sym.imp.SHLWAPI.dll_PathFileExistsW]
test eax, eax
jne 0x4062a7
mov edx, 0x208
shr edx, 1
mov dword [ebp - 0x20], edx
mov dword [ebp - 0x3c], 0
cmp dword [ebp - 0x20], 0
je 0x406223
cmp dword [ebp - 0x20], 0x7fffffff
jbe 0x40622a
mov dword [ebp - 0x3c], 0x80070057
mov eax, dword [ebp - 0x3c]
mov dword [ebp - 0x4c], eax
cmp dword [ebp - 0x4c], 0
jl 0x406257
push 0x7ffffffe
lea ecx, [ebp + 0x3f4]
push ecx
push 0
mov edx, dword [ebp - 0x20]
push edx
lea eax, [ebp + 0x5fc]
push eax
call fcn.00405300
mov dword [ebp - 0x4c], eax
push str.SetupSetupUi.dll
lea ecx, [ebp + 0x5fc]
push ecx
call dword [sym.imp.SHLWAPI.dll_PathAppendW]
lea edx, [ebp + 0x5fc]
push edx
call dword [sym.imp.SHLWAPI.dll_PathFileExistsW]
test eax, eax
jne 0x406298
push 0x10
push 0x40f700
push str.Cant_find_setupUi.dll_
push 0
call dword [sym.imp.USER32.dll_MessageBoxW]
mov eax, 0x643
jmp 0x406394
push str.Setup
lea eax, [ebp - 0x1c]
push eax
call dword [sym.imp.SHLWAPI.dll_PathAppendW]
lea ecx, [ebp - 0x1c]
push ecx
call dword [sym.imp.KERNEL32.dll_SetCurrentDirectoryW]
push 0
call dword [sym.imp.ole32.dll_CoInitialize]
mov dword [ebp - 0x60], eax
push 0
push 0
push 0
push 0
call dword [sym.imp.USER32.dll_DefWindowProcW]
mov dword [ebp - 0x68], 8
mov dword [ebp - 0x64], 0x2ff
lea edx, [ebp - 0x68]
push edx
call dword [sym.imp.COMCTL32.dll_InitCommonControlsEx]
mov dword [ebp - 0x7c], eax
push 0
mov eax, dword [ebp + 0x810]
push eax
push 0
mov ecx, 0x416f98
call fcn.00402f20
mov dword [ebp - 0x60], eax
mov dword [ebp - 0x78], 1
mov dword [ebp - 0x74], 0
mov dword [ebp - 0x70], 0
mov dword [ebp - 0x6c], 0
push 0
lea ecx, [ebp - 0x78]
push ecx
lea edx, [ebp - 0x5c]
push edx
call sub.gdiplus.dll_GdiplusStartup
mov dword [ebp - 0x80], eax
mov dword [ebp - 0x38], 0x643
push 8
push 0
lea eax, [ebp + 0x5fc]
push eax
call dword [sym.imp.KERNEL32.dll_LoadLibraryExW]
mov dword [ebp - 0x30], eax
cmp dword [ebp - 0x30], 0
je 0x406378
push str._Run
mov ecx, dword [ebp - 0x30]
push ecx
call dword [sym.imp.KERNEL32.dll_GetProcAddress]
mov dword [ebp - 0x34], eax
cmp dword [ebp - 0x34], 0
je 0x406378
mov edx, dword [ebp + 0x818]
push edx
lea eax, [ebp + 0x1ec]
push eax
call dword [ebp - 0x34]
mov dword [ebp - 0x38], eax
mov ecx, dword [ebp - 0x5c]
push ecx
call sub.gdiplus.dll_GdiplusShutdown
mov ecx, 0x416f98
call fcn.004053b0
call dword [sym.imp.ole32.dll_CoUninitialize]
mov eax, dword [ebp - 0x38]
mov ecx, dword [ebp + 0x804]
xor ecx, ebp
call fcn.00406dec
add ebp, 0x808
mov esp, ebp
pop ebp
ret 0x10