Function at 0x140021ef4
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 0x14002214a
test r8, r8
je 0x14002214a
lea r14, [rcx + 0x2a0]
cmp qword [r14], r13
jne 0x140021f86
lea r8, str.will
lea rdx, str.__DownloadFileFromURL:_We__hs_force_a_connection._r_n
lea ecx, [r13 + 4]
call fcn.140016868
lea edx, [r13 + 1]
mov rcx, r14
call fcn.140035b24
mov edi, eax
test eax, eax
js 0x140022146
mov rcx, qword [r14]
test rcx, rcx
je 0x140021f86
mov rax, qword [rcx]
mov rdx, r12
mov rax, qword [rax + 0x88]
call qword [0x14003f118]
mov rcx, qword [0x140050310]
cmp rcx, 0xffffffffffffffff
jne 0x140021fa8
lea edx, [rcx + 5]
call fcn.140016148
mov rcx, qword [0x140050310]
cmp rcx, 0xffffffffffffffff
je 0x140021fd9
cmp dword [0x1400516e0], 4
jl 0x140021fd9
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 0x140021fdd
lea rbp, [rax*2 + 1]
mov rcx, rbp
call fcn.14003c310
mov rsi, rax
test rax, rax
je 0x140022134
cmp rbp, 0x7fffffff
ja 0x140022134
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 0x140022139
mov edi, 4
lea rdx, str.__Starting_download_of__hs._r_n
mov ecx, edi
mov r8, r12
call fcn.140016868
mov r8, rsi
lea rdx, str.__Starting_download_to_file__hs._r_n
mov ecx, edi
call fcn.140016868
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 0x140022139
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 0x140022139
mov ecx, 0x64
mov dword [rbx + 0x274], 1
call fcn.1400159e8
call qword [sym.imp.KERNEL32.dll_GetTickCount]
mov dword [rbx + 0x24], eax
jmp 0x14002210d
mov edx, 0x258
mov rcx, rax
call qword [sym.imp.KERNEL32.dll_WaitForSingleObject]
cmp eax, 0x102
jne 0x140022119
cmp dword [rbx + 0x274], r13d
je 0x140022119
mov rcx, rbx
call fcn.140023750
mov edi, eax
mov rax, qword [rbx + 0x268]
test rax, rax
jne 0x1400220e5
mov rcx, qword [rbx + 0x268]
test rcx, rcx
je 0x140022139
call qword [sym.imp.KERNEL32.dll_CloseHandle]
mov qword [rbx + 0x268], r13
jmp 0x140022139
mov edi, 0x80004005
test rsi, rsi
je 0x140022146
mov rcx, rsi
call fcn.14003c2b8
mov eax, edi
jmp 0x14002214f
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