Function at 0x4a5882
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
mov eax, 0x1068
call fcn.004c3350
push ebx
push esi
xor esi, esi
push edi
mov ebx, ecx
lea eax, [ebp - 0x18]
push esi
push eax
mov dword [ebx + 0x14], esi
mov dword [ebp - 0x18], esi
call dword [sym.imp.WININET.dll_InternetGetConnectedState]
test byte [ebp - 0x18], 0x20
je 0x4a58be
mov eax, dword [ebx + 4]
cmp eax, esi
je 0x4a591e
push 5
pop ecx
mov dword [ebx + 0x18], ecx
push 1
jmp 0x4a5915
and byte [ebp - 0x68], 0
push 7
pop ecx
xor eax, eax
lea edi, [ebp - 0x67]
rep stosd dword es:[edi], eax
stosw word es:[edi], ax
stosb byte es:[edi], al
call dword [sym.imp.KERNEL32.dll_GetTickCount]
push eax
lea eax, [ebp - 0x68]
push str.Agent_X
push eax
call fcn.004c1941
add esp, 0xc
test byte [ebp - 0x18], 4
push esi
push esi
push esi
jne 0x4a58f4
push 4
jmp 0x4a58f5
push esi
lea eax, [ebp - 0x68]
push eax
call dword [sym.imp.WININET.dll_InternetOpenA]
cmp eax, esi
mov dword [ebp - 0x10], eax
jne 0x4a5925
mov eax, dword [ebx + 4]
cmp eax, esi
je 0x4a591e
push 5
pop ecx
mov dword [ebx + 0x18], ecx
push 2
push ecx
push dword [ebx + 0xc]
call eax
add esp, 0xc
xor eax, eax
jmp 0x4a5b46
mov eax, dword [ebx + 4]
mov dword [ebp - 0xc], 2
cmp eax, esi
je 0x4a5946
push 1
lea edx, [ebx + 0x20]
pop ecx
push edx
push ecx
push dword [ebx + 0xc]
mov dword [ebx + 0x18], ecx
call eax
add esp, 0xc
mov esi, str.Accept:___r_n_r_n
lea edi, [ebp - 0x48]
movsd dword es:[edi], dword [esi]
movsd dword es:[edi], dword [esi]
movsd dword es:[edi], dword [esi]
and byte [ebp - 0x1068], 0
mov ecx, 0x3ff
movsd dword es:[edi], dword [esi]
xor eax, eax
lea edi, [ebp - 0x1067]
rep stosd dword es:[edi], eax
stosw word es:[edi], ax
xor esi, esi
stosb byte es:[edi], al
push esi
lea eax, [ebp - 0x48]
push 0x84000100
push eax
call fcn.004c2130
pop ecx
push eax
lea eax, [ebp - 0x48]
push eax
push esi
lea ecx, [ebx + 0x20]
call fcn.004db242
push eax
push dword [ebp - 0x10]
call dword [sym.imp.WININET.dll_InternetOpenUrlA]
cmp eax, esi
mov dword [ebp - 0x14], eax
je 0x4a5ad8
lea ecx, [ebp - 0x24]
push esi
push ecx
lea ecx, [ebp - 8]
push ecx
push 0x20000005
push eax
mov dword [ebp - 8], esi
mov dword [ebp - 0x24], 4
call dword [sym.imp.WININET.dll_HttpQueryInfoA]
test eax, eax
jne 0x4a59c6
mov dword [ebp - 8], esi
mov eax, dword [ebx + 4]
push 2
pop ecx
cmp eax, esi
mov dword [ebx + 0x18], ecx
je 0x4a59e7
push dword [ebp - 8]
push ecx
push dword [ebx + 0xc]
call eax
add esp, 0xc
test eax, eax
je 0x4a5af0
mov edi, dword [sym.imp.WINMM.dll_timeGetTime]
mov dword [ebx + 0x18], 3
call edi
mov dword [ebp - 0x1c], eax
cmp dword [ebx + 8], esi
je 0x4a5abd
lea eax, [ebp - 4]
mov dword [ebp - 4], esi
push eax
lea eax, [ebp - 0x1068]
push 0x1000
push eax
push dword [ebp - 0x14]
call dword [sym.imp.WININET.dll_InternetReadFile]
test eax, eax
je 0x4a5ac6
mov eax, dword [ebp - 4]
cmp eax, esi
je 0x4a5ad3
add dword [ebx + 0x14], eax
cmp dword [ebx + 0x10], esi
je 0x4a5a7a
push 8
call fcn.004db3f6
cmp eax, esi
pop ecx
je 0x4a5a4c
mov dword [eax], esi
mov dword [eax + 4], esi
mov esi, eax
mov eax, dword [ebp - 4]
mov dword [esi], eax
push dword [ebp - 4]
call fcn.004db3f6
mov dword [esi + 4], eax
push dword [ebp - 4]
lea ecx, [ebp - 0x1068]
push ecx
push eax
call fcn.004c14d0
add esp, 0x10
lea ecx, [ebx + 0x24]
push esi
call fcn.004d5033
xor esi, esi
cmp dword [ebx + 4], esi
je 0x4a59f9
call edi
sub eax, dword [ebp - 0x1c]
mov dword [ebp - 0x38], eax
mov eax, dword [ebp - 4]
mov dword [ebp - 0x2c], eax
lea eax, [ebp - 0x1068]
mov dword [ebp - 0x28], eax
mov eax, dword [ebx + 0x14]
mov dword [ebp - 0x30], eax
mov eax, dword [ebp - 8]
mov dword [ebp - 0x34], eax
lea eax, [ebp - 0x38]
push eax
push 3
push dword [ebx + 0xc]
call dword [ebx + 4]
add esp, 0xc
test eax, eax
jne 0x4a59f9
mov dword [ebp - 0xc], 1
jmp 0x4a5af0
mov eax, dword [ebx + 4]
cmp eax, esi
je 0x4a5af0
push 4
push 5
jmp 0x4a5ae8
mov dword [ebp - 0xc], esi
jmp 0x4a5af0
mov eax, dword [ebx + 4]
cmp eax, esi
je 0x4a5af0
push 5
pop ecx
push 3
mov dword [ebx + 0x18], ecx
push ecx
push dword [ebx + 0xc]
call eax
add esp, 0xc
mov ecx, dword [ebp - 0xc]
push 4
pop edx
cmp ecx, esi
mov dword [ebx + 0x18], edx
je 0x4a5b04
mov dword [ebx + 0x18], 5
mov eax, dword [ebx + 4]
cmp eax, esi
je 0x4a5b21
mov edi, dword [ebx + 0x14]
mov dword [ebp - 0x1c], ecx
lea ecx, [ebp - 0x20]
mov dword [ebp - 0x20], edi
push ecx
push edx
push dword [ebx + 0xc]
call eax
add esp, 0xc
cmp dword [ebp - 0x14], esi
mov esi, dword [sym.imp.WININET.dll_InternetCloseHandle]
je 0x4a5b31
push dword [ebp - 0x14]
call esi
push dword [ebp - 0x10]
call esi
push dword [ebx + 0x1c]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
and dword [ebx + 0x1c], 0
push 1
pop eax
pop edi
pop esi
pop ebx
leave
ret