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

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x419ec1
mov eax, dword fs:[0]
push eax
sub esp, 0x128
mov eax, dword [0x42129c]
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 0x401d5a
push 0x3c
lea ecx, [ebp - 0x88]
push edi
push ecx
call fcn.0040a280
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 0x401959
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 0x401a2c
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.00403d30
mov eax, dword [ebp - 0x30]
cmp dword [ebp - 0x1c], ebx
jae 0x40199d
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 0x4019c4
mov ecx, dword [ebp - 0x30]
push ecx
call fcn.004062b0
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 0x401a2c
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 0x41e468
push edx
call dword [sym.imp.WINHTTP.dll_WinHttpOpenRequest]
mov dword [ebp - 0x38], eax
test eax, eax
je 0x401a2c
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 0x401a2c
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.00402e40
mov dword [ebp - 4], 0
cmp dword [ebp - 0xdc], 0
jne 0x401b1f
push str.Unable_to_open_file_for_writing.
push 0x4235d8
call fcn.00404dd0
add esp, 8
mov esi, eax
push 0xa
mov ecx, esi
call fcn.00402780
mov ecx, dword [esi]
mov eax, dword [ecx + 4]
mov ecx, dword [eax + esi + 0xc]
xor edi, edi
test cl, 6
jne 0x401a94
mov eax, dword [eax + esi + 0x38]
mov edx, dword [eax]
mov ecx, eax
mov eax, dword [edx + 0x34]
call eax
cmp eax, 0xffffffff
jne 0x401a94
mov edi, 4
mov ecx, dword [esi]
mov ecx, dword [ecx + 4]
add ecx, esi
test edi, edi
je 0x401ab5
mov eax, dword [ecx + 0xc]
or eax, edi
cmp dword [ecx + 0x38], 0
jne 0x401aad
or eax, 4
push 0
push eax
call fcn.00401530
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.00402fa0
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.0041329c
add esp, 4
xor al, al
jmp 0x401d5d
test edi, edi
je 0x401c9d
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 0x401c16
mov ecx, dword [ebp - 0x3c]
inc ecx
push ecx
call fcn.00405901
mov ebx, eax
add esp, 4
test ebx, ebx
je 0x401c3a
mov edx, dword [ebp - 0x3c]
inc edx
push edx
push 0
push ebx
call fcn.0040a280
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 0x401be7
push str.Error_in_WinHttpReadData.
push 0x4235d8
call fcn.00404dd0
add esp, 8
mov esi, eax
push 0xa
mov ecx, esi
call fcn.00402780
mov eax, dword [esi]
mov eax, dword [eax + 4]
xor edi, edi
test byte [eax + esi + 0xc], 6
jne 0x401bc4
mov eax, dword [eax + esi + 0x38]
mov edx, dword [eax]
mov ecx, eax
mov eax, dword [edx + 0x34]
call eax
cmp eax, 0xffffffff
jne 0x401bc4
mov edi, 4
mov ecx, dword [esi]
mov ecx, dword [ecx + 4]
add ecx, esi
test edi, edi
je 0x401bfe
mov eax, dword [ecx + 0xc]
or eax, edi
cmp dword [ecx + 0x38], 0
jne 0x401bdd
or eax, 4
push 0
push eax
call fcn.00401530
jmp 0x401bfe
mov edx, dword [ebp - 0x48]
push 0
push edx
push ebx
lea eax, [ebp - 0x134]
push eax
call fcn.004028f0
mov byte [ebp - 0x31], 1
push ebx
call fcn.004062a5
add esp, 4
cmp dword [ebp - 0x3c], 0
ja 0x401b27
jmp 0x401c9d
push str.Error_in_WinHttpQueryDataAvailable.
push 0x4235d8
call fcn.00404dd0
add esp, 8
mov esi, eax
push 0xa
mov ecx, esi
call fcn.00402780
mov ecx, dword [esi]
mov eax, dword [ecx + 4]
jmp 0x401c5c
push str.Out_of_memory.
push 0x4235d8
call fcn.00404dd0
add esp, 8
mov esi, eax
push 0xa
mov ecx, esi
call fcn.00402780
mov edx, dword [esi]
mov eax, dword [edx + 4]
xor edi, edi
test byte [eax + esi + 0xc], 6
jne 0x401c7c
mov eax, dword [eax + esi + 0x38]
mov edx, dword [eax]
mov ecx, eax
mov eax, dword [edx + 0x34]
call eax
cmp eax, 0xffffffff
jne 0x401c7c
mov edi, 4
mov ecx, dword [esi]
mov ecx, dword [ecx + 4]
add ecx, esi
test edi, edi
je 0x401c9d
mov eax, dword [ecx + 0xc]
or eax, edi
cmp dword [ecx + 0x38], 0
jne 0x401c95
or eax, 4
push 0
push eax
call fcn.00401530
lea ecx, [ebp - 0x130]
call fcn.00403f30
test eax, eax
jne 0x401cd7
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 0x401ccf
or eax, 4
push 0
push eax
call fcn.00401530
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.00402fa0
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.0041329c
mov eax, dword [ebp - 0x38]
mov esi, dword [sym.imp.WINHTTP.dll_WinHttpCloseHandle]
add esp, 4
test eax, eax
je 0x401d4a
push eax
call esi
mov eax, dword [ebp - 0x40]
test eax, eax
je 0x401d54
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.0040528e
mov esp, ebp
pop ebp
ret