Function at 0x140039c80
Capabilities:
Check if file exists
Delete file
Print debug messages
Write file on windows

Disassembly:
push rbp
push rsi
push rdi
push r12
push r14
lea rbp, [rsp - 0x9b0]
sub rsp, 0xab0
mov rax, qword [0x14012a210]
xor rax, rsp
mov qword [rbp + 0x990], rax
mov r14, qword [rbp + 0xa00]
mov rsi, rcx
lea rcx, str._Inside_CMTFileDownloader::DownloadFile
mov qword [rsp + 0x68], r14
mov r12, r8
mov rdi, rdx
call qword [sym.imp.KERNEL32.dll_OutputDebugStringW]
test rdi, rdi
je 0x14003a3ab
test r12, r12
je 0x14003a3ab
mov qword [rsp + 0xaf8], rbx
mov rbx, 0xffffffffffffffff
mov qword [rsp + 0xaa8], r13
mov r8, rbx
mov qword [rsp + 0xaa0], r15
lea r13, [rsi + 0x130]
mov byte [rsi + 0x128], 0
nop dword [rax]
inc r8
cmp word [rdi + r8*2], 0
jne 0x140039d10
mov rdx, rdi
mov rcx, r13
call fcn.140011160
xor r15d, r15d
mov qword [rsp + 0x60], 7
mov qword [rsi + 0x228], r15
mov r8, rbx
mov dword [rsp + 0x40], r15d
mov qword [rsp + 0x48], r15
mov qword [rsp + 0x58], r15
nop dword [rax + rax]
inc r8
cmp word [rdi + r8*2], r15w
jne 0x140039d50
mov rdx, rdi
lea rcx, [rsp + 0x48]
call fcn.140011160
lea rdx, [rsp + 0x48]
mov rcx, rsi
call fcn.14003a3d0
test eax, eax
je 0x14003a2b9
mov rcx, rsi
call fcn.1400399f0
mov rcx, rsi
call fcn.14003aa60
lea r8, [0x140106210]
test eax, eax
jne 0x140039dc9
lea rdx, [rsi + 0x150]
cmp qword [rdx + 0x18], 8
jb 0x140039da8
mov rdx, qword [rdx]
mov rcx, r15
nop dword [rax + rax]
movzx eax, word [rdx + rcx*2]
inc rcx
cmp ax, word [r8 + rcx*2 - 2]
jne 0x140039f9b
cmp rcx, 4
jne 0x140039db0
cmp qword [rsi + 0x168], 8
lea rdx, [rsi + 0x150]
jb 0x140039de1
mov rdx, qword [rsi + 0x150]
xor ecx, ecx
movzx eax, word [rdx + rcx*2]
inc rcx
cmp ax, word [r8 + rcx*2 - 2]
jne 0x14003a077
cmp rcx, 4
jne 0x140039de3
lea rcx, str._DownloadFile::_Download_failed_due_to_302_http_Status_code.
call qword [sym.imp.KERNEL32.dll_OutputDebugStringW]
cmp qword [rsi + 0x180], r15
je 0x14003a2b9
lea rcx, str._DownloadFile::_Redirected_URL_is:
call qword [sym.imp.KERNEL32.dll_OutputDebugStringW]
lea r14, [rsi + 0x170]
cmp qword [r14 + 0x18], 8
mov rcx, r14
jb 0x140039e37
mov rcx, qword [r14]
call qword [sym.imp.KERNEL32.dll_OutputDebugStringW]
mov r8d, 1
lea rdx, [0x14010609c]
lea rcx, [rsi + 0x150]
call fcn.140011160
cmp r13, r14
je 0x140039e74
cmp qword [r14 + 0x18], 8
mov rdx, r14
jb 0x140039e68
mov rdx, qword [r14]
mov r8, qword [r14 + 0x10]
mov rcx, r13
call fcn.140011160
mov rdx, r14
lea rcx, [rsp + 0x48]
call fcn.140012240
mov rdx, rax
mov rcx, rsi
call fcn.14003a3d0
test eax, eax
je 0x14003a2b9
xor r8d, r8d
lea rdx, [0x1400ff490]
mov rcx, r14
call fcn.140011160
mov rcx, rsi
call fcn.14003aa60
test eax, eax
jne 0x14003a077
cmp qword [rsi + 0xd0], 8
lea rcx, [rsi + 0xb8]
jb 0x140039ece
mov rcx, qword [rsi + 0xb8]
mov rdx, qword [rsi + 0xc8]
lea r9, str.Content_Length:
xor r8d, r8d
mov qword [rsp + 0x20], reloc.ACTIVEDS.dll_FreeADsMem
call fcn.140020c70
xor r13d, r13d
cmp rax, rbx
jne 0x14003a2bc
mov qword [rsp + 0x48], r13
mov qword [rsp + 0x58], r13
mov qword [rsp + 0x60], 7
nop dword [rax]
inc rbx
cmp word [rdi + rbx*2], r13w
jne 0x140039f10
mov r8, rbx
lea rcx, [rsp + 0x48]
mov rdx, rdi
call fcn.140011160
mov r8, r12
lea rdx, [rsp + 0x48]
mov rcx, rsi
call fcn.14003c250
test eax, eax
je 0x14003a2bc
mov rcx, r12
call qword [sym.imp.SHLWAPI.dll_PathFileExistsW]
test eax, eax
je 0x14003a2bc
mov rcx, r12
mov ebx, r13d
call qword [sym.imp.SHLWAPI.dll_PathFileExistsW]
test eax, eax
je 0x140039f87
lea rdx, [rbp + 0x190]
mov rcx, r12
call qword [sym.imp.KERNEL32.dll_FindFirstFileW]
cmp rax, 0xffffffffffffffff
mov rcx, rax
cmovne ebx, dword [rbp + 0x1b0]
call qword [sym.imp.KERNEL32.dll_FindClose]
mov rax, qword [rsp + 0x68]
mov dword [rsp + 0x40], 1
mov dword [rax], ebx
jmp 0x14003a2bc
cmp qword [rsi + 0xd0], 8
lea rcx, [rsi + 0xb8]
jb 0x140039faf
mov rcx, qword [rcx]
mov rdx, qword [rsi + 0xc8]
lea r9, str.Content_Length:
xor r8d, r8d
mov qword [rsp + 0x20], reloc.ACTIVEDS.dll_FreeADsMem
call fcn.140020c70
xor r13d, r13d
cmp rax, rbx
jne 0x14003a2bc
mov qword [rsp + 0x48], r13
mov qword [rsp + 0x58], r13
mov qword [rsp + 0x60], 7
nop dword [rax]
inc rbx
cmp word [rdi + rbx*2], r13w
jne 0x140039ff0
mov r8, rbx
lea rcx, [rsp + 0x48]
mov rdx, rdi
call fcn.140011160
mov r8, r12
lea rdx, [rsp + 0x48]
mov rcx, rsi
call fcn.14003c250
test eax, eax
je 0x14003a2bc
mov rcx, r12
call qword [sym.imp.SHLWAPI.dll_PathFileExistsW]
test eax, eax
je 0x14003a2bc
mov rcx, r12
mov ebx, r13d
call qword [sym.imp.SHLWAPI.dll_PathFileExistsW]
test eax, eax
je 0x14003a067
lea rdx, [rbp + 0x190]
mov rcx, r12
call qword [sym.imp.KERNEL32.dll_FindFirstFileW]
cmp rax, 0xffffffffffffffff
mov rcx, rax
cmovne ebx, dword [rbp + 0x1b0]
call qword [sym.imp.KERNEL32.dll_FindClose]
mov dword [r14], ebx
mov dword [rsp + 0x40], 1
jmp 0x14003a2bc
mov ecx, dword [rsi + 0xd8]
mov eax, 0x66666667
imul ecx
sar edx, 0xc
mov eax, edx
shr eax, 0x1f
add edx, eax
mov eax, 1
cmp edx, eax
cmovl eax, edx
cmp dword [rsi + 0x108], r15d
je 0x14003a0a9
cmp ecx, 0x2800
jge 0x14003a0ae
mov eax, 1
mov edx, eax
mov rcx, rsi
call fcn.14003b440
test eax, eax
je 0x14003a2b9
mov rdx, qword [rsi + 0xf0]
mov r9d, 0xffffffff
mov rcx, qword [rsi + 0xf8]
mov r8d, 1
sub rcx, rdx
sar rcx, 3
call qword [sym.imp.KERNEL32.dll_WaitForMultipleObjects]
lea rcx, str._CMTFileDownloader::DownloadFile::_Done_Downloading_by_all_threads..
call qword [sym.imp.KERNEL32.dll_OutputDebugStringW]
lea rcx, str._CMTFileDownloader::DownloadFile::_Going_to_write_to_a_file
call qword [sym.imp.KERNEL32.dll_OutputDebugStringW]
xor edx, edx
lea rcx, [rbp + 0x190]
mov r8d, 0x800
call fcn.1400a83f0
cmp qword [rsi + 0xe8], r15
je 0x14003a2ac
cmp byte [rsi + 0x128], r15b
jne 0x14003a2ac
xor r13d, r13d
xor r9d, r9d
mov qword [rsp + 0x30], r13
xor r8d, r8d
mov dword [rsp + 0x28], 0x80
mov edx, 0x10000000
mov rcx, r12
mov dword [rsp + 0x20], 2
call qword [sym.imp.KERNEL32.dll_CreateFileW]
mov r15, rax
cmp rax, rbx
jne 0x14003a192
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov r8d, eax
lea rdx, str._CMTFileDownloader::CreateDestinationFile__._CreateFileW_Error:__d
lea rcx, [rbp + 0x190]
call qword [sym.imp.USER32.dll_wsprintfW]
lea rcx, [rbp + 0x190]
call qword [sym.imp.KERNEL32.dll_OutputDebugStringW]
jmp 0x14003a2bc
mov rax, qword [rsi + 0xe0]
mov r14d, r13d
mov rbx, qword [rax]
cmp rbx, rax
je 0x14003a1fc
mov rdi, qword [rbx + 0x10]
test rdi, rdi
je 0x14003a1f0
mov r8d, dword [rdi + 0xc]
test r8d, r8d
je 0x14003a296
mov rdx, qword [rdi + 0x10]
lea r9, [rsp + 0x70]
mov rcx, r15
mov dword [rsp + 0x70], r13d
mov qword [rsp + 0x20], r13
call qword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x14003a258
add r14d, dword [rsp + 0x70]
mov rcx, qword [rdi + 0x10]
call fcn.1400a59a4
mov qword [rdi + 0x10], r13
mov rbx, qword [rbx]
cmp rbx, qword [rsi + 0xe0]
jne 0x14003a1a4
mov rcx, r15
call qword [sym.imp.KERNEL32.dll_CloseHandle]
xor edx, edx
lea rcx, [rbp - 0x80]
mov r8d, 0x208
call fcn.1400a83f0
mov r8d, r14d
lea rdx, str._CMTFileDownloader::DownloadFile::__Downloaded_File_Size___d
lea rcx, [rbp - 0x80]
call qword [sym.imp.USER32.dll_wsprintfW]
lea rcx, [rbp - 0x80]
call qword [sym.imp.KERNEL32.dll_OutputDebugStringW]
mov rax, qword [rsp + 0x68]
mov dword [rax], r14d
cmp dword [rsi + 0xd8], r14d
jne 0x14003a2bc
test r14d, r14d
je 0x14003a2bc
mov dword [rsp + 0x40], 1
jmp 0x14003a2bc
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov r8d, eax
lea rdx, str._CMTFileDownloader::CreateDestinationFile__._WriteFile_Error:__d
lea rcx, [rbp + 0x190]
call qword [sym.imp.USER32.dll_wsprintfW]
lea rcx, [rbp + 0x190]
call qword [sym.imp.KERNEL32.dll_OutputDebugStringW]
mov rcx, r15
call qword [sym.imp.KERNEL32.dll_CloseHandle]
mov rcx, r12
call qword [sym.imp.KERNEL32.dll_DeleteFileW]
jmp 0x14003a2bc
lea rdx, str._CMTFileDownloader::CreateDestinationFile__._nDownLoadedSize_0
lea rcx, [rbp + 0x190]
call qword [sym.imp.USER32.dll_wsprintfW]
jmp 0x14003a275
lea rcx, str._CMTFileDownloader::CreateDestinationFile___return_emty_filenname
call qword [sym.imp.KERNEL32.dll_OutputDebugStringW]
xor r13d, r13d
mov rcx, rsi
call fcn.14003c0e0
mov rcx, rsi
call fcn.14003c010
mov rcx, rsi
call fcn.14003c1e0
lea rcx, [rsi + 0xb8]
mov dword [rsi + 0xd8], r13d
xor r8d, r8d
mov qword [rsi + 0x108], 0
lea rdx, [0x1400ff490]
mov qword [rsi + 0x110], r13
mov qword [rsi + 0x120], 0
mov qword [rsi + 0x228], r13
mov byte [rsi + 0x128], 0
mov qword [rsi + 0x118], r13
mov dword [rsi + 4], r13d
call fcn.140011160
lea rcx, [rsi + 0x150]
mov r8d, 1
lea rdx, [0x14010609c]
call fcn.140011160
lea rcx, [rsi + 0x170]
xor r8d, r8d
lea rdx, [0x1400ff490]
call fcn.140011160
lea rcx, [rsi + 0x10]
xor r8d, r8d
lea rdx, [0x1400ff490]
call fcn.140011160
lea rcx, [rsi + 0x30]
xor r8d, r8d
lea rdx, [0x1400ff490]
call fcn.140011160
lea rcx, str._Ending_method_CMTFileDownloader::DownloadFile
mov dword [rsi + 8], r13d
call qword [sym.imp.KERNEL32.dll_OutputDebugStringW]
mov eax, dword [rsp + 0x40]
mov r15, qword [rsp + 0xaa0]
mov r13, qword [rsp + 0xaa8]
mov rbx, qword [rsp + 0xaf8]
jmp 0x14003a3ad
xor eax, eax
mov rcx, qword [rbp + 0x990]
xor rcx, rsp
call fcn.1400a5460
add rsp, 0xab0
pop r14
pop r12
pop rdi
pop rsi
pop rbp
ret