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

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x418311
mov eax, dword fs:[0]
push eax
sub esp, 0x128
mov eax, dword [0x41f4bc]
xor eax, ebp
mov dword [ebp - 0x14], eax
push ebx
push esi
push edi
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov eax, dword [ebp + 8]
xor edi, edi
push edi
push edi
push edi
push edi
push str.A_WinHTTP_Example_Program_1.0
mov esi, ecx
mov dword [ebp - 0x44], eax
mov byte [ebp - 0x31], 0
mov dword [ebp - 0x3c], edi
mov dword [ebp - 0x48], edi
mov dword [ebp - 0x40], edi
mov dword [ebp - 0x38], edi
call dword [sym.imp.WINHTTP.dll_WinHttpOpen]
mov dword [ebp - 0x4c], eax
cmp eax, edi
je 0x401d73
push 0x3c
lea ecx, [ebp - 0x88]
push edi
push ecx
call fcn.00408fc0
or eax, 0xffffffff
mov ebx, 8
add esp, 0xc
mov dword [ebp - 0x88], 0x3c
mov dword [ebp - 0x80], eax
mov dword [ebp - 0x74], eax
mov dword [ebp - 0x58], eax
mov dword [ebp - 0x50], eax
cmp dword [esi + 0x14], ebx
jb 0x401989
mov esi, dword [esi]
lea edx, [ebp - 0x88]
push edx
push 0
push 0
push esi
call dword [sym.imp.WINHTTP.dll_WinHttpCrackUrl]
test eax, eax
je 0x401a5c
mov ecx, dword [ebp - 0x74]
xor eax, eax
mov word [ebp - 0x30], ax
mov eax, dword [ebp - 0x78]
push ecx
lea ecx, [ebp - 0x30]
mov dword [ebp - 0x1c], 7
mov dword [ebp - 0x20], edi
call fcn.00403d70
mov eax, dword [ebp - 0x30]
cmp dword [ebp - 0x1c], ebx
jae 0x4019cd
lea eax, [ebp - 0x30]
mov edx, dword [ebp - 0x70]
push 0
push edx
push eax
mov eax, dword [ebp - 0x4c]
push eax
call dword [sym.imp.WINHTTP.dll_WinHttpConnect]
mov esi, eax
mov dword [ebp - 0x40], esi
cmp dword [ebp - 0x1c], ebx
jb 0x4019f4
mov ecx, dword [ebp - 0x30]
push ecx
call fcn.00406fb8
add esp, 4
xor edx, edx
mov dword [ebp - 0x1c], 7
mov dword [ebp - 0x20], edi
mov word [ebp - 0x30], dx
test esi, esi
je 0x401a5c
mov ecx, dword [ebp - 0x5c]
xor eax, eax
cmp dword [ebp - 0x7c], 2
setne al
dec eax
and eax, 0x800000
push eax
push edx
push edx
push edx
mov edx, dword [ebp - 0x40]
push ecx
push 0x41c3f4
push edx
call dword [sym.imp.WINHTTP.dll_WinHttpOpenRequest]
mov dword [ebp - 0x38], eax
test eax, eax
je 0x401a5c
push 0
push 0
push 0
push 0
push 0
push 0
push eax
call dword [sym.imp.WINHTTP.dll_WinHttpSendRequest]
mov edi, eax
test edi, edi
je 0x401a5c
mov ecx, dword [ebp - 0x38]
push 0
push ecx
call dword [sym.imp.WINHTTP.dll_WinHttpReceiveResponse]
mov edi, eax
mov edx, dword [ebp - 0x44]
push edx
lea eax, [ebp - 0x134]
push eax
call fcn.00402e80
mov dword [ebp - 4], 0
cmp dword [ebp - 0xdc], 0
jne 0x401b4a
push str.Unable_to_open_file_for_writing.
call fcn.00404de0
add esp, 4
mov esi, eax
push 0xa
mov ecx, esi
call fcn.004027c0
mov ecx, dword [esi]
mov eax, dword [ecx + 4]
mov ecx, dword [eax + esi + 0xc]
xor edi, edi
test cl, 6
jne 0x401abf
mov eax, dword [eax + esi + 0x38]
mov edx, dword [eax]
mov ecx, eax
mov eax, dword [edx + 0x34]
call eax
cmp eax, 0xffffffff
jne 0x401abf
mov edi, 4
mov ecx, dword [esi]
mov ecx, dword [ecx + 4]
add ecx, esi
test edi, edi
je 0x401ae0
mov eax, dword [ecx + 0xc]
or eax, edi
cmp dword [ecx + 0x38], 0
jne 0x401ad8
or eax, 4
push 0
push eax
call fcn.00401560
mov eax, dword [ebp - 0x134]
mov ecx, dword [eax + 4]
lea edx, [ebp - 0xd4]
mov dword [ebp - 0x44], edx
mov dword [ebp + ecx - method.std::basic_ofstream_char__struct_std::char_traits_char__.virtual_0], vtable.std::basic_ofstream_char__struct_std::char_traits_char__.0
lea ecx, [ebp - 0x130]
mov dword [ebp - 4], 1
call fcn.00402fe0
mov dword [ebp - 4], 0xffffffff
mov edx, dword [ebp - 0x134]
mov eax, dword [edx + 4]
lea ecx, [ebp - 0xd4]
mov dword [ebp + eax - method.std::basic_ostream_char__struct_std::char_traits_char__.virtual_0], vtable.std::basic_ostream_char__struct_std::char_traits_char__.0
push ecx
mov dword [ebp - 0xd4], vtable.std::ios_base.0
call fcn.004055e6
add esp, 4
xor al, al
jmp 0x401d76
test edi, edi
je 0x401cb6
mov eax, dword [ebp - 0x38]
lea edx, [ebp - 0x3c]
push edx
push eax
mov dword [ebp - 0x3c], 0
call dword [sym.imp.WINHTTP.dll_WinHttpQueryDataAvailable]
test eax, eax
je 0x401c39
mov ecx, dword [ebp - 0x3c]
inc ecx
push ecx
call fcn.00405c43
mov ebx, eax
add esp, 4
test ebx, ebx
je 0x401c58
mov edx, dword [ebp - 0x3c]
inc edx
push edx
push 0
push ebx
call fcn.00408fc0
mov ecx, dword [ebp - 0x3c]
mov edx, dword [ebp - 0x38]
add esp, 0xc
lea eax, [ebp - 0x48]
push eax
push ecx
push ebx
push edx
call dword [sym.imp.WINHTTP.dll_WinHttpReadData]
test eax, eax
jne 0x401c0d
push str.Error_in_WinHttpReadData.
call fcn.00404de0
add esp, 4
mov esi, eax
push 0xa
mov ecx, esi
call fcn.004027c0
mov eax, dword [esi]
mov eax, dword [eax + 4]
xor edi, edi
test byte [eax + esi + 0xc], 6
jne 0x401bea
mov eax, dword [eax + esi + 0x38]
mov edx, dword [eax]
mov ecx, eax
mov eax, dword [edx + 0x34]
call eax
cmp eax, 0xffffffff
jne 0x401bea
mov edi, 4
mov ecx, dword [esi]
mov ecx, dword [ecx + 4]
add ecx, esi
test edi, edi
je 0x401c24
mov eax, dword [ecx + 0xc]
or eax, edi
cmp dword [ecx + 0x38], 0
jne 0x401c03
or eax, 4
push 0
push eax
call fcn.00401560
jmp 0x401c24
mov edx, dword [ebp - 0x48]
push 0
push edx
push ebx
lea eax, [ebp - 0x134]
push eax
call fcn.00402930
mov byte [ebp - 0x31], 1
push ebx
call fcn.00406fad
add esp, 4
cmp dword [ebp - 0x3c], 0
ja 0x401b52
jmp 0x401cb6
push str.Error_in_WinHttpQueryDataAvailable.
call fcn.00404de0
add esp, 4
mov esi, eax
push 0xa
mov ecx, esi
call fcn.004027c0
mov ecx, dword [esi]
mov eax, dword [ecx + 4]
jmp 0x401c75
push str.Out_of_memory.
call fcn.00404de0
add esp, 4
mov esi, eax
push 0xa
mov ecx, esi
call fcn.004027c0
mov edx, dword [esi]
mov eax, dword [edx + 4]
xor edi, edi
test byte [eax + esi + 0xc], 6
jne 0x401c95
mov eax, dword [eax + esi + 0x38]
mov edx, dword [eax]
mov ecx, eax
mov eax, dword [edx + 0x34]
call eax
cmp eax, 0xffffffff
jne 0x401c95
mov edi, 4
mov ecx, dword [esi]
mov ecx, dword [ecx + 4]
add ecx, esi
test edi, edi
je 0x401cb6
mov eax, dword [ecx + 0xc]
or eax, edi
cmp dword [ecx + 0x38], 0
jne 0x401cae
or eax, 4
push 0
push eax
call fcn.00401560
lea ecx, [ebp - 0x130]
call fcn.00403f70
test eax, eax
jne 0x401cf0
mov edx, dword [ebp - 0x134]
mov ecx, dword [edx + 4]
mov eax, dword [ebp + ecx - 0x128]
lea ecx, [ebp + ecx - 0x134]
or eax, 2
cmp dword [ecx + 0x38], 0
jne 0x401ce8
or eax, 4
push 0
push eax
call fcn.00401560
mov ecx, dword [ebp - 0x134]
mov edx, dword [ecx + 4]
lea eax, [ebp - 0xd4]
mov dword [ebp - 0x44], eax
mov dword [ebp + edx - method.std::basic_ofstream_char__struct_std::char_traits_char__.virtual_0], vtable.std::basic_ofstream_char__struct_std::char_traits_char__.0
lea ecx, [ebp - 0x130]
mov dword [ebp - 4], 2
call fcn.00402fe0
mov dword [ebp - 4], 0xffffffff
mov eax, dword [ebp - 0x134]
mov ecx, dword [eax + 4]
lea edx, [ebp - 0xd4]
mov dword [ebp + ecx - method.std::basic_ostream_char__struct_std::char_traits_char__.virtual_0], vtable.std::basic_ostream_char__struct_std::char_traits_char__.0
push edx
mov dword [ebp - 0xd4], vtable.std::ios_base.0
call fcn.004055e6
mov eax, dword [ebp - 0x38]
mov esi, dword [sym.imp.WINHTTP.dll_WinHttpCloseHandle]
add esp, 4
test eax, eax
je 0x401d63
push eax
call esi
mov eax, dword [ebp - 0x40]
test eax, eax
je 0x401d6d
push eax
call esi
mov eax, dword [ebp - 0x4c]
push eax
call esi
mov al, byte [ebp - 0x31]
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 0x14]
xor ecx, ebp
call fcn.00406081
mov esp, ebp
pop ebp
ret