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

Disassembly:
push rbp
push rbx
push rsi
push r12
push r14
lea rbp, [rsp - 0x85d0]
mov eax, 0x86d0
call fcn.140006810
sub rsp, rax
mov rax, qword [0x14000c040]
xor rax, rsp
mov qword [rbp + 0x85c0], rax
mov rsi, r8
lea rcx, str.A_WinHTTP_Example_1.0
mov rbx, rdx
xor r12d, r12d
xor r8d, r8d
mov dword [rsp + 0x20], r12d
xor edx, edx
xor r9d, r9d
call qword [sym.imp.WINHTTP.dll_WinHttpOpen]
mov r14, rax
test rax, rax
jne 0x1400019e3
mov rcx, qword [sym.imp.MSVCP140.dll_class_std::basic_ostream_wchar_t__struct_std::char_traits_wchar_t___std::wcerr]
lea rdx, str.Failed_to_open_WinHttp_session.
call fcn.140003f00
mov rcx, rax
lea rdx, [0x1400040e0]
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]
xor al, al
jmp 0x140001cfd
xorps xmm0, xmm0
mov dword [rsp + 0x40], 0x68
xor edx, edx
lea rcx, [rbp - 0x40]
mov r8d, 0x200
movups xmmword [rsp + 0x48], xmm0
movups xmmword [rsp + 0x58], xmm0
movups xmmword [rsp + 0x68], xmm0
movups xmmword [rsp + 0x78], xmm0
movups xmmword [rbp - 0x78], xmm0
movups xmmword [rbp - 0x68], xmm0
call sub.VCRUNTIME140.dll_memset
xor edx, edx
lea rcx, [rbp + 0x1c0]
mov r8d, 0x400
call sub.VCRUNTIME140.dll_memset
cmp qword [rbx + 0x18], 7
lea rax, [rbp - 0x40]
mov qword [rsp + 0x58], rax
lea rax, [rbp + 0x1c0]
mov qword [rbp - 0x78], rax
mov dword [rsp + 0x60], 0x100
mov dword [rbp - 0x70], 0x200
jbe 0x140001a5c
mov rbx, qword [rbx]
lea r9, [rsp + 0x40]
xor r8d, r8d
xor edx, edx
mov rcx, rbx
call qword [sym.imp.WINHTTP.dll_WinHttpCrackUrl]
test eax, eax
jne 0x140001aa6
mov rcx, qword [sym.imp.MSVCP140.dll_class_std::basic_ostream_wchar_t__struct_std::char_traits_wchar_t___std::wcerr]
lea rdx, str.Failed_to_crack_URL.
call fcn.140003f00
mov rcx, rax
lea rdx, [0x1400040e0]
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]
mov rcx, r14
call qword [sym.imp.WINHTTP.dll_WinHttpCloseHandle]
xor al, al
jmp 0x140001cfd
movzx r8d, word [rsp + 0x64]
lea rdx, [rbp - 0x40]
xor r9d, r9d
mov qword [rsp + 0x8718], r15
mov rcx, r14
call qword [sym.imp.WINHTTP.dll_WinHttpConnect]
mov r15, rax
test rax, rax
jne 0x140001aff
mov rcx, qword [sym.imp.MSVCP140.dll_class_std::basic_ostream_wchar_t__struct_std::char_traits_wchar_t___std::wcerr]
lea rdx, str.Failed_to_connect_to_host.
call fcn.140003f00
mov rcx, rax
lea rdx, [0x1400040e0]
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]
mov rcx, r14
call qword [sym.imp.WINHTTP.dll_WinHttpCloseHandle]
xor al, al
jmp 0x140001cf5
mov r8, qword [rbp - 0x78]
lea rdx, [0x140007748]
mov dword [rsp + 0x30], 0x800000
xor r9d, r9d
mov qword [rsp + 0x28], r12
mov rcx, r15
mov qword [rsp + 0x20], r12
mov qword [rsp + 0x8700], rdi
call qword [sym.imp.WINHTTP.dll_WinHttpOpenRequest]
mov rdi, rax
test rax, rax
jne 0x140001b60
mov rcx, qword [sym.imp.MSVCP140.dll_class_std::basic_ostream_wchar_t__struct_std::char_traits_wchar_t___std::wcerr]
lea rdx, str.Failed_to_open_request.
call fcn.140003f00
mov rcx, rax
lea rdx, [0x1400040e0]
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]
jmp 0x140001c0d
mov qword [rsp + 0x30], r12
xor r9d, r9d
mov dword [rsp + 0x28], r12d
xor r8d, r8d
xor edx, edx
mov dword [rsp + 0x20], r12d
mov rcx, rdi
call qword [sym.imp.WINHTTP.dll_WinHttpSendRequest]
test eax, eax
jne 0x140001b8d
lea rdx, str.Failed_to_send_request.
jmp 0x140001be8
xor edx, edx
mov rcx, rdi
call qword [sym.imp.WINHTTP.dll_WinHttpReceiveResponse]
test eax, eax
jne 0x140001ba5
lea rdx, str.Failed_to_receive_response.
jmp 0x140001be8
cmp qword [rsi + 0x18], 7
jbe 0x140001baf
mov rsi, qword [rsi]
mov qword [rsp + 0x30], r12
xor r9d, r9d
mov dword [rsp + 0x28], 0x80
xor r8d, r8d
mov edx, 0x40000000
mov dword [rsp + 0x20], 2
mov rcx, rsi
call qword [sym.imp.KERNEL32.dll_CreateFileW]
mov rsi, rax
cmp rax, 0xffffffffffffffff
jne 0x140001c26
lea rdx, str.Failed_to_create_file.
mov rcx, qword [sym.imp.MSVCP140.dll_class_std::basic_ostream_wchar_t__struct_std::char_traits_wchar_t___std::wcerr]
call fcn.140003f00
mov rcx, rax
lea rdx, [0x1400040e0]
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]
mov rcx, rdi
call qword [sym.imp.WINHTTP.dll_WinHttpCloseHandle]
mov rcx, r15
call qword [sym.imp.WINHTTP.dll_WinHttpCloseHandle]
mov rcx, r14
call qword [sym.imp.WINHTTP.dll_WinHttpCloseHandle]
xor al, al
jmp 0x140001ced
xor r9d, r9d
lea rdx, [fcn.140001d40]
mov r8d, 0xffffffff
mov rcx, rdi
call qword [sym.imp.WINHTTP.dll_WinHttpSetStatusCallback]
nop
lea r9, [rbp - 0x50]
mov r8d, 0x8000
lea rdx, [rbp + 0x5c0]
mov rcx, rdi
call qword [sym.imp.WINHTTP.dll_WinHttpReadData]
test eax, eax
jne 0x140001c7e
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov ebx, eax
cmp eax, 0x3e5
jne 0x140001d1b
mov ecx, 0x64
call qword [sym.imp.KERNEL32.dll_Sleep]
jmp 0x140001c40
mov r8d, dword [rbp - 0x50]
test r8d, r8d
je 0x140001cc7
lea r9, [rbp - 0x4c]
mov qword [rsp + 0x20], r12
lea rdx, [rbp + 0x5c0]
mov rcx, rsi
call qword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
jne 0x140001c40
mov rcx, qword [sym.imp.MSVCP140.dll_class_std::basic_ostream_wchar_t__struct_std::char_traits_wchar_t___std::wcerr]
lea rdx, str.Failed_to_write_data_to_file.
call fcn.140003f00
lea rdx, [0x1400040e0]
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]
mov rcx, rsi
call qword [sym.imp.KERNEL32.dll_CloseHandle]
mov rcx, rdi
call qword [sym.imp.WINHTTP.dll_WinHttpCloseHandle]
mov rcx, r15
call qword [sym.imp.WINHTTP.dll_WinHttpCloseHandle]
mov rcx, r14
call qword [sym.imp.WINHTTP.dll_WinHttpCloseHandle]
mov al, 1
mov rdi, qword [rsp + 0x8700]
mov r15, qword [rsp + 0x8718]
mov rcx, qword [rbp + 0x85c0]
xor rcx, rsp
call fcn.1400056b0
add rsp, 0x86d0
pop r14
pop r12
pop rsi
pop rbx
pop rbp
ret
mov rcx, qword [sym.imp.MSVCP140.dll_class_std::basic_ostream_wchar_t__struct_std::char_traits_wchar_t___std::wcerr]
lea rdx, str.Failed_to_read_data._Error:
call fcn.140003f00
mov rcx, rax
mov edx, ebx
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]
jmp 0x140001cb7