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

Disassembly:
push rdi
push r12
push r15
sub rsp, 0x70
mov rax, qword [0x14000c040]
xor rax, rsp
mov qword [rsp + 0x50], rax
mov r15, rcx
xor edi, edi
lea rcx, str.A_WinHTTP_Example_Program_1.0
mov dword [rsp + 0x20], edi
xor r9d, r9d
xor r8d, r8d
xor edx, edx
call qword [sym.imp.WINHTTP.dll_WinHttpOpen]
mov r12, rax
test rax, rax
jne 0x140004809
mov rcx, qword [sym.imp.MSVCP140.dll_class_std::basic_ostream_char__struct_std::char_traits_char___std::cerr]
lea rdx, str.Failed_to_initialize_WinHTTP_session
call fcn.140001050
lea rdx, [0x140002960]
mov rcx, rax
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__::operator___class_std::basic_ostream_char__struct_std::char_traits_char______ptr64____cdecl___class_std::basic_ostream_char__struct_std::char_traits_char______ptr64_____ptr64]
mov al, 1
jmp 0x140004afe
mov r8d, 0x1bb
mov qword [rsp + 0x68], r13
xor r9d, r9d
lea rdx, str.myexternalip.com
mov rcx, r12
call qword [sym.imp.WINHTTP.dll_WinHttpConnect]
mov r13, rax
test rax, rax
jne 0x140004862
mov rcx, qword [sym.imp.MSVCP140.dll_class_std::basic_ostream_char__struct_std::char_traits_char___std::cerr]
lea rdx, str.Failed_to_connect_to_server
call fcn.140001050
lea rdx, [0x140002960]
mov rcx, rax
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__::operator___class_std::basic_ostream_char__struct_std::char_traits_char______ptr64____cdecl___class_std::basic_ostream_char__struct_std::char_traits_char______ptr64_____ptr64]
mov rcx, r12
call qword [sym.imp.WINHTTP.dll_WinHttpCloseHandle]
mov al, 1
jmp 0x140004af9
mov dword [rsp + 0x30], 0x800000
lea r8, str._raw
mov qword [rsp + 0x28], rdi
lea rdx, [0x140008738]
xor r9d, r9d
mov qword [rsp + 0x20], rdi
mov rcx, r13
mov qword [rsp + 0xa0], rbp
call qword [sym.imp.WINHTTP.dll_WinHttpOpenRequest]
mov rbp, rax
test rax, rax
jne 0x1400048c3
mov rcx, qword [sym.imp.MSVCP140.dll_class_std::basic_ostream_char__struct_std::char_traits_char___std::cerr]
lea rdx, str.Failed_to_open_request
call fcn.140001050
lea rdx, [0x140002960]
mov rcx, rax
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__::operator___class_std::basic_ostream_char__struct_std::char_traits_char______ptr64____cdecl___class_std::basic_ostream_char__struct_std::char_traits_char______ptr64_____ptr64]
jmp 0x140004929
mov qword [rsp + 0x30], rdi
xor r9d, r9d
mov dword [rsp + 0x28], edi
xor r8d, r8d
xor edx, edx
mov dword [rsp + 0x20], edi
mov rcx, rbp
call qword [sym.imp.WINHTTP.dll_WinHttpSendRequest]
test eax, eax
jne 0x1400048ee
lea rdx, str.Failed_to_send_request
jmp 0x140004904
xor edx, edx
mov rcx, rbp
call qword [sym.imp.WINHTTP.dll_WinHttpReceiveResponse]
test eax, eax
jne 0x140004942
lea rdx, str.Failed_to_receive_response
mov rcx, qword [sym.imp.MSVCP140.dll_class_std::basic_ostream_char__struct_std::char_traits_char___std::cerr]
call fcn.140001050
lea rdx, [0x140002960]
mov rcx, rax
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__::operator___class_std::basic_ostream_char__struct_std::char_traits_char______ptr64____cdecl___class_std::basic_ostream_char__struct_std::char_traits_char______ptr64_____ptr64]
mov rcx, rbp
call qword [sym.imp.WINHTTP.dll_WinHttpCloseHandle]
mov rcx, r13
call qword [sym.imp.WINHTTP.dll_WinHttpCloseHandle]
mov rcx, r12
call qword [sym.imp.WINHTTP.dll_WinHttpCloseHandle]
mov al, 1
jmp 0x140004af1
mov qword [rsp + 0x98], rbx
movzx ebx, byte [rsp + 0x40]
mov qword [rsp + 0xa8], rsi
mov qword [rsp + 0x60], r14
mov dword [rsp + 0x48], edi
lea rdx, [rsp + 0x44]
mov dword [rsp + 0x44], edi
mov rcx, rbp
call qword [sym.imp.WINHTTP.dll_WinHttpQueryDataAvailable]
test eax, eax
je 0x140004a9a
mov ecx, dword [rsp + 0x44]
inc ecx
call fcn.1400065b8
mov rsi, rax
test rax, rax
je 0x140004a91
mov r8d, dword [rsp + 0x44]
xor edx, edx
inc r8d
mov rcx, rax
call sub.VCRUNTIME140.dll_memset
mov r8d, dword [rsp + 0x44]
lea r9, [rsp + 0x48]
mov rdx, rsi
mov rcx, rbp
call qword [sym.imp.WINHTTP.dll_WinHttpReadData]
test eax, eax
jne 0x1400049e5
mov rcx, qword [sym.imp.MSVCP140.dll_class_std::basic_ostream_char__struct_std::char_traits_char___std::cerr]
lea rdx, str.Error_in_WinHttpReadData
call fcn.140001050
lea rdx, [0x140002960]
mov rcx, rax
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__::operator___class_std::basic_ostream_char__struct_std::char_traits_char______ptr64____cdecl___class_std::basic_ostream_char__struct_std::char_traits_char______ptr64_____ptr64]
jmp 0x140004a7c
cmp byte [r15], 0
jne 0x140004a7c
mov rcx, qword [sym.imp.MSVCP140.dll_class_std::basic_ostream_char__struct_std::char_traits_char___std::cout]
lea rdx, str.Received_data:
call fcn.140001050
mov rcx, rax
mov rdx, rsi
call fcn.140001050
lea rdx, [0x140002960]
mov rcx, rax
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__::operator___class_std::basic_ostream_char__struct_std::char_traits_char______ptr64____cdecl___class_std::basic_ostream_char__struct_std::char_traits_char______ptr64_____ptr64]
lea rcx, [r15 + 8]
mov rdi, 0xffffffffffffffff
nop dword [rax + rax]
inc rdi
cmp byte [rsi + rdi], 0
jne 0x140004a30
mov rax, qword [rcx + 0x18]
cmp rdi, rax
ja 0x140004a67
mov r14, rcx
cmp rax, 0xf
jbe 0x140004a4e
mov r14, qword [rcx]
mov qword [rcx + 0x10], rdi
mov r8, rdi
mov rcx, r14
mov rdx, rsi
call sub.VCRUNTIME140.dll_memmove
mov byte [r14 + rdi], 0
jmp 0x140004a76
mov r9, rsi
movzx r8d, bl
mov rdx, rdi
call fcn.140001b70
mov byte [r15], 1
xor edi, edi
mov rcx, rsi
call fcn.1400065b0
cmp dword [rsp + 0x44], 0
ja 0x140004960
jmp 0x140004abd
lea rdx, str.Out_of_memory
jmp 0x140004aa1
lea rdx, str.Error_in_WinHttpQueryDataAvailable
mov rcx, qword [sym.imp.MSVCP140.dll_class_std::basic_ostream_char__struct_std::char_traits_char___std::cerr]
call fcn.140001050
lea rdx, [0x140002960]
mov rcx, rax
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__::operator___class_std::basic_ostream_char__struct_std::char_traits_char______ptr64____cdecl___class_std::basic_ostream_char__struct_std::char_traits_char______ptr64_____ptr64]
mov rcx, rbp
call qword [sym.imp.WINHTTP.dll_WinHttpCloseHandle]
mov rcx, r13
call qword [sym.imp.WINHTTP.dll_WinHttpCloseHandle]
mov rcx, r12
call qword [sym.imp.WINHTTP.dll_WinHttpCloseHandle]
movzx eax, byte [r15]
mov r14, qword [rsp + 0x60]
mov rsi, qword [rsp + 0xa8]
mov rbx, qword [rsp + 0x98]
mov rbp, qword [rsp + 0xa0]
mov r13, qword [rsp + 0x68]
mov rcx, qword [rsp + 0x50]
xor rcx, rsp
call fcn.1400066d0
add rsp, 0x70
pop r15
pop r12
pop rdi
ret