Function at 0x40547f
Capabilities:
Check if file exists
Delete file
Get file attributes
Get file size
Move file
Set registry value
Timestomp file

Disassembly:
mov eax, 0x4106a4
call fcn.00410160
sub esp, 0x218
push ebx
push esi
push edi
xor esi, esi
mov dword [ebp - 0x10], esp
push esi
push esi
mov edi, dword [sym.imp.KERNEL32.dll_CreateFileW]
push dword [ebp + 0x14]
mov dword [ebp - 4], esi
push esi
push 1
push dword [ebp + 0x10]
push dword [ebp + 8]
call edi
cmp eax, 0xffffffff
mov dword [ebp - 0x18], eax
jne 0x4056f3
push 0x5c
push dword [ebp + 8]
call sub.MSVCRT.dll_wcsrchr
pop ecx
cmp eax, esi
pop ecx
je 0x4055f1
mov ebx, dword [sym.imp.KERNEL32.dll_lstrcmpiW]
inc eax
inc eax
push str.IDMan.exe
push eax
mov dword [ebp - 0x14], eax
call ebx
test eax, eax
jne 0x405559
mov dword [ebp - 0x14], esi
cmp dword [ebp - 0x18], 0xffffffff
jne 0x4056f3
push 0x64
call fcn.004053fe
pop ecx
push esi
push esi
push dword [ebp + 0x14]
push esi
push 1
push dword [ebp + 0x10]
push dword [ebp + 8]
call edi
inc dword [ebp - 0x14]
cmp dword [ebp - 0x14], 0xa
mov dword [ebp - 0x18], eax
jne 0x40554d
lea eax, [ebp - 0x1c]
push eax
push str.IDMan.exe
call fcn.0040b1c7
pop ecx
cmp eax, esi
pop ecx
je 0x4054ea
push dword [ebp - 0x1c]
push esi
push 1
call dword [sym.imp.KERNEL32.dll_OpenProcess]
mov ebx, eax
cmp ebx, esi
je 0x4054ea
push esi
push ebx
call dword [sym.imp.KERNEL32.dll_TerminateProcess]
push ebx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
cmp dword [ebp - 0x14], 0x14
jg 0x4055e7
jmp 0x4054ea
push str.IDMNetMon.dll
push dword [ebp - 0x14]
call ebx
test eax, eax
je 0x405575
push str.IDMNetMon64.dll
push dword [ebp - 0x14]
call ebx
test eax, eax
jne 0x4055f1
lea eax, [ebp - 0x14]
push eax
push 0xf003f
push esi
push str.SoftwareInternet_Download_Manager
push 0x80000002
call dword [sym.imp.ADVAPI32.dll_RegOpenKeyExW]
test eax, eax
jne 0x4055f1
lea eax, [ebp - 0x1c]
push 4
push eax
push 4
push esi
push str.InstallStatus
push dword [ebp - 0x14]
mov dword [ebp - 0x1c], 2
call dword [sym.imp.ADVAPI32.dll_RegSetValueExW]
push dword [ebp - 0x14]
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
xor ebx, ebx
cmp dword [ebp - 0x18], 0xffffffff
jne 0x4056f3
push 0x64
call fcn.004053fe
pop ecx
push esi
push esi
push dword [ebp + 0x14]
push esi
push 1
push dword [ebp + 0x10]
push dword [ebp + 8]
call edi
inc ebx
mov dword [ebp - 0x18], eax
cmp ebx, 0x1e
jle 0x4055bc
cmp dword [ebp - 0x18], 0xffffffff
jne 0x4056f3
push dword [ebp + 8]
lea eax, [ebp - 0x224]
push eax
call dword [sym.imp.KERNEL32.dll_lstrcpyW]
lea eax, [ebp - 0x224]
push 0x416004
push eax
call dword [sym.imp.KERNEL32.dll_lstrcatW]
lea eax, [ebp - 0x224]
push eax
call dword [sym.imp.KERNEL32.dll_GetFileAttributesW]
cmp eax, 0xffffffff
je 0x405632
lea eax, [ebp - 0x224]
push eax
call dword [sym.imp.KERNEL32.dll_DeleteFileW]
mov ebx, dword [sym.imp.KERNEL32.dll_MoveFileExW]
lea eax, [ebp - 0x224]
push 9
push eax
push dword [ebp + 8]
call ebx
cmp eax, esi
jne 0x4056ac
lea eax, [ebp - 0x224]
push 0x416000
push eax
call dword [sym.imp.KERNEL32.dll_lstrcatW]
lea eax, [ebp - 0x224]
push eax
call dword [sym.imp.KERNEL32.dll_GetFileAttributesW]
cmp eax, 0xffffffff
je 0x40567b
lea eax, [ebp - 0x224]
push eax
call dword [sym.imp.KERNEL32.dll_DeleteFileW]
lea eax, [ebp - 0x224]
push 9
push eax
push dword [ebp + 8]
call ebx
cmp eax, esi
jne 0x4056ac
cmp dword [ebp + 0x20], esi
je 0x4056a5
push 0x10
push str.Cannot_install_new_version
push str.Error_replacing_a_file._r_nPlease_uninstall_your_current_version_of_IDM__reboot__and_try_to_install_the_new_version_again
push esi
call dword [sym.imp.USER32.dll_MessageBoxW]
xor eax, eax
jmp 0x4057a8
cmp dword [ebp + 0x20], esi
je 0x4056bb
mov dword [0x41b828], 1
lea eax, [ebp - 0x18]
push esi
push eax
lea eax, [ebp - 0x14]
push eax
lea eax, [ebp - 0x224]
push eax
mov dword [ebp - 0x14], esi
call fcn.00405972
push esi
push esi
push dword [ebp + 0x14]
push esi
push 1
push dword [ebp + 0x10]
push dword [ebp + 8]
call edi
cmp eax, 0xffffffff
mov dword [ebp - 0x18], eax
jne 0x4056f3
jmp 0x4056a5
mov ebx, dword [ebp - 0x18]
push esi
push ebx
call dword [sym.imp.KERNEL32.dll_GetFileSize]
mov ecx, dword [ebp + 0xc]
add dword [ecx], eax
cmp dword [ebp + 0x10], 0x80000000
mov ecx, dword [ecx]
jne 0x40571e
mov dword [ebp + 8], 2
mov dword [ebp + 0x10], 4
jmp 0x405735
cmp dword [ebp + 0x10], 0xc0000000
jne 0x405735
mov dword [ebp + 8], 4
mov dword [ebp + 0x10], 2
push esi
push ecx
push esi
push dword [ebp + 8]
push esi
push ebx
call dword [sym.imp.KERNEL32.dll_CreateFileMappingW]
mov edi, eax
cmp edi, esi
jne 0x405755
push ebx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
jmp 0x4056a5
cmp dword [ebp + 0x18], esi
je 0x405770
push 0x41b1f8
push 0x41b208
push 0x41b200
push ebx
call dword [sym.imp.KERNEL32.dll_GetFileTime]
cmp dword [ebp + 0x1c], esi
je 0x40578b
push 0x41b1f8
push 0x41b208
push 0x41b200
push ebx
call dword [sym.imp.KERNEL32.dll_SetFileTime]
push ebx
mov ebx, dword [sym.imp.KERNEL32.dll_CloseHandle]
call ebx
push esi
push esi
push esi
push dword [ebp + 0x10]
push edi
call dword [sym.imp.KERNEL32.dll_MapViewOfFile]
push edi
mov esi, eax
call ebx
mov eax, esi
mov ecx, dword [ebp - 0xc]
pop edi
pop esi
mov dword fs:[0], ecx
pop ebx
leave
ret