Function at 0x40c150
Capabilities:
Create http request
Get http content length
Read data from internet
Receive data
Reference http user-agent string
Set file attributes

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x447938
mov eax, dword fs:[0]
push eax
sub esp, 0x4cc
mov eax, dword [0x45f080]
xor eax, ebp
mov dword [ebp - 0x10], eax
push ebx
push esi
push edi
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov byte [ebp - 0x4d1], dl
mov esi, ecx
push 0
push 0
push 0x402
mov dword [ebp - 4], 0
push dword [0x46143c]
call dword [sym.imp.USER32.dll_SendMessageW]
push 0
push 0
push 0
push 1
push str.Mozilla_5.0
call dword [sym.imp.WININET.dll_InternetOpenW]
mov edi, eax
test edi, edi
je 0x40c1f7
push 4
lea eax, [ebp - 0x41c]
mov dword [ebp - 0x41c], 0x1388
push eax
push 2
push edi
call dword [sym.imp.WININET.dll_InternetSetOptionW]
push 0
push 0x80000000
push 0
push 0
push esi
push edi
call dword [sym.imp.WININET.dll_InternetOpenUrlW]
mov esi, eax
test esi, esi
jne 0x40c236
push edi
call dword [sym.imp.WININET.dll_InternetCloseHandle]
xor bl, bl
mov ecx, dword [ebp + 0x1c]
cmp ecx, 7
jbe 0x40c46a
mov edx, dword [ebp + 8]
lea ecx, [ecx*2 + 2]
mov eax, edx
cmp ecx, 0x1000
jb 0x40c460
mov edx, dword [eax - 4]
add ecx, 0x23
sub eax, edx
add eax, 0xfffffffc
cmp eax, 0x1f
ja 0x40c488
jmp 0x40c460
xor ebx, ebx
mov dword [ebp - 0x420], 4
push ebx
lea eax, [ebp - 0x420]
mov dword [ebp - 0x418], ebx
push eax
lea eax, [ebp - 0x418]
push eax
push 0x20000005
push esi
call dword [sym.imp.WININET.dll_HttpQueryInfoW]
push 0xb0
lea eax, [ebp - 0x4d0]
push ebx
push eax
call fcn.004292c0
add esp, 4
lea eax, [ebp + 8]
lea ecx, [ebp - 0x4d0]
push 0x20
push eax
call fcn.0040d560
mov byte [ebp - 4], 1
cmp byte [ebp - 0x4d1], bl
je 0x40c2b4
push 2
sub esp, 0x18
lea eax, [ebp + 8]
mov ecx, esp
push eax
call fcn.0040a410
call fcn.00425ba0
add esp, 0x18
push eax
call dword [sym.imp.KERNEL32.dll_SetFileAttributesW]
mov eax, dword [ebp - 0x4d0]
mov eax, dword [eax + 4]
test byte [ebp + eax - 0x4c4], 6
je 0x40c2da
push esi
mov esi, dword [sym.imp.WININET.dll_InternetCloseHandle]
call esi
push edi
call esi
xor bl, bl
jmp 0x40c3e5
lea eax, [ebp - 0x414]
push eax
push 0x400
lea eax, [ebp - 0x410]
push eax
push esi
call dword [sym.imp.WININET.dll_InternetReadFile]
test eax, eax
je 0x40c39f
nop dword [eax]
mov eax, dword [ebp - 0x414]
test eax, eax
je 0x40c39f
push 0
push eax
lea eax, [ebp - 0x410]
push eax
lea ecx, [ebp - 0x4d0]
call fcn.0040d680
add ebx, dword [ebp - 0x414]
mov eax, ebx
shr eax, 0x1f
push 0
movd xmm1, ebx
cvtdq2pd xmm1, xmm1
addsd xmm1, qword [eax*8 + 0x458c10]
mov eax, dword [ebp - 0x418]
movd xmm0, eax
cvtdq2pd xmm0, xmm0
shr eax, 0x1f
addsd xmm0, qword [eax*8 + 0x458c10]
divsd xmm1, xmm0
mulsd xmm1, qword [0x458bb8]
cvttsd2si eax, xmm1
push eax
push 0x402
push dword [0x46143c]
call dword [sym.imp.USER32.dll_SendMessageW]
lea eax, [ebp - 0x414]
push eax
push 0x400
lea eax, [ebp - 0x410]
push eax
push esi
call dword [sym.imp.WININET.dll_InternetReadFile]
test eax, eax
jne 0x40c300
lea ecx, [ebp - 0x4cc]
call fcn.0040de90
test eax, eax
jne 0x40c3d7
mov eax, dword [ebp - 0x4d0]
lea ecx, [ebp - 0x4d0]
push 0
add ecx, dword [eax + 4]
xor eax, eax
cmp dword [ecx + 0x38], eax
sete al
lea eax, [eax*4 + 2]
or eax, dword [ecx + 0xc]
push eax
call fcn.0040bd80
push esi
mov esi, dword [sym.imp.WININET.dll_InternetCloseHandle]
call esi
push edi
call esi
mov bl, 1
mov eax, dword [ebp - 0x4d0]
mov eax, dword [eax + 4]
mov dword [ebp + eax - method.std::basic_ofstream_char__struct_std::char_traits_char__.virtual_0], vtable.std::basic_ofstream_char__struct_std::char_traits_char__.0
mov eax, dword [ebp - 0x4d0]
mov ecx, dword [eax + 4]
lea eax, [ecx - 0x68]
mov dword [ebp + ecx - 0x4d4], eax
lea ecx, [ebp - 0x4cc]
call fcn.0040d1f0
mov eax, dword [ebp - 0x4d0]
mov eax, dword [eax + 4]
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
mov eax, dword [ebp - 0x4d0]
mov ecx, dword [eax + 4]
lea eax, [ecx - 8]
mov dword [ebp + ecx - 0x4d4], eax
lea eax, [ebp - 0x468]
mov byte [ebp - 4], 3
push eax
mov dword [ebp - method.std::ios_base.virtual_0], vtable.std::ios_base.0
call fcn.00426e17
add esp, 4
jmp 0x40c1f9
push ecx
push edx
call fcn.004275d6
add esp, 8
mov al, bl
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 0x10]
xor ecx, ebp
call fcn.00427598
mov esp, ebp
pop ebp
ret
call fcn.0042c34f
int3