Function at 0x4015eb
Capabilities:
Check if file exists
Check mutex and terminate process on windows
Check mutex on windows
Create directory
Create thread
Get common file path
Get file attributes
Terminate process

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x32c
push ebx
push esi
push edi
mov edi, dword [sym.imp.USER32.dll_wsprintfA]
push str.Internet_Download_Manager
lea eax, [ebp - 0x124]
push str._s_Setup
push eax
call edi
push str._delsetup
push dword [ebp + 0x10]
call sub.MSVCRT.dll_strstr
add esp, 0x14
test eax, eax
jne 0x40164a
push 0x4052b0
push dword [ebp + 0x10]
call sub.MSVCRT.dll_strstr
pop ecx
test eax, eax
pop ecx
jne 0x40164a
push 0x4052a4
push dword [ebp + 0x10]
call sub.MSVCRT.dll_strstr
pop ecx
test eax, eax
pop ecx
je 0x401654
mov dword [0x406e70], 1
xor ebx, ebx
push str.IDM_Setup_Mutex_st23nZ7a
push ebx
push ebx
call dword [sym.imp.KERNEL32.dll_CreateMutexA]
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0xb7
jne 0x4016d1
mov esi, dword [sym.imp.USER32.dll_FindWindowA]
lea eax, [ebp - 0x124]
push eax
push ebx
call esi
cmp eax, ebx
mov dword [ebp + 0x10], eax
je 0x401695
push 9
push eax
call dword [sym.imp.USER32.dll_ShowWindow]
push dword [ebp + 0x10]
jmp 0x4016bf
lea eax, [ebp - 0x124]
push str.Welcome
push eax
call edi
pop ecx
lea eax, [ebp - 0x124]
pop ecx
push eax
push ebx
call esi
mov esi, eax
cmp esi, ebx
je 0x4016c5
push 9
push esi
call dword [sym.imp.USER32.dll_ShowWindow]
push esi
call dword [sym.imp.USER32.dll_SetForegroundWindow]
push ebx
call dword [sym.imp.KERNEL32.dll_ExitProcess]
mov eax, dword [ebp + 8]
mov esi, 0x406a58
push esi
push 0x104
mov dword [0x406a54], eax
call dword [sym.imp.KERNEL32.dll_GetTempPathW]
test eax, eax
je 0x401714
push esi
push ebx
push 0x9c4000
call fcn.004013e0
add esp, 0xc
test eax, eax
jne 0x401763
push 0x30
push str.IDM_Setup
push str.The_IDM_Installation_program_requires_about_10_MBytes_of_disk_space_to_extract_setup_files_to_a_temporary_folder._There_is_not_enough_free_space_on_the_disk_to_store_temporary_files._Please_free_some_disk_space__or_select_a_location_on_another_disk_to_store_temporary_files_of_IDM_installation_program.
push ebx
call dword [sym.imp.USER32.dll_MessageBoxA]
push 7
xor eax, eax
pop ecx
lea edi, [ebp - 0x1c]
mov dword [ebp - 0x20], ebx
rep stosd dword es:[edi], eax
lea eax, [ebp - 0x32c]
mov dword [ebp - 0x14], str.Select_Temp_Directory
mov dword [ebp - 0x18], eax
lea eax, [ebp - 0x20]
push eax
mov dword [ebp - 0x10], 0x10
call dword [sym.imp.SHELL32.dll_SHBrowseForFolderW]
cmp eax, ebx
je 0x401750
push esi
push eax
call dword [sym.imp.SHELL32.dll_SHGetPathFromIDListW]
jmp 0x4016ee
push 0x405110
push 1
push ebx
push ebx
push str.Could_not_find_temp_path_in_unpacker
jmp 0x401846
push 0x7e
push esi
call sub.MSVCRT.dll_wcschr
pop ecx
test eax, eax
pop ecx
je 0x401778
push esi
call fcn.00401478
pop ecx
push esi
call sub.MSVCRT.dll_wcslen
cmp word [eax*2 + 0x406a56], 0x5c
pop ecx
je 0x401797
push 0x4050e4
push esi
call sub.MSVCRT.dll_wcscat
pop ecx
pop ecx
push str.IDM_Setup_Temp
push esi
call sub.MSVCRT.dll_wcscat
mov edi, dword [sym.imp.KERNEL32.dll_GetFileAttributesW]
pop ecx
pop ecx
push esi
call edi
cmp eax, 0xffffffff
jne 0x401850
push 0x5c
push 0x406a5e
call sub.MSVCRT.dll_wcschr
pop ecx
mov dword [ebp + 0x10], eax
pop ecx
lea eax, [ebp - 0x32c]
push 0x208
push ebx
push eax
call sub.MSVCRT.dll_memset
mov eax, dword [ebp + 0x10]
add esp, 0xc
cmp eax, ebx
je 0x4017e9
sub eax, esi
sar eax, 1
jmp 0x4017f0
push esi
call sub.MSVCRT.dll_wcslen
pop ecx
push eax
lea eax, [ebp - 0x32c]
push esi
push eax
call sub.MSVCRT.dll_wcsncpy
add esp, 0xc
lea eax, [ebp - 0x32c]
push eax
call edi
cmp eax, 0xffffffff
jne 0x401821
lea eax, [ebp - 0x32c]
push ebx
push eax
call dword [sym.imp.KERNEL32.dll_CreateDirectoryW]
test eax, eax
je 0x401830
mov eax, dword [ebp + 0x10]
cmp eax, ebx
je 0x401830
add eax, 2
push 0x5c
push eax
jmp 0x4017bd
push esi
call edi
cmp eax, 0xffffffff
jne 0x401850
push 0x405110
push 1
push ebx
push ebx
push str.Could_not_create_temp_dir_in_unpacker
call fcn.00401c00
add esp, 0x14
jmp 0x4018c6
push 0x4050e4
push esi
call sub.MSVCRT.dll_wcscat
pop ecx
pop ecx
push str.setup_error.log
push esi
push str._s_s
push 0x406c64
call dword [sym.imp.USER32.dll_wsprintfW]
add esp, 0x10
push ebx
push 0x401d8b
push ebx
push 0x65
push dword [0x406a54]
call dword [sym.imp.USER32.dll_CreateDialogParamA]
cmp eax, ebx
mov dword [0x406a4c], eax
jne 0x4018cf
lea eax, [ebp + 0x10]
push eax
push ebx
push esi
push 0x401dfa
push ebx
push ebx
call dword [sym.imp.KERNEL32.dll_CreateThread]
cmp eax, ebx
mov dword [0x406c60], eax
jne 0x4018c1
push ebx
push ebx
push ebx
push esi
call fcn.00401e2a
add esp, 0x10
mov dword [0x406a50], eax
call fcn.0040192e
pop edi
pop esi
xor eax, eax
pop ebx
leave
ret 0x10
lea ecx, [ebp - 0x124]
push ecx
push eax
call dword [sym.imp.USER32.dll_SetWindowTextA]
push 5
push dword [0x406a4c]
call dword [sym.imp.USER32.dll_ShowWindow]
push ebx
push ebx
push 0x7e8
push dword [0x406a4c]
call dword [sym.imp.USER32.dll_SendMessageA]
mov esi, dword [sym.imp.USER32.dll_GetMessageA]
push ebx
push ebx
lea eax, [ebp - 0x1c]
push ebx
push eax
call esi
test eax, eax
je 0x4018c1
lea eax, [ebp - 0x1c]
push eax
call dword [sym.imp.USER32.dll_TranslateMessage]
lea eax, [ebp - 0x1c]
push eax
call dword [sym.imp.USER32.dll_DispatchMessageA]
push ebx
push ebx
lea eax, [ebp - 0x1c]
push ebx
push eax
jmp 0x40190b