Function at 0x140036b9c
Capabilities:
Check for time delay via gettickcount
Delete file
Write file on windows

Disassembly:
mov rax, rsp
mov qword [rax + 0x10], rbx
mov qword [rax + 0x18], rsi
mov qword [rax + 0x20], rdi
push rbp
push r12
push r13
push r14
push r15
lea rbp, [rax - 0x338]
sub rsp, 0x410
mov rax, qword [0x1400502a8]
xor rax, rsp
mov qword [rbp + 0x300], rax
lea rsi, [rcx + 0x38]
mov rdi, rcx
xor r13d, r13d
mov rcx, rsi
mov ebx, r13d
call qword [sym.imp.KERNEL32.dll_EnterCriticalSection]
lea rdx, str.Starting_download._r_n
lea ecx, [r13 + 4]
call fcn.14001672c
lea r15d, [r13 + 2]
mov dword [rdi + 0x70], r13d
or r14, 0xffffffffffffffff
cmp dword [rdi + 0x60], r15d
je 0x140036c63
mov rcx, qword [0x140050310]
cmp rcx, r14
jne 0x140036c2f
mov edx, r15d
call fcn.140016148
mov rcx, qword [0x140050310]
cmp rcx, r14
je 0x1400371db
cmp dword [0x1400516e0], r15d
jl 0x1400371db
mov r8d, 0x3b
lea rdx, str.ERROR:_Download_canceled.__Download_manager_is_not_ready._r_n
lea r9, [rsp + 0x50]
mov qword [rsp + 0x20], r13
mov dword [rsp + 0x50], r13d
call qword [sym.imp.KERNEL32.dll_WriteFile]
jmp 0x1400371db
mov rax, qword [rdi + 0x78]
mov rbx, r14
mov dword [rdi + 0x60], 3
inc rbx
cmp byte [rax + rbx], r13b
jne 0x140036c71
lea rcx, [rbx + 1]
call fcn.14003c310
mov qword [rsp + 0x68], rax
mov r12, rax
test rax, rax
jne 0x140036cd8
mov rcx, qword [0x140050310]
mov ebx, 0x8007000e
cmp rcx, r14
jne 0x140036cb9
mov edx, r15d
call fcn.140016148
mov rcx, qword [0x140050310]
cmp rcx, r14
je 0x1400371db
cmp dword [0x1400516e0], r15d
jl 0x1400371db
mov r8d, 0x2b
lea rdx, str.ERROR:_Download_canceled.__Out_of_memory._r_n
jmp 0x140036c49
mov r8, qword [rdi + 0x78]
lea rdx, [rbx + 1]
mov rcx, r12
call fcn.140013c70
mov ebx, 0x68
lea rcx, [rsp + 0x70]
mov r8d, ebx
xor edx, edx
call sub.msvcrt.dll_memset
mov ecx, 0x104
mov dword [rsp + 0x70], ebx
lea rax, [rbp + 0xe0]
mov dword [rbp - 0x70], ecx
mov qword [rbp - 0x78], rax
lea r9, [rsp + 0x70]
lea rax, [rbp + 0x1f0]
mov dword [rbp - 0x40], ecx
mov qword [rbp - 0x48], rax
xor r8d, r8d
mov rax, qword [rdi + 0x288]
xor edx, edx
mov rcx, r12
call qword [0x14003f118]
test eax, eax
jne 0x140036d74
call qword [sym.imp.KERNEL32.dll_GetLastError]
lea rdx, str.ERROR:_Could_not_crack_URL:_0x_x._r_n
test eax, eax
mov ecx, 0x57
cmove eax, ecx
mov ecx, r15d
movzx ebx, ax
or ebx, 0x80070000
test eax, eax
cmovle ebx, eax
mov r8d, ebx
call fcn.140016868
jmp 0x1400371c4
movzx r8d, word [rbp - 0x6c]
xor r9d, r9d
mov rdx, qword [rbp - 0x78]
mov rcx, qword [rdi + 0xa8]
mov rax, qword [rdi + 0x290]
mov qword [rsp + 0x38], r13
mov dword [rsp + 0x30], r13d
mov dword [rsp + 0x28], 3
mov qword [rsp + 0x20], r13
call qword [0x14003f118]
mov qword [rdi + 0xb0], rax
test rax, rax
jne 0x140036dc6
call qword [sym.imp.KERNEL32.dll_GetLastError]
lea rdx, str.ERROR:_Could_not_connect_to_host:_0x_x._r_n
jmp 0x140036d4c
mov r8, qword [rbp - 0x48]
lea rdx, [0x1400492a4]
mov qword [rsp + 0x38], r13
mov rcx, rax
mov rax, qword [rdi + 0x2b0]
xor r9d, r9d
mov dword [rsp + 0x30], 0x4400200
mov qword [rsp + 0x28], r13
mov qword [rsp + 0x20], r13
call qword [0x14003f118]
mov qword [rdi + 0xb8], rax
mov r15, rax
test rax, rax
jne 0x140036e38
call qword [sym.imp.KERNEL32.dll_GetLastError]
test eax, eax
lea ecx, [r15 + 0x57]
lea rdx, str.ERROR:_Could_not_open_request:_0x_x._r_n
cmove eax, ecx
movzx ebx, ax
or ebx, 0x80070000
test eax, eax
cmovle ebx, eax
mov ecx, 2
jmp 0x140036d67
mov rcx, rsi
call qword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
mov ebx, 4
lea rdx, str.Download_manager_now_connecting_to_URL._r_n
mov ecx, ebx
call fcn.14001672c
mov rax, qword [rdi + 0x2b8]
xor r9d, r9d
xor r8d, r8d
mov dword [rsp + 0x20], r13d
xor edx, edx
mov rcx, r15
call qword [0x14003f118]
test eax, eax
je 0x14003715a
mov rax, qword [rdi + 0x2c0]
lea r9, [rsp + 0x58]
lea r8, [rsp + 0x5c]
mov dword [rsp + 0x58], ebx
mov edx, 0x20000013
mov qword [rsp + 0x20], r13
mov rcx, r15
call qword [0x14003f118]
test eax, eax
je 0x140037140
mov eax, dword [rsp + 0x5c]
sub eax, 0xc8
je 0x140036f62
sub eax, 0xc9
je 0x140036f00
sub eax, 2
je 0x140036f00
sub eax, 1
je 0x140036ef8
sub eax, 3
je 0x140036ef0
sub eax, 1
je 0x140036ee8
cmp eax, 0x5c
je 0x140036ee0
mov r8d, 0x800710e0
jmp 0x140036f06
mov r8d, 0x8007003a
jmp 0x140036f06
mov r8d, 0x8007041d
jmp 0x140036f06
mov r8d, 0x80070041
jmp 0x140036f06
mov r8d, 0x80070002
jmp 0x140036f06
mov r8d, 0x80070005
lea rdx, str.ERROR:_HTTPSendRequest_failed.__Result:_0x_x._r_n
mov ecx, 2
call fcn.140016868
cmp dword [rsp + 0x5c], 0x197
jne 0x140036f54
mov rcx, qword [rdi + 0x1338]
mov r9d, 7
mov rax, qword [rdi + 0x2a8]
mov r8d, 0x2eee
mov rdx, r15
mov qword [rsp + 0x20], r13
call qword [0x14003f118]
cmp eax, 0x2f00
je 0x140036e54
mov rcx, rsi
call qword [sym.imp.KERNEL32.dll_EnterCriticalSection]
jmp 0x1400371bf
mov rcx, rsi
mov ebx, r13d
call qword [sym.imp.KERNEL32.dll_EnterCriticalSection]
cmp dword [rdi + 0x60], 3
je 0x140036fec
call qword [sym.imp.KERNEL32.dll_GetLastError]
test eax, eax
mov ebx, eax
mov rax, qword [rdi + 0x2a0]
mov ecx, 0x57
cmove ebx, ecx
mov rcx, qword [rdi + 0xb0]
call qword [0x14003f118]
mov rcx, qword [rdi + 0xb8]
mov rax, qword [rdi + 0x2a0]
mov qword [rdi + 0xb0], r13
call qword [0x14003f118]
movzx r8d, bx
lea rdx, str.ERROR:_Could_not_open_URL:_0x_x._r_n
or r8d, 0x80070000
mov qword [rdi + 0xb8], r13
test ebx, ebx
mov ecx, 2
cmovle r8d, ebx
call fcn.140016868
mov r15d, 0x80004004
mov ebx, r15d
jmp 0x1400371ca
mov r12d, 4
mov rcx, rsi
mov dword [rdi + 0x60], r12d
call qword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
mov rax, qword [rdi + 0x2c0]
lea r9, [rsp + 0x58]
lea r8, [rdi + 0x68]
mov dword [rsp + 0x58], r12d
mov edx, 0x20000005
mov qword [rsp + 0x20], r13
mov rcx, r15
call qword [0x14003f118]
test eax, eax
jne 0x14003703e
lea rdx, str.__Could_not_determine_download_size_for_URL._r_n
mov ecx, r12d
call fcn.140016868
or dword [rdi + 0x68], 0xffffffff
mov dword [rsp + 0x54], r13d
mov dword [rsp + 0x60], r13d
call qword [sym.imp.KERNEL32.dll_GetTickCount]
mov r13d, eax
lea r12, [rdi + 0x320]
jmp 0x1400370b6
mov r8d, dword [rsp + 0x54]
test r8d, r8d
je 0x14003711c
mov rcx, qword [rdi + 0xc0]
lea r9, [rsp + 0x60]
and qword [rsp + 0x20], rbx
mov rdx, r12
call qword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x1400370e7
mov eax, dword [rsp + 0x54]
add dword [rdi + 0x6c], eax
call qword [sym.imp.KERNEL32.dll_GetTickCount]
mov ecx, eax
sub ecx, r13d
cmp ecx, 0x3e8
jb 0x1400370b6
mov eax, 0x10624dd3
mul ecx
mov eax, dword [rdi + 0x6c]
mov ecx, edx
xor edx, edx
shr ecx, 6
div ecx
mov dword [rdi + 0x70], eax
mov rax, qword [rdi + 0x298]
lea r9, [rsp + 0x54]
mov r8d, 0x1000
mov rdx, r12
mov rcx, r15
call qword [0x14003f118]
test eax, eax
jne 0x14003705a
call qword [sym.imp.KERNEL32.dll_GetLastError]
lea rdx, str.ERROR:_InternetReadFile_failed.__Result:_0x_x._r_n
jmp 0x1400370f4
call qword [sym.imp.KERNEL32.dll_GetLastError]
lea rdx, str.ERROR:_WriteFile_failed.__Result:_0x_x._r_n
xor r13d, r13d
test eax, eax
lea ecx, [r13 + 0x57]
cmove eax, ecx
lea ecx, [r13 + 2]
movzx ebx, ax
or ebx, 0x80070000
test eax, eax
cmovle ebx, eax
mov r8d, ebx
call fcn.140016868
jmp 0x14003711f
xor r13d, r13d
mov rcx, rsi
call qword [sym.imp.KERNEL32.dll_EnterCriticalSection]
cmp dword [rdi + 0x60], 4
mov r15d, 0x80004004
mov r12, qword [rsp + 0x68]
cmovne ebx, r15d
jmp 0x1400371ca
mov rcx, rsi
mov ebx, 0x8007000d
call qword [sym.imp.KERNEL32.dll_EnterCriticalSection]
lea rdx, str.ERROR:_Could_not_obtain_connection_result:_0x_x._r_n
jmp 0x140036e2e
call qword [sym.imp.KERNEL32.dll_GetLastError]
test eax, eax
mov ebx, eax
mov ecx, 0x57
cmove ebx, ecx
mov rcx, rsi
call qword [sym.imp.KERNEL32.dll_EnterCriticalSection]
mov rax, qword [rdi + 0x2c8]
lea r8, [rsp + 0x50]
lea rdx, [rbp - 0x20]
mov dword [rsp + 0x68], r13d
lea rcx, [rsp + 0x68]
mov dword [rsp + 0x50], 0x100
call qword [0x14003f118]
movzx r8d, bx
lea rdx, str.ERROR:_Could_not_open_URL.__Result:_0x_x._r_n
or r8d, 0x80070000
mov ecx, 2
test ebx, ebx
cmovle r8d, ebx
call fcn.140016868
mov ebx, 0x80072efd
mov r15d, 0x80004004
mov rcx, r12
call fcn.14003c2b8
cmp ebx, r15d
je 0x1400372bc
mov r15d, 4
lea rdx, str.Download_complete._r_n
mov ecx, r15d
call fcn.14001672c
mov eax, ebx
mov dword [rdi + 0x64], ebx
sar eax, 0x1f
and eax, 0xfffffffc
add eax, 5
mov dword [rdi + 0x60], eax
mov rcx, qword [rdi + 0xc0]
cmp rcx, r14
je 0x14003721a
call qword [sym.imp.KERNEL32.dll_CloseHandle]
mov qword [rdi + 0xc0], r14
test ebx, ebx
jns 0x140037236
cmp dword [rdi + 0x90], r13d
je 0x140037236
mov rcx, qword [rdi + 0x80]
call qword [sym.imp.KERNEL32.dll_DeleteFileA]
jmp 0x14003723d
mov dword [rdi + 0x90], r13d
mov r14, qword [rdi + 0x318]
mov qword [rdi + 0x318], r13
test r14, r14
je 0x140037277
mov ebx, dword [rdi + 0x74]
mov rcx, rsi
call qword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
mov rax, qword [r14]
mov edx, ebx
mov rcx, r14
mov rax, qword [rax + 0x18]
call qword [0x14003f118]
mov rcx, rsi
call qword [sym.imp.KERNEL32.dll_EnterCriticalSection]
cmp dword [rdi + 0x60], 5
je 0x1400372bc
mov rcx, qword [rdi + 0x78]
mov rax, r13
test rcx, rcx
je 0x140037294
mov edx, 0x2f
call qword [sym.imp.msvcrt.dll_strrchr]
mov r9d, dword [rdi + 0x6c]
lea r8, str.UNKNOWN
test rax, rax
lea rdx, str.__Download_failed_for__hs_at__lu_of__lu_bytes._r_n
mov ecx, r15d
cmovne r8, rax
mov eax, dword [rdi + 0x68]
mov dword [rsp + 0x20], eax
call fcn.140016868
mov rcx, rsi
call qword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
mov rcx, qword [rbp + 0x300]
xor rcx, rsp
call fcn.14003c6c0
lea r11, [rsp + 0x410]
mov rbx, qword [r11 + 0x38]
mov rsi, qword [r11 + 0x40]
mov rdi, qword [r11 + 0x48]
mov rsp, r11
pop r15
pop r14
pop r13
pop r12
pop rbp
ret