Function at 0x40ced0
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 0x4cb1e4
mov eax, dword fs:[0]
push eax
mov eax, 0x108c
call fcn.004af800
mov eax, dword [0x4f96c0]
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.004018d0
test byte [ebp - 0x1090], 4
push 0
push 0
push 0
jne 0x40cf83
push 4
jmp 0x40cf85
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 0x40d171
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 0x40cfb0
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 0x40cfea
push ebx
call dword [sym.imp.WININET.dll_InternetCloseHandle]
jmp 0x40d171
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.004ad1e0
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 0x40d165
lea esp, [esp]
cmp dword [ebp - 0x1088], 0
je 0x40d212
cmp byte [ebp - 0x1020], 0
mov dword [ebp - 0x1054], 0xf
mov dword [ebp - 0x1058], 0
mov byte [ebp - 0x1068], 0
jne 0x40d0b5
xor ecx, ecx
jmp 0x40d0c9
lea ecx, [ebp - 0x1020]
lea edx, [ecx + 1]
mov edi, edi
mov al, byte [ecx]
inc ecx
test al, al
jne 0x40d0c0
sub ecx, edx
push ecx
lea eax, [ebp - 0x1020]
push eax
lea ecx, [ebp - 0x1068]
call fcn.004018d0
mov byte [ebp - 4], 4
cmp byte [ebp - 0x1020], 0
jne 0x40d0ed
xor ecx, ecx
jmp 0x40d0ff
lea ecx, [ebp - 0x1020]
lea edx, [ecx + 1]
mov al, byte [ecx]
inc ecx
test al, al
jne 0x40d0f6
sub ecx, edx
push ecx
lea eax, [ebp - 0x1020]
push eax
lea ecx, [ebp - 0x1050]
call fcn.004018d0
mov byte [ebp - 4], 3
cmp dword [ebp - 0x1054], 0x10
jb 0x40d12d
push dword [ebp - 0x1068]
call fcn.004a8256
add esp, 4
push 0x1000
lea eax, [ebp - 0x1020]
push 0
push eax
call fcn.004ad1e0
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 0x40d080
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.004021d0
cmp dword [ebp - 0x103c], 0x10
jb 0x40d196
push dword [ebp - 0x1050]
call fcn.004a8256
add esp, 4
cmp dword [ebp - 0x1024], 0x10
mov byte [ebp - 0x1050], 0
mov dword [ebp - 0x1040], 0
mov dword [ebp - 0x103c], 0xf
jb 0x40d1c8
push dword [ebp - 0x1038]
call fcn.004a8256
add esp, 4
cmp dword [ebp + 0x1c], 0x10
mov byte [ebp - 0x1038], 0
mov dword [ebp - 0x1028], 0
mov dword [ebp - 0x1024], 0xf
jb 0x40d1f4
push dword [ebp + 8]
call fcn.004a8256
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.004a79be
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 0x40d177