Function at 0x140021f58
Capabilities:
Write file on windows

Disassembly:
mov rax, rsp
mov qword [rax + 8], rbx
mov qword [rax + 0x10], rbp
mov qword [rax + 0x18], rsi
mov dword [rax + 0x20], r9d
push rdi
push r12
push r13
push r14
push r15
sub rsp, 0x50
xor r13d, r13d
mov r15, r8
mov r12, rdx
mov rbx, rcx
test rdx, rdx
je 0x1400221ae
test r8, r8
je 0x1400221ae
lea r14, [rcx + 0x2a0]
cmp qword [r14], r13
jne 0x140021fea
lea r8, str.will
lea rdx, str.__DownloadFileFromURL:_We__hs_force_a_connection._r_n
lea ecx, [r13 + 4]
call fcn.1400168a8
lea edx, [r13 + 1]
mov rcx, r14
call fcn.140035c14
mov edi, eax
test eax, eax
js 0x1400221aa
mov rcx, qword [r14]
test rcx, rcx
je 0x140021fea
mov rax, qword [rcx]
mov rdx, r12
mov rax, qword [rax + 0x88]
call qword [0x14003f118]
mov rcx, qword [0x140050310]
cmp rcx, 0xffffffffffffffff
jne 0x14002200c
lea edx, [rcx + 5]
call fcn.140016188
mov rcx, qword [0x140050310]
cmp rcx, 0xffffffffffffffff
je 0x14002203d
cmp dword [0x1400516e0], 4
jl 0x14002203d
lea r9, [rsp + 0x98]
mov dword [rsp + 0x98], r13d
mov r8d, 0x46
mov qword [rsp + 0x20], r13
lea rdx, str.__Created_instance_of_download_manager.__Now_converting_URL_to_ANSI._r_n
call qword [sym.imp.KERNEL32.dll_WriteFile]
or rax, 0xffffffffffffffff
inc rax
cmp word [r15 + rax*2], r13w
jne 0x140022041
lea rbp, [rax*2 + 1]
mov rcx, rbp
call fcn.14003c460
mov rsi, rax
test rax, rax
je 0x140022198
cmp rbp, 0x7fffffff
ja 0x140022198
mov qword [rsp + 0x38], r13
or r9d, 0xffffffff
mov qword [rsp + 0x30], r13
mov r8, r15
mov dword [rsp + 0x28], ebp
xor edx, edx
xor ecx, ecx
mov qword [rsp + 0x20], rax
mov edi, 0x80004005
call qword [sym.imp.KERNEL32.dll_WideCharToMultiByte]
test eax, eax
je 0x14002219d
mov edi, 4
lea rdx, str.__Starting_download_of__hs._r_n
mov ecx, edi
mov r8, r12
call fcn.1400168a8
mov r8, rsi
lea rdx, str.__Starting_download_to_file__hs._r_n
mov ecx, edi
call fcn.1400168a8
mov rdx, qword [rbx + 0x288]
lea r9d, [rdi - 2]
mov rcx, qword [r14]
mov r8, rsi
mov qword [rsp + 0x38], rdx
mov rdx, r12
mov qword [rsp + 0x30], r13
mov dword [rsp + 0x28], r13d
mov rax, qword [rcx]
mov dword [rsp + 0x20], 0x8000080
mov rax, qword [rax + 0x28]
call qword [0x14003f118]
mov edi, eax
test eax, eax
js 0x14002219d
xor r9d, r9d
xor r8d, r8d
xor edx, edx
xor ecx, ecx
call qword [sym.imp.KERNEL32.dll_CreateEventW]
mov qword [rbx + 0x268], rax
test rax, rax
je 0x14002219d
mov ecx, 0x64
mov dword [rbx + 0x274], 1
call fcn.140015a28
call qword [sym.imp.KERNEL32.dll_GetTickCount]
mov dword [rbx + 0x24], eax
jmp 0x140022171
mov edx, 0x258
mov rcx, rax
call qword [sym.imp.KERNEL32.dll_WaitForSingleObject]
cmp eax, 0x102
jne 0x14002217d
cmp dword [rbx + 0x274], r13d
je 0x14002217d
mov rcx, rbx
call fcn.1400237b4
mov edi, eax
mov rax, qword [rbx + 0x268]
test rax, rax
jne 0x140022149
mov rcx, qword [rbx + 0x268]
test rcx, rcx
je 0x14002219d
call qword [sym.imp.KERNEL32.dll_CloseHandle]
mov qword [rbx + 0x268], r13
jmp 0x14002219d
mov edi, 0x80004005
test rsi, rsi
je 0x1400221aa
mov rcx, rsi
call fcn.14003c408
mov eax, edi
jmp 0x1400221b3
mov eax, 0x80004003
lea r11, [rsp + 0x50]
mov rbx, qword [r11 + 0x30]
mov rbp, qword [r11 + 0x38]
mov rsi, qword [r11 + 0x40]
mov rsp, r11
pop r15
pop r14
pop r13
pop r12
pop rdi
ret