Function at 0x140002040
Capabilities:
Create http request
Get http content length
Read data from internet
Receive data

Disassembly:
push rbx
push rbp
push rsi
push r15
sub rsp, 0x458
mov rax, qword [0x14003f080]
xor rax, rsp
mov qword [rsp + 0x440], rax
xor ebp, ebp
mov rsi, rdx
mov rbx, rcx
mov dword [rsp + 0x20], ebp
xor r9d, r9d
lea rcx, str.MyAgent
xor r8d, r8d
lea edx, [rbp + 1]
call qword [sym.imp.WININET.dll_InternetOpenA]
mov r15, rax
test rax, rax
jne 0x1400020bd
call qword [sym.imp.KERNEL32.dll_GetLastError]
lea rdx, str.InternetOpen_failed_with_error:
mov ebx, eax
lea rcx, [0x1400405d0]
call fcn.140006360
mov rcx, rax
mov edx, ebx
call fcn.140003b80
mov rcx, rax
call fcn.140006610
xor al, al
jmp 0x1400022cb
cmp qword [rbx + 0x18], 0xf
mov qword [rsp + 0x450], r14
jbe 0x1400020cf
mov rbx, qword [rbx]
mov qword [rsp + 0x28], rbp
xor r9d, r9d
xor r8d, r8d
mov dword [rsp + 0x20], 0x84000000
mov rdx, rbx
mov rcx, r15
call qword [sym.imp.WININET.dll_InternetOpenUrlA]
mov r14, rax
test rax, rax
jne 0x140002133
call qword [sym.imp.KERNEL32.dll_GetLastError]
lea rdx, str.InternetOpenUrl_failed_with_error:
mov ebx, eax
lea rcx, [0x1400405d0]
call fcn.140006360
mov rcx, rax
mov edx, ebx
call fcn.140003b80
mov rcx, rax
call fcn.140006610
mov rcx, r15
call qword [sym.imp.WININET.dll_InternetCloseHandle]
xor al, al
jmp 0x1400022c3
lea r9, [rsp + 0x38]
mov dword [rsp + 0x30], ebp
lea r8, [rsp + 0x30]
mov dword [rsp + 0x38], 4
mov edx, 0x20000005
mov qword [rsp + 0x20], rbp
mov rcx, r14
call qword [sym.imp.WININET.dll_HttpQueryInfoA]
test eax, eax
jne 0x1400021a6
call qword [sym.imp.KERNEL32.dll_GetLastError]
lea rdx, str.HttpQueryInfo_failed_with_error:
mov ebx, eax
lea rcx, [0x1400405d0]
call fcn.140006360
mov rcx, rax
mov edx, ebx
call fcn.140003b80
mov rcx, rax
call fcn.140006610
mov rcx, r14
call qword [sym.imp.WININET.dll_InternetCloseHandle]
mov rcx, r15
call qword [sym.imp.WININET.dll_InternetCloseHandle]
xor al, al
jmp 0x1400022c3
lea r9, [rsp + 0x34]
mov r8d, 0x400
lea rdx, [rsp + 0x40]
mov rcx, r14
call qword [sym.imp.WININET.dll_InternetReadFile]
test eax, eax
je 0x1400022a3
mov qword [rsp + 0x490], rdi
nop
mov eax, dword [rsp + 0x34]
test eax, eax
je 0x14000229b
mov rdx, qword [rsi + 0x18]
mov ebx, eax
mov rcx, qword [rsi + 0x10]
mov rax, rdx
sub rax, rcx
cmp rbx, rax
ja 0x14000221f
lea rax, [rcx + rbx]
mov qword [rsi + 0x10], rax
mov rax, rsi
cmp rdx, 0xf
jbe 0x140002205
mov rax, qword [rsi]
lea rdi, [rax + rcx]
mov r8, rbx
mov rcx, rdi
lea rdx, [rsp + 0x40]
call fcn.14002c150
mov byte [rdi + rbx], 0
jmp 0x140002237
lea r9, [rsp + 0x40]
mov qword [rsp + 0x20], rbx
xor r8d, r8d
mov rdx, rbx
mov rcx, rsi
call fcn.1400067e0
add ebp, dword [rsp + 0x34]
lea rcx, [0x140040450]
xor edx, edx
imul eax, ebp, 0x64
div dword [rsp + 0x30]
lea rdx, str._rDownload_progress:
mov ebx, eax
call fcn.140006360
mov rcx, rax
mov edx, ebx
call fcn.140003b80
mov rcx, rax
lea rdx, [0x140039b44]
call fcn.140006360
mov rcx, rax
call fcn.140005f90
lea r9, [rsp + 0x34]
mov r8d, 0x400
lea rdx, [rsp + 0x40]
mov rcx, r14
call qword [sym.imp.WININET.dll_InternetReadFile]
test eax, eax
jne 0x1400021d0
mov rdi, qword [rsp + 0x490]
lea rcx, [0x140040450]
call fcn.140006610
mov rcx, r14
call qword [sym.imp.WININET.dll_InternetCloseHandle]
mov rcx, r15
call qword [sym.imp.WININET.dll_InternetCloseHandle]
mov al, 1
mov r14, qword [rsp + 0x450]
mov rcx, qword [rsp + 0x440]
xor rcx, rsp
call fcn.140008fe0
add rsp, 0x458
pop r15
pop rsi
pop rbp
pop rbx
ret