Function at 0x4be800
Capabilities:
Check internet connectivity via wininet
Create http request
Query remote server for available data
Read data from internet
Receive data

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x50cb0e
mov eax, dword fs:[0]
push eax
sub esp, 0x1c
push ebx
push esi
push edi
mov eax, dword [0x54a2f8]
xor eax, ebp
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov dword [ebp - 0x14], edx
mov esi, ecx
push 0
call dword [sym.imp.WININET.dll_InternetAttemptConnect]
test eax, eax
jne 0x4bea71
call fcn.004e9c50
push eax
push 0
call fcn.004f34d0
mov edi, eax
add esp, 8
mov dword [ebp - 0x1c], edi
mov dword [ebp - 4], 0
push 0
push 0
push 0
push 0
push edi
call dword [sym.imp.WININET.dll_InternetOpenW]
mov ebx, eax
mov dword [ebp - 0x20], ebx
test ebx, ebx
je 0x4bea46
test esi, esi
je 0x4be87b
mov dword [esi], ebx
push dword [ebp + 8]
push 0
call fcn.004f34d0
add esp, 8
mov dword [ebp - 0x24], eax
mov byte [ebp - 4], 1
push 0
push 0x80000000
push 0
push 0
push eax
push ebx
call dword [sym.imp.WININET.dll_InternetOpenUrlW]
mov ebx, eax
test ebx, ebx
je 0x4bea20
mov edi, dword [ebp + 0x10]
test edi, edi
je 0x4be943
mov eax, dword [ebp + 0xc]
test eax, eax
je 0x4be8cc
push 0
push 0
push 0
push eax
push ebx
call dword [sym.imp.WININET.dll_InternetSetFilePointer]
lea eax, [ebp - 0x10]
push eax
mov eax, dword [ebp - 0x14]
push edi
push eax
push ebx
call dword [sym.imp.WININET.dll_InternetReadFile]
test eax, eax
je 0x4be91a
mov eax, dword [ebp - 0x10]
test eax, eax
je 0x4be904
xor ecx, ecx
mov esi, 3
cmp eax, edi
push ebx
mov ebx, dword [sym.imp.WININET.dll_InternetCloseHandle]
cmove esi, ecx
call ebx
mov edi, dword [ebp - 0x1c]
jmp 0x4bea2b
push ebx
mov ebx, dword [sym.imp.WININET.dll_InternetCloseHandle]
mov esi, 2
call ebx
mov edi, dword [ebp - 0x1c]
jmp 0x4bea2b
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0x2ef1
mov ecx, 0xc
mov esi, 2
push ebx
mov ebx, dword [sym.imp.WININET.dll_InternetCloseHandle]
cmove esi, ecx
call ebx
mov edi, dword [ebp - 0x1c]
jmp 0x4bea2b
cmp dword [ebp + 0xc], 0
jne 0x4bea0d
xor esi, esi
lea eax, [ebp - 0x10]
push esi
push esi
push eax
push ebx
mov dword [ebp - 0x10], esi
call dword [sym.imp.WININET.dll_InternetQueryDataAvailable]
test eax, eax
je 0x4be9c1
mov eax, dword [ebp - 0x10]
test eax, eax
je 0x4be9f8
push eax
call fcn.00425a0b
mov edi, eax
add esp, 4
mov dword [ebp - 0x28], edi
mov byte [ebp - 4], 2
lea eax, [ebp - 0x18]
push eax
push dword [ebp - 0x10]
push edi
push ebx
call dword [sym.imp.WININET.dll_InternetReadFile]
test eax, eax
je 0x4be9d4
add esi, dword [ebp - 0x18]
mov byte [ebp - 4], 1
test edi, edi
je 0x4be9a7
push edi
call fcn.004259c8
add esp, 4
push 0
push 0
lea eax, [ebp - 0x10]
mov dword [ebp - 0x10], 0
push eax
push ebx
call dword [sym.imp.WININET.dll_InternetQueryDataAvailable]
test eax, eax
jne 0x4be963
push ebx
mov ebx, dword [sym.imp.WININET.dll_InternetCloseHandle]
mov esi, 0xc
call ebx
mov edi, dword [ebp - 0x1c]
jmp 0x4bea2b
mov esi, 0xc
mov byte [ebp - 4], 1
test edi, edi
je 0x4bea12
push edi
call fcn.004259c8
add esp, 4
push ebx
mov ebx, dword [sym.imp.WININET.dll_InternetCloseHandle]
call ebx
mov edi, dword [ebp - 0x1c]
jmp 0x4bea2b
mov eax, dword [ebp - 0x14]
push ebx
mov ebx, dword [sym.imp.WININET.dll_InternetCloseHandle]
mov dword [eax], esi
xor esi, esi
call ebx
mov edi, dword [ebp - 0x1c]
jmp 0x4bea2b
mov esi, 3
push ebx
mov ebx, dword [sym.imp.WININET.dll_InternetCloseHandle]
call ebx
mov edi, dword [ebp - 0x1c]
jmp 0x4bea2b
mov ebx, dword [sym.imp.WININET.dll_InternetCloseHandle]
mov esi, 1
push dword [ebp - 0x20]
call ebx
mov byte [ebp - 4], 0
mov eax, dword [ebp - 0x24]
test eax, eax
je 0x4bea49
push eax
call fcn.004259c8
add esp, 4
jmp 0x4bea49
or esi, 0xffffffff
mov dword [ebp - 4], 0xffffffff
test edi, edi
je 0x4bea5d
push edi
call fcn.004259c8
add esp, 4
mov eax, esi
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
or eax, 0xffffffff
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret