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

Disassembly:
push 0xffffffffffffffff
mov eax, dword fs:[0]
push 0x40b936
push eax
mov eax, reloc.MSVCRT.dll__adjust_fdiv
mov dword fs:[0], esp
call fcn.0040b120
push ebx
push ebp
push esi
push edi
mov ebp, ecx
xor ebx, ebx
lea eax, [esp + 0x38]
push ebx
push eax
mov dword [esp + reloc.MSVCRT.dll___p__fmode], 1
call dword [sym.imp.WININET.dll_InternetGetConnectedState]
call dword [sym.imp.WINMM.dll_timeGetTime]
push eax
lea ecx, [esp + 0x50]
push str.Agent_ld
push ecx
call dword [sym.imp.MSVCRT.dll_sprintf]
mov al, byte [esp + 0x44]
add esp, 0xc
test al, 4
push ebx
push ebx
push ebx
jne 0x4061c8
lea edx, [esp + 0x58]
push 4
push edx
call dword [sym.imp.WININET.dll_InternetOpenA]
mov edi, eax
mov dword [esp + 0x1c], edi
jmp 0x4061da
lea eax, [esp + 0x58]
push ebx
push eax
call dword [sym.imp.WININET.dll_InternetOpenA]
mov dword [esp + 0x1c], eax
mov edi, eax
cmp edi, ebx
jne 0x4061ef
push ebx
push ebx
push str.Internetl
call sub.MFC42.DLL_AfxMessageBox
jmp 0x4063df
mov ecx, dword [str.Accept:___r_n_r_n]
mov edx, dword [0x411a18]
mov eax, dword [0x411a1c]
mov dword [esp + 0x3c], ecx
mov ecx, dword [0x411a20]
mov dword [esp + 0x40], edx
mov dword [esp + 0x48], ecx
lea ecx, [esp + 0x20]
mov dword [esp + 0x44], eax
call sub.MFC42.DLL_CFile::CFile
mov esi, dword [esp + reloc.MSVCRT.dll___p__fmode]
push ebx
lea edx, [esp + 0x40]
push 0x84000100
push edx
mov byte [esp + 0x100a0], 2
call dword [sym.imp.KERNEL32.dll_lstrlenA]
push eax
lea eax, [esp + 0x48]
push eax
push esi
push edi
call dword [sym.imp.WININET.dll_InternetOpenUrlA]
mov esi, eax
push ebx
cmp esi, ebx
mov dword [esp + 0x38], esi
jne 0x406268
push ebx
push 0x411a04
call sub.MFC42.DLL_AfxMessageBox
jmp 0x4063ce
mov ecx, dword [esp + 0x100a4]
push 0x1001
push ecx
lea ecx, [esp + 0x2c]
call sub.MFC42.DLL_CFile::Open
test eax, eax
jne 0x406293
push ebx
push ebx
push 0x4119f0
call sub.MFC42.DLL_AfxMessageBox
jmp 0x4063ce
lea edx, [esp + 0x30]
push ebx
lea eax, [esp + 0x14]
push edx
push eax
push 0x20000005
push esi
mov dword [esp + 0x24], ebx
mov dword [esp + 0x44], 4
xor edi, edi
call dword [sym.imp.WININET.dll_HttpQueryInfoA]
test eax, eax
jne 0x4062c0
mov dword [esp + 0x10], ebx
lea ecx, [esp + 0x14]
call sub.MFC42.DLL_CString::CString
mov ecx, dword [ebp + 0x8c]
push 0x64
push ebx
mov ebx, dword [sym.imp.USER32.dll_SendMessageA]
push 0x406
push ecx
mov byte [esp + __set_app_type], 3
call ebx
lea edx, [esp + 0x18]
lea eax, [esp + 0x8c]
push edx
push 0x4000
push eax
push esi
call dword [sym.imp.WININET.dll_InternetReadFile]
test eax, eax
je 0x4063a6
mov eax, dword [esp + 0x18]
test eax, eax
je 0x40640f
lea ecx, [esp + 0x8c]
push eax
push ecx
lea ecx, [esp + 0x28]
call sub.MFC42.DLL_CFile::Write
mov ecx, dword [esp + 0x18]
add edi, ecx
mov ecx, dword [esp + 0x10]
test ecx, ecx
je 0x406385
lea eax, [edi + edi*4]
xor edx, edx
push 0
lea esi, [eax + eax*4]
shl esi, 2
mov eax, esi
div ecx
mov edx, dword [ebp + 0x8c]
push eax
push 0x402
push edx
call ebx
mov eax, esi
xor edx, edx
div dword [esp + 0x10]
push eax
lea eax, [esp + 0x18]
push str._d__
push eax
call sub.MFC42.DLL_CString::Format
mov ecx, dword [esp + 0x20]
add esp, 0xc
push ecx
push 0x402
mov ecx, ebp
call sub.MFC42.DLL_CWnd::SetDlgItemTextA
mov esi, dword [esp + 0x34]
lea edx, [esp + 0x18]
lea eax, [esp + 0x8c]
push edx
push 0x4000
push eax
push esi
call dword [sym.imp.WININET.dll_InternetReadFile]
test eax, eax
jne 0x406309
push 0
push 0
push 0x4119dc
call sub.MFC42.DLL_AfxMessageBox
lea ecx, [esp + 0x20]
call sub.MFC42.DLL_CFile::Close
lea ecx, [esp + 0x14]
mov byte [esp + 0x10094], 2
call fcn.0040ad9c
lea ecx, [esp + 0x20]
mov byte [esp + 0x10094], 1
call fcn.0040af04
lea ecx, [esp + reloc.MSVCRT.dll___p__fmode]
mov byte [esp + 0x10094], 0
call fcn.0040ad9c
lea ecx, [esp + 0x100a0]
mov dword [esp + __p__fmode], 0xffffffff
call fcn.0040ad9c
or eax, 0xffffffff
jmp 0x40647a
push 0xa
call dword [sym.imp.KERNEL32.dll_Sleep]
lea ecx, [esp + 0x20]
call sub.MFC42.DLL_CFile::Close
mov ecx, dword [esp + 0x1c]
push ecx
call dword [sym.imp.WININET.dll_InternetCloseHandle]
lea ecx, [esp + 0x14]
mov byte [esp + 0x10094], 2
call fcn.0040ad9c
lea ecx, [esp + 0x20]
mov byte [esp + 0x10094], 1
call fcn.0040af04
lea ecx, [esp + reloc.MSVCRT.dll___p__fmode]
mov byte [esp + 0x10094], 0
call fcn.0040ad9c
lea ecx, [esp + 0x100a0]
mov dword [esp + __p__fmode], 0xffffffff
call fcn.0040ad9c
xor eax, eax
mov ecx, dword [esp + reloc.MSVCRT.dll___p__commode]
pop edi
pop esi
pop ebp
pop ebx
mov dword fs:[0], ecx
add esp, 0x10088
ret 8