Function at 0x140001000
Capabilities:
Initialize winhttp library
Prepare http request
Receive http response
Write file on windows

Disassembly:
push r15
push r14
push r13
push r12
push rsi
push rdi
push rbp
push rbx
sub rsp, 0xf8
movaps xmmword [rsp + 0xe0], xmm6
mov rbx, rdx
mov rdi, rcx
mov dword [rsp + 0x20], 0
lea rcx, str.Downloader
xor edx, edx
xor r8d, r8d
xor r9d, r9d
call qword [sym.imp.WINHTTP.dll_WinHttpOpen]
test rax, rax
je 0x1400013c0
mov rsi, rax
xorps xmm0, xmm0
movaps xmmword [rsp + 0x70], xmm0
movaps xmmword [rsp + 0x80], xmm0
movaps xmmword [rsp + 0x90], xmm0
movaps xmmword [rsp + 0xc0], xmm0
movaps xmmword [rsp + 0xb0], xmm0
movaps xmmword [rsp + 0xa0], xmm0
mov qword [rsp + 0xd0], 0
mov dword [rsp + 0x70], 0x68
mov dword [rsp + 0x80], 0xffffffff
mov dword [rsp + 0x90], 0xffffffff
mov dword [rsp + 0xc0], 0xffffffff
cmp qword [rdi + 0x18], 8
jb 0x1400010b9
mov rdi, qword [rdi]
lea r9, [rsp + 0x70]
mov rcx, rdi
xor edx, edx
xor r8d, r8d
call qword [sym.imp.WINHTTP.dll_WinHttpCrackUrl]
test eax, eax
je 0x1400013d3
movzx edi, word [rsp + 0x94]
mov r8d, dword [rsp + 0x90]
mov rdx, qword [rsp + 0x88]
xorps xmm0, xmm0
movaps xmmword [rsp + 0x40], xmm0
movaps xmmword [rsp + 0x50], xmm0
lea r14, [rsp + 0x40]
mov rcx, r14
call fcn.140002040
cmp qword [rsp + 0x58], 8
jb 0x140001113
mov r14, qword [rsp + 0x40]
mov rcx, rsi
mov rdx, r14
mov r8d, edi
xor r9d, r9d
call qword [sym.imp.WINHTTP.dll_WinHttpConnect]
mov rdi, rax
mov rax, qword [rsp + 0x58]
cmp rax, 8
jb 0x140001170
mov rcx, qword [rsp + 0x40]
lea rdx, [rax*2 + 2]
cmp rdx, 0x1000
jb 0x14000116b
mov r8, qword [rcx - 8]
add rcx, 0xfffffffffffffff8
sub rcx, r8
cmp rcx, 0x20
jae 0x140001546
add rax, rax
add rax, 0x29
mov rdx, rax
mov rcx, r8
call fcn.1400138c0
test rdi, rdi
je 0x1400013ef
mov r8d, dword [rsp + 0xc0]
mov rdx, qword [rsp + 0xb8]
xorps xmm6, xmm6
movaps xmmword [rsp + 0x40], xmm6
movaps xmmword [rsp + 0x50], xmm6
lea r14, [rsp + 0x40]
mov rcx, r14
call fcn.140002040
cmp qword [rsp + 0x58], 8
jb 0x1400011b0
mov r14, qword [rsp + 0x40]
movups xmmword [rsp + 0x20], xmm6
mov dword [rsp + 0x30], 0x800000
lea rdx, [0x1400470d4]
mov rcx, rdi
mov r8, r14
xor r9d, r9d
call qword [sym.imp.WINHTTP.dll_WinHttpOpenRequest]
mov r14, rax
mov rax, qword [rsp + 0x58]
cmp rax, 8
jb 0x14000121e
mov rcx, qword [rsp + 0x40]
lea rdx, [rax*2 + 2]
cmp rdx, 0x1000
jb 0x140001219
mov r8, qword [rcx - 8]
add rcx, 0xfffffffffffffff8
sub rcx, r8
cmp rcx, 0x20
jae 0x140001546
add rax, rax
add rax, 0x29
mov rdx, rax
mov rcx, r8
call fcn.1400138c0
test r14, r14
je 0x14000140b
mov qword [rsp + 0x30], 0
mov dword [rsp + 0x28], 0
mov dword [rsp + 0x20], 0
mov rcx, r14
xor edx, edx
xor r8d, r8d
xor r9d, r9d
call qword [sym.imp.WINHTTP.dll_WinHttpSendRequest]
test eax, eax
je 0x14000142c
mov rcx, r14
xor edx, edx
call qword [sym.imp.WINHTTP.dll_WinHttpReceiveResponse]
test eax, eax
je 0x140001452
cmp qword [rbx + 0x18], 8
jb 0x140001276
mov rbx, qword [rbx]
mov qword [rsp + 0x30], 0
mov dword [rsp + 0x28], 0x80
mov dword [rsp + 0x20], 2
mov rcx, rbx
mov edx, 0x40000000
xor r8d, r8d
xor r9d, r9d
call qword [sym.imp.KERNEL32.dll_CreateFileW]
cmp rax, 0xffffffffffffffff
je 0x140001478
mov r13, rax
mov ecx, 0x10027
call fcn.14001387c
lea r12, [rax + 0x27]
and r12, 0xffffffffffffffe0
mov qword [r12 - 8], rax
lea rax, [r12 + 0x10000]
mov qword [rsp + 0x68], rax
mov r8d, 0x10000
mov rcx, r12
xor edx, edx
call fcn.14003c050
mov dword [rsp + 0x40], 0
mov dword [rsp + 0x3c], 0
mov rbp, qword [sym.imp.WINHTTP.dll_WinHttpReadData]
mov r15, qword [sym.imp.KERNEL32.dll_WriteFile]
nop word cs:[rax + rax]
mov rcx, r14
mov rdx, r12
mov r8d, 0x10000
lea r9, [rsp + 0x40]
call rbp
test eax, eax
sete al
mov r8d, dword [rsp + 0x40]
test r8d, r8d
sete bl
or bl, al
jne 0x1400014cb
mov qword [rsp + 0x20], 0
mov rcx, r13
mov rdx, r12
lea r9, [rsp + 0x3c]
call r15
test eax, eax
je 0x140001360
mov eax, dword [rsp + 0x3c]
cmp eax, dword [rsp + 0x40]
je 0x140001310
lea r15, [0x140051b70]
lea rdx, str._Error__Failed_to_write_to_file.
mov rcx, r15
call fcn.140001820
mov rcx, rax
mov dl, 0xa
call fcn.140001550
mov rcx, r13
call qword [sym.imp.KERNEL32.dll_CloseHandle]
mov r13, qword [sym.imp.WINHTTP.dll_WinHttpCloseHandle]
mov rcx, r14
call r13
mov rcx, rdi
call r13
mov rcx, rsi
call r13
lea rdx, str._Error__Download_failed.
mov rcx, r15
call fcn.140001820
mov rcx, rax
mov dl, 0xa
call fcn.140001550
jmp 0x14000150a
lea rcx, [0x140051b70]
lea rdx, str._Error__Failed_to_initialize_WinHTTP.
jmp 0x14000149c
mov rcx, rsi
call qword [sym.imp.WINHTTP.dll_WinHttpCloseHandle]
lea rcx, [0x140051b70]
lea rdx, str._Error__Failed_to_parse_URL.
jmp 0x14000149c
mov rcx, rsi
call qword [sym.imp.WINHTTP.dll_WinHttpCloseHandle]
lea rcx, [0x140051b70]
lea rdx, str._Error__Failed_to_connect_to_server.
jmp 0x14000149c
mov rbx, qword [sym.imp.WINHTTP.dll_WinHttpCloseHandle]
mov rcx, rdi
call rbx
mov rcx, rsi
call rbx
lea rcx, [0x140051b70]
lea rdx, str._Error__Failed_to_create_request.
jmp 0x14000149c
mov rbx, qword [sym.imp.WINHTTP.dll_WinHttpCloseHandle]
mov rcx, r14
call rbx
mov rcx, rdi
call rbx
mov rcx, rsi
call rbx
lea rcx, [0x140051b70]
lea rdx, str._Error__Failed_to_send_request.
jmp 0x14000149c
mov rbx, qword [sym.imp.WINHTTP.dll_WinHttpCloseHandle]
mov rcx, r14
call rbx
mov rcx, rdi
call rbx
mov rcx, rsi
call rbx
lea rcx, [0x140051b70]
lea rdx, str._Error__Failed_to_receive_response.
jmp 0x14000149c
mov rbx, qword [sym.imp.WINHTTP.dll_WinHttpCloseHandle]
mov rcx, r14
call rbx
mov rcx, rdi
call rbx
mov rcx, rsi
call rbx
lea rcx, [0x140051b70]
lea rdx, str._Error__Failed_to_create_file.
call fcn.140001820
mov rcx, rax
mov dl, 0xa
call fcn.140001550
xor ebx, ebx
mov eax, ebx
movaps xmm6, xmmword [rsp + 0xe0]
add rsp, 0xf8
pop rbx
pop rbp
pop rdi
pop rsi
pop r12
pop r13
pop r14
pop r15
ret
mov rcx, r13
call qword [sym.imp.KERNEL32.dll_CloseHandle]
mov r15, qword [sym.imp.WINHTTP.dll_WinHttpCloseHandle]
mov rcx, r14
call r15
mov rcx, rdi
call r15
mov rcx, rsi
call r15
lea rcx, [0x140052150]
lea rdx, str._Info__Downloaded_file.
call fcn.140001db0
mov rcx, rax
mov dl, 0xa
call fcn.140001aa0
test r12, r12
mov rdx, qword [rsp + 0x68]
je 0x1400014ad
sub rdx, r12
cmp rdx, 0x1000
jb 0x140001539
mov rax, qword [r12 - 8]
add r12, 0xfffffffffffffff8
sub r12, rax
cmp r12, 0x20
jae 0x140001546
add rdx, 0x27
mov r12, rax
mov rcx, r12
call fcn.1400138c0
jmp 0x1400014ad
call fcn.140020300
int3