Function at 0x402860
Capabilities:
Act as tcp client
Check internet connectivity via wininet
Connect socket
Connect tcp socket
Create http request
Create tcp socket
Query remote server for available data
Read data from internet
Receive data

Disassembly:
sub esp, 0x4d4
mov eax, dword [section..data]
xor eax, esp
mov dword [esp + 0x4cc], eax
push ebx
push ebp
push esi
push edi
push 0x406448
xor ebp, ebp
push 0x4105cc
mov dword [esp + 0x24], ebp
call fcn.00401d80
add esp, 8
test eax, eax
jne 0x40289b
xor eax, eax
jmp 0x402b4f
movzx ecx, word [0x4105cc]
mov eax, 2
push ecx
mov word [0x406444], ax
call dword [sym.imp.WS2_32.dll_htons]
mov word [0x406446], ax
call fcn.00402530
test eax, eax
je 0x402894
push ebp
call dword [sym.imp.WININET.dll_InternetAttemptConnect]
test eax, eax
jne 0x402b4a
push ebp
push 1
push 0x406878
call dword [sym.imp.WININET.dll_InternetCheckConnectionA]
test eax, eax
je 0x402b4a
push ebp
push ebp
push ebp
push 1
push ebp
call dword [sym.imp.WININET.dll_InternetOpenA]
mov esi, eax
mov dword [esp + 0x18], esi
cmp esi, ebp
je 0x402b4a
push ebp
push connect
push ebp
push ebp
push 0x406878
push esi
call dword [sym.imp.WININET.dll_InternetOpenUrlA]
mov edi, eax
mov dword [esp + 0x20], edi
cmp edi, ebp
je 0x402b3a
push ebp
push ebp
lea edx, [esp + 0x2c]
push edx
push edi
call dword [sym.imp.WININET.dll_InternetQueryDataAvailable]
test eax, eax
je 0x402b3a
push 0x1f4
lea eax, [esp + 0x2c]
push ebp
push eax
call sub.MSVCR90.dll_memset
add esp, 0xc
lea ecx, [esp + 0x14]
push ecx
push 0x1f4
lea edx, [esp + 0x288]
push edx
push edi
call dword [sym.imp.WININET.dll_InternetReadFile]
test eax, eax
je 0x402b26
mov esi, dword [esp + 0x14]
cmp esi, ebp
jbe 0x402b26
push 0x1f4
lea eax, [esp + 0x2c]
push ebp
push eax
call sub.MSVCR90.dll_memset
mov ecx, dword [esp + 0x28]
add esi, ecx
push esi
lea edx, [esp + 0x290]
push edx
lea eax, [esp + 0x3c]
push eax
call sub.MSVCR90.dll_memcpy
lea ebx, [esp + 0x40]
mov ecx, ebx
push ecx
call dword [sym.imp.MSVCR90.dll_atoi]
mov esi, eax
add esp, 0x1c
cmp esi, ebp
jle 0x402ac6
lea ecx, [ecx]
xor edi, edi
mov eax, dword [edi*4 + 0x406980]
cmp eax, ebp
je 0x4029de
cmp eax, esi
je 0x402a86
inc edi
cmp edi, 0x2710
jl 0x4029c2
cmp dword [0x4105d0], ebp
jne 0x402a21
push 6
push 1
push 2
call dword [sym.imp.WS2_32.dll_socket]
mov dword [0x4105d0], eax
cmp eax, 0xffffffff
je 0x402a1b
push 0x10
push 0x406444
push eax
call dword [sym.imp.WS2_32.dll_connect]
test eax, eax
je 0x402a21
mov edx, dword [0x4105d0]
push edx
call dword [sym.imp.WS2_32.dll_closesocket]
mov dword [0x4105d0], ebp
mov eax, dword [0x4105d4]
push ebp
push 0x12c
push 1
push eax
mov dword [edi*4 + 0x406980], esi
call dword [sym.imp.USER32.dll_SetTimer]
mov ecx, dword [0x406454]
push 0x4000d
push ecx
push 0x8c
mov dword [0x4105c0], eax
call dword [sym.imp.WINMM.dll_PlaySoundA]
mov ecx, dword [esp + 0x18]
push esi
call fcn.004026d0
mov eax, dword [0x4105d0]
add esp, 4
cmp eax, ebp
je 0x402a75
push eax
call dword [sym.imp.WS2_32.dll_closesocket]
push 0x1f4
mov dword [0x4105d0], ebp
call dword [sym.imp.KERNEL32.dll_Sleep]
push 0x4044c0
push ebx
call dword [sym.imp.MSVCR90.dll_strstr]
add esp, 8
cmp eax, ebp
je 0x402ac2
lea edi, [eax + 2]
push edi
call dword [sym.imp.MSVCR90.dll_atoi]
mov ebx, edi
push 0x4044c0
push ebx
mov esi, eax
call dword [sym.imp.MSVCR90.dll_strstr]
add esp, 0xc
test eax, eax
je 0x402ac2
cmp esi, ebp
jg 0x4029c0
mov edi, dword [esp + 0x20]
mov edx, dword [esp + 0x14]
mov esi, dword [esp + 0x1c]
sub edx, ebx
lea eax, [esp + edx + 0x28]
add esi, eax
mov dword [esp + 0x1c], esi
js 0x402b26
push 0x1f4
lea ecx, [esp + 0x284]
push ebp
push ecx
call sub.MSVCR90.dll_memset
push esi
lea edx, [esp + 0x290]
push ebx
push edx
call sub.MSVCR90.dll_memcpy
add esp, 0x18
lea eax, [esp + 0x14]
push eax
push 0x1f4
lea ecx, [esp + esi + 0x288]
push ecx
push edi
mov dword [esp + 0x24], ebp
call dword [sym.imp.WININET.dll_InternetReadFile]
test eax, eax
jne 0x40296e
mov eax, dword [0x4105d0]
cmp eax, ebp
je 0x402b36
push eax
call dword [sym.imp.WS2_32.dll_closesocket]
mov esi, dword [esp + 0x18]
push esi
mov esi, dword [sym.imp.WININET.dll_InternetCloseHandle]
call esi
cmp edi, ebp
je 0x402b4a
push edi
call esi
mov eax, 1
mov ecx, dword [esp + 0x4dc]
pop edi
pop esi
pop ebp
pop ebx
xor ecx, esp
call fcn.00402d9c
add esp, 0x4d4
ret