Function at 0x140001360
Capabilities:
Initialize winhttp library
Prepare http request
Receive http response

Disassembly:
push rbx
push rbp
push rsi
push rdi
push r12
push r14
push r15
mov eax, 0x2170
call fcn.140004230
sub rsp, rax
mov rax, qword [0x140009040]
xor rax, rsp
mov qword [rsp + 0x2160], rax
mov r14, r8
mov rsi, rdx
mov rdi, rcx
xor bpl, bpl
xor ebx, ebx
mov dword [rsp + 0x20], ebx
xor r9d, r9d
xor r8d, r8d
xor edx, edx
lea rcx, str.WinHTTP_Example_1.0
call qword [sym.imp.WINHTTP.dll_WinHttpOpen]
mov r12, rax
test rax, rax
je 0x1400015b7
cmp qword [rdi + 0x18], 7
jbe 0x1400013c7
mov rdi, qword [rdi]
mov r8d, 0x50
xor r9d, r9d
mov rdx, rdi
mov rcx, r12
call qword [sym.imp.WINHTTP.dll_WinHttpConnect]
mov r15, rax
test rax, rax
je 0x1400015ae
cmp qword [rsi + 0x18], 7
jbe 0x1400013f2
mov rsi, qword [rsi]
mov dword [rsp + 0x30], 0x100
mov qword [rsp + 0x28], rbx
mov qword [rsp + 0x20], rbx
xor r9d, r9d
mov r8, rsi
lea rdx, [0x140005570]
mov rcx, r15
call qword [sym.imp.WINHTTP.dll_WinHttpOpenRequest]
mov rdi, rax
test rax, rax
je 0x1400015a5
mov qword [rsp + 0x30], rbx
mov dword [rsp + 0x28], ebx
mov dword [rsp + 0x20], ebx
xor r9d, r9d
xor r8d, r8d
xor edx, edx
mov rcx, rax
call qword [sym.imp.WINHTTP.dll_WinHttpSendRequest]
test eax, eax
je 0x14000159c
xor edx, edx
mov rcx, rdi
call qword [sym.imp.WINHTTP.dll_WinHttpReceiveResponse]
test eax, eax
je 0x14000159c
xor edx, edx
mov r8d, 0x108
lea rcx, [rsp + 0x50]
call sub.VCRUNTIME140.dll_memset
mov rdx, r14
cmp qword [r14 + 0x18], 7
jbe 0x14000147e
mov rdx, qword [r14]
lea rcx, [rsp + 0x50]
call fcn.140002aa0
mov rax, qword [rsp + 0x50]
movsxd rcx, dword [rax + 4]
lea rax, vtable.std::basic_ofstream_char__struct_std::char_traits_char__.0
mov qword [rsp + rcx + 0x50], rax
mov rax, qword [rsp + 0x50]
movsxd rcx, dword [rax + 4]
lea edx, [rcx - 0xa8]
mov dword [rsp + rcx + 0x4c], edx
cmp qword [rsp + 0xd8], 0
je 0x140001592
mov dword [rsp + 0x40], ebx
lea r9, [rsp + 0x40]
mov r8d, 0x2000
lea rdx, [rsp + 0x160]
mov rcx, rdi
call qword [sym.imp.WINHTTP.dll_WinHttpReadData]
test eax, eax
je 0x140001503
mov r8d, dword [rsp + 0x40]
lea rdx, [rsp + 0x160]
lea rcx, [rsp + 0x50]
call qword [sym.imp.MSVCP140.dll_public:_class_std::basic_ostream_char__struct_std::char_traits_char______ptr64___cdecl_std::basic_ostream_char__struct_std::char_traits_char__::write_char_const____ptr64__long_long___int64_____ptr64]
mov eax, dword [rsp + 0x40]
add ebx, eax
jmp 0x140001507
mov eax, dword [rsp + 0x40]
test eax, eax
jne 0x1400014c3
lea rcx, [rsp + 0x58]
call fcn.1400029e0
test rax, rax
jne 0x140001538
mov rax, qword [rsp + 0x50]
movsxd rcx, dword [rax + 4]
lea rax, [rsp + 0x50]
add rcx, rax
xor r8d, r8d
lea edx, [r8 + 2]
call qword [sym.imp.MSVCP140.dll_public:_void___cdecl_std::basic_ios_char__struct_std::char_traits_char__::setstate_int__bool____ptr64]
mov bpl, 1
lea rdx, str.Downloaded
mov rcx, qword [sym.imp.MSVCP140.dll_class_std::basic_ostream_wchar_t__struct_std::char_traits_wchar_t___std::wcout]
call fcn.140002cd0
mov edx, ebx
mov rcx, rax
call qword [sym.imp.MSVCP140.dll_public:_class_std::basic_ostream_wchar_t__struct_std::char_traits_wchar_t______ptr64___cdecl_std::basic_ostream_wchar_t__struct_std::char_traits_wchar_t__::operator___unsigned_long_int____ptr64]
mov rcx, rax
lea rdx, str._bytes_to
call fcn.140002cd0
mov r8, qword [r14 + 0x10]
cmp qword [r14 + 0x18], 7
jbe 0x140001576
mov r14, qword [r14]
mov rdx, r14
mov rcx, rax
call fcn.140003180
lea rdx, [0x140002eb0]
mov rcx, rax
call qword [sym.imp.MSVCP140.dll_public:_class_std::basic_ostream_wchar_t__struct_std::char_traits_wchar_t______ptr64___cdecl_std::basic_ostream_wchar_t__struct_std::char_traits_wchar_t__::operator___class_std::basic_ostream_wchar_t__struct_std::char_traits_wchar_t______ptr64____cdecl___class_std::basic_ostream_wchar_t__struct_std::char_traits_wchar_t______ptr64_____ptr64]
nop
lea rcx, [rsp + 0x50]
call fcn.1400015e0
mov rcx, rdi
call qword [sym.imp.WINHTTP.dll_WinHttpCloseHandle]
mov rcx, r15
call qword [sym.imp.WINHTTP.dll_WinHttpCloseHandle]
mov rcx, r12
call qword [sym.imp.WINHTTP.dll_WinHttpCloseHandle]
movzx eax, bpl
mov rcx, qword [rsp + 0x2160]
xor rcx, rsp
call fcn.1400033b0
add rsp, 0x2170
pop r15
pop r14
pop r12
pop rdi
pop rsi
pop rbp
pop rbx
ret