Function at 0x40c490
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 0x448358
mov eax, dword fs:[0]
push eax
sub esp, 0x4cc
mov eax, dword [0x460080]
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 [0x46243c]
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 0x40c537
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 0x40c576
push edi
call dword [sym.imp.WININET.dll_InternetCloseHandle]
xor bl, bl
mov ecx, dword [ebp + 0x1c]
cmp ecx, 7
jbe 0x40c7aa
mov edx, dword [ebp + 8]
lea ecx, [ecx*2 + 2]
mov eax, edx
cmp ecx, 0x1000
jb 0x40c7a0
mov edx, dword [eax - 4]
add ecx, 0x23
sub eax, edx
add eax, 0xfffffffc
cmp eax, 0x1f
ja 0x40c7c8
jmp 0x40c7a0
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.00429ed0
add esp, 4
lea eax, [ebp + 8]
lea ecx, [ebp - 0x4d0]
push 0x20
push eax
call fcn.0040d8a0
mov byte [ebp - 4], 1
cmp byte [ebp - 0x4d1], bl
je 0x40c5f4
push 2
sub esp, 0x18
lea eax, [ebp + 8]
mov ecx, esp
push eax
call fcn.0040a750
call fcn.004267b0
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 0x40c61a
push esi
mov esi, dword [sym.imp.WININET.dll_InternetCloseHandle]
call esi
push edi
call esi
xor bl, bl
jmp 0x40c725
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 0x40c6df
nop dword [eax]
mov eax, dword [ebp - 0x414]
test eax, eax
je 0x40c6df
push 0
push eax
lea eax, [ebp - 0x410]
push eax
lea ecx, [ebp - 0x4d0]
call fcn.0040d9c0
add ebx, dword [ebp - 0x414]
mov eax, ebx
shr eax, 0x1f
push 0
movd xmm1, ebx
cvtdq2pd xmm1, xmm1
addsd xmm1, qword [eax*8 + 0x459c80]
mov eax, dword [ebp - 0x418]
movd xmm0, eax
cvtdq2pd xmm0, xmm0
shr eax, 0x1f
addsd xmm0, qword [eax*8 + 0x459c80]
divsd xmm1, xmm0
mulsd xmm1, qword [0x459c28]
cvttsd2si eax, xmm1
push eax
push 0x402
push dword [0x46243c]
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 0x40c640
lea ecx, [ebp - 0x4cc]
call fcn.0040e1d0
test eax, eax
jne 0x40c717
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.0040c0c0
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.0040d530
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.00427a28
add esp, 4
jmp 0x40c539
push ecx
push edx
call fcn.004281e7
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.004281a9
mov esp, ebp
pop ebp
ret
call fcn.0042cf5f
int3