Function at 0x40af40
Capabilities:
Check internet connectivity via wininet
Create http request
Get http content length
Read data from internet
Receive data

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x47d934
mov eax, dword fs:[0]
push eax
mov eax, 0x108c
call fcn.0046b6b0
mov eax, dword [0x49c4b0]
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 edi, ecx
mov dword [ebp - 0x1094], 0
push 0
lea eax, [ebp - 0x1090]
mov dword [ebp - 4], 0
push eax
call dword [sym.imp.WININET.dll_InternetGetConnectedState]
mov dword [ebp - 0x1024], 0xf
mov dword [ebp - 0x1028], 0
mov byte [ebp - 0x1038], 0
mov dword [ebp - 0x103c], 0xf
mov dword [ebp - 0x1040], 0
mov byte [ebp - 0x1050], 0
push 5
push str.Error
lea ecx, [ebp - 0x1038]
mov byte [ebp - 4], 2
call fcn.00406930
test byte [ebp - 0x1090], 4
push 0
push 0
push 0
jne 0x40aff3
push 4
jmp 0x40aff5
push 0
push str.User_Agent:_Mozilla_4.0__compatible__MSIE_7.0__Windows_NT_6.1__IEClient__Trident_7.0__SLCC2__.NET_CLR_2.0.50727__.NET_CLR_3.5.30729__.NET_CLR_3.0.30729__.NET4.0C__.NET4.0E_
call dword [sym.imp.WININET.dll_InternetOpenW]
mov ebx, eax
test ebx, ebx
je 0x40b1e1
movdqu xmm0, xmmword [str.Accept:___r_n_r_n]
lea ecx, [ebp - 0x20]
lea edx, [ecx + 1]
movdqu xmmword [ebp - 0x20], xmm0
lea ecx, [ecx]
mov al, byte [ecx]
inc ecx
test al, al
jne 0x40b020
push 0
push 0x84000100
sub ecx, edx
lea eax, [ebp + 8]
cmp dword [ebp + 0x1c], 0x10
push ecx
cmovae eax, dword [ebp + 8]
lea ecx, [ebp - 0x20]
push ecx
push eax
push ebx
call dword [sym.imp.WININET.dll_InternetOpenUrlA]
mov esi, eax
test esi, esi
jne 0x40b05a
push ebx
call dword [sym.imp.WININET.dll_InternetCloseHandle]
jmp 0x40b1e1
xor eax, eax
mov dword [ebp - 0x1084], 0
mov dword [ebp - 0x108c], 4
mov dword [ebp - 0x106c], 7
mov dword [ebp - 0x1070], 0
mov word [ebp - 0x1080], ax
push eax
lea eax, [ebp - 0x108c]
mov byte [ebp - 4], 3
push eax
lea eax, [ebp - 0x1084]
push eax
push 0x20000005
push esi
call dword [sym.imp.WININET.dll_HttpQueryInfoW]
neg eax
push 0x1000
sbb eax, eax
and dword [ebp - 0x1084], eax
lea eax, [ebp - 0x1020]
push 0
push eax
call fcn.00463310
add esp, 0xc
lea eax, [ebp - 0x1088]
push eax
push 0x400
lea eax, [ebp - 0x1020]
push eax
push esi
call dword [sym.imp.WININET.dll_InternetReadFile]
test eax, eax
je 0x40b1d5
lea esp, [esp]
cmp dword [ebp - 0x1088], 0
je 0x40b282
cmp byte [ebp - 0x1020], 0
mov dword [ebp - 0x1054], 0xf
mov dword [ebp - 0x1058], 0
mov byte [ebp - 0x1068], 0
jne 0x40b125
xor ecx, ecx
jmp 0x40b139
lea ecx, [ebp - 0x1020]
lea edx, [ecx + 1]
mov edi, edi
mov al, byte [ecx]
inc ecx
test al, al
jne 0x40b130
sub ecx, edx
push ecx
lea eax, [ebp - 0x1020]
push eax
lea ecx, [ebp - 0x1068]
call fcn.00406930
mov byte [ebp - 4], 4
cmp byte [ebp - 0x1020], 0
jne 0x40b15d
xor ecx, ecx
jmp 0x40b16f
lea ecx, [ebp - 0x1020]
lea edx, [ecx + 1]
mov al, byte [ecx]
inc ecx
test al, al
jne 0x40b166
sub ecx, edx
push ecx
lea eax, [ebp - 0x1020]
push eax
lea ecx, [ebp - 0x1050]
call fcn.00406930
mov byte [ebp - 4], 3
cmp dword [ebp - 0x1054], 0x10
jb 0x40b19d
push dword [ebp - 0x1068]
call fcn.0045eb11
add esp, 4
push 0x1000
lea eax, [ebp - 0x1020]
push 0
push eax
call fcn.00463310
add esp, 0xc
lea eax, [ebp - 0x1088]
push eax
push 0x400
lea eax, [ebp - 0x1020]
push eax
push esi
call dword [sym.imp.WININET.dll_InternetReadFile]
test eax, eax
jne 0x40b0f0
push esi
mov esi, dword [sym.imp.WININET.dll_InternetCloseHandle]
call esi
push ebx
call esi
lea eax, [ebp - 0x1038]
push eax
mov ecx, edi
call fcn.00406b40
cmp dword [ebp - 0x103c], 0x10
jb 0x40b206
push dword [ebp - 0x1050]
call fcn.0045eb11
add esp, 4
cmp dword [ebp - 0x1024], 0x10
mov byte [ebp - 0x1050], 0
mov dword [ebp - 0x1040], 0
mov dword [ebp - 0x103c], 0xf
jb 0x40b238
push dword [ebp - 0x1038]
call fcn.0045eb11
add esp, 4
cmp dword [ebp + 0x1c], 0x10
mov byte [ebp - 0x1038], 0
mov dword [ebp - 0x1028], 0
mov dword [ebp - 0x1024], 0xf
jb 0x40b264
push dword [ebp + 8]
call fcn.0045eb11
add esp, 4
mov eax, edi
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.0045eb02
mov esp, ebp
pop ebp
ret
push esi
mov esi, dword [sym.imp.WININET.dll_InternetCloseHandle]
call esi
push ebx
call esi
lea eax, [ebp - 0x1050]
jmp 0x40b1e7