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

Disassembly:
push 0xffffffffffffffff
mov eax, dword fs:[0]
push 0x404b26
push eax
mov eax, 0x1007c
mov dword fs:[0], esp
call fcn.004047a0
push ebx
push ebp
push esi
push edi
mov esi, ecx
mov ebp, dword [sym.imp.KERNEL32.dll_OutputDebugStringA]
push 0x407164
mov dword [esp + 0x10098], 1
call ebp
mov ecx, dword [esi + 0x20]
push 0x3e8
call sub.MFC42.DLL_CWnd::GetDlgItem
mov dword [esi + 0xc4], eax
lea eax, [esp + 0x34]
push 0
push eax
call dword [sym.imp.WININET.dll_InternetGetConnectedState]
mov ecx, 0x10
xor eax, eax
lea edi, [esp + 0x4c]
rep stosd dword es:[edi], eax
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 + 0x40]
add esp, 0xc
test al, 4
push 0
push 0
push 0
jne 0x401847
lea edx, [esp + 0x58]
push 4
push edx
call dword [sym.imp.WININET.dll_InternetOpenA]
mov edi, eax
mov dword [esp + 0x1c], edi
jmp 0x40185a
lea eax, [esp + 0x58]
push 0
push eax
call dword [sym.imp.WININET.dll_InternetOpenA]
mov dword [esp + 0x1c], eax
mov edi, eax
test edi, edi
je 0x401b3d
mov ecx, dword [str.Accept:___r_n_r_n]
mov edx, dword [0x40714c]
mov eax, dword [0x407150]
mov dword [esp + 0x3c], ecx
mov ecx, dword [0x407154]
mov dword [esp + 0x40], edx
mov dword [esp + 0x48], ecx
lea ecx, [esp + 0x24]
mov dword [esp + 0x44], eax
call sub.MFC42.DLL_CFile::CFile
mov ebx, dword [esp + 0x1009c]
push 0
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 ebx
push edi
call dword [sym.imp.WININET.dll_InternetOpenUrlA]
mov ebx, eax
test ebx, ebx
jne 0x4018d3
push edi
call dword [sym.imp.WININET.dll_InternetCloseHandle]
jmp 0x401b2c
mov ecx, dword [esp + 0x100a0]
push 0
push 0x1001
push ecx
lea ecx, [esp + 0x30]
call sub.MFC42.DLL_CFile::Open
test eax, eax
je 0x401b2c
xor edi, edi
lea edx, [esp + 0x38]
push edi
lea eax, [esp + 0x24]
push edx
push eax
push 0x20000005
push ebx
mov dword [esp + 0x34], edi
mov dword [esp + 0x4c], 4
call dword [sym.imp.WININET.dll_HttpQueryInfoA]
test eax, eax
jne 0x401920
mov dword [esp + 0x20], edi
mov ecx, 0x4000
xor eax, eax
lea edi, [esp + 0x8c]
push 0x407124
rep stosd dword es:[edi], eax
call ebp
push ecx
lea edx, [esp + 0x100a0]
mov ecx, esp
mov dword [esp + 0x18], esp
push edx
call sub.MFC42.DLL_CString::CString_2
mov ecx, esi
call fcn.00401bd0
test eax, eax
jle 0x401977
push ecx
lea eax, [esp + 0x100a0]
mov ecx, esp
mov dword [esp + 0x18], esp
push eax
call sub.MFC42.DLL_CString::CString_2
mov ecx, esi
call fcn.00401bd0
mov dword [esi + 0x10c], eax
lea ecx, [esp + 0x10]
call sub.MFC42.DLL_CString::CString
mov ecx, dword [esi + 0x10c]
lea edx, [esp + 0x10]
push ecx
push str.UpdateMyProgram:m_FileSize_d
push edx
mov byte [esp + 0x100a0], 3
call sub.MFC42.DLL_CString::Format
mov eax, dword [esp + 0x1c]
add esp, 0xc
push eax
call ebp
mov ecx, dword [esp + 0x1009c]
lea edx, [esp + 0x10]
push ecx
push str.UpdateMyProgram:szUrl_s
push edx
call sub.MFC42.DLL_CString::Format
mov eax, dword [esp + 0x1c]
add esp, 0xc
push eax
call ebp
mov ecx, dword [esp + 0x100a0]
lea edx, [esp + 0x10]
push ecx
push str.UpdateMyProgram:szFileName_s
push edx
call sub.MFC42.DLL_CString::Format
mov eax, dword [esp + 0x1c]
add esp, 0xc
push eax
call ebp
mov eax, dword [esi + 0x10c]
mov ecx, dword [esi + 0xc4]
mov edi, dword [sym.imp.USER32.dll_SendMessageA]
push eax
mov ecx, dword [ecx + 0x20]
push 0
push 0x406
push ecx
mov dword [esp + 0x24], 0
call edi
mov eax, dword [esi + 0xc4]
push 0
push 1
push 0x402
mov edx, dword [eax + 0x20]
push edx
call edi
lea eax, [esp + 0x18]
lea ecx, [esp + 0x8c]
push eax
push 0x4000
push ecx
push ebx
call dword [sym.imp.WININET.dll_InternetReadFile]
test eax, eax
je 0x401abf
mov eax, dword [esp + 0x18]
test eax, eax
je 0x401ad6
lea edx, [esp + 0x8c]
push eax
push edx
lea ecx, [esp + 0x2c]
call sub.MFC42.DLL_CFile::Write
mov eax, dword [esi + 0xc4]
mov ecx, dword [esp + 0x18]
push 0
push ecx
mov edx, dword [eax + 0x20]
push 0x403
push edx
call edi
mov eax, dword [esp + 0x18]
mov edx, dword [esp + 0x14]
add edx, eax
push eax
lea eax, [esp + 0x14]
push str.UpdateMyProgram:Pos_d
push eax
mov dword [esp + 0x20], edx
call sub.MFC42.DLL_CString::Format
mov ecx, dword [esp + 0x1c]
add esp, 0xc
push ecx
call ebp
lea edx, [esp + 0x18]
lea eax, [esp + 0x8c]
push edx
push 0x4000
push eax
push ebx
call dword [sym.imp.WININET.dll_InternetReadFile]
test eax, eax
jne 0x401a44
lea ecx, [esp + 0x24]
call sub.MFC42.DLL_CFile::Close
mov byte [esp + 0x10094], 2
lea ecx, [esp + 0x10]
jmp 0x401b27
mov eax, dword [esi + 0x10c]
mov esi, dword [esi + 0xc4]
push 0
push eax
mov ecx, dword [esi + 0x20]
push 0x402
push ecx
call edi
push 0x40708c
call ebp
lea ecx, [esp + 0x24]
call sub.MFC42.DLL_CFile::Close
mov esi, dword [sym.imp.WININET.dll_InternetCloseHandle]
push ebx
call esi
mov edx, dword [esp + 0x1c]
push edx
call esi
mov eax, dword [esp + 0x14]
mov byte [esp + 0x10094], 2
cmp eax, 0x401
lea ecx, [esp + 0x10]
jge 0x401b6d
call fcn.00404476
lea ecx, [esp + 0x24]
mov byte [esp + 0x10094], 1
call fcn.00404638
lea ecx, [esp + 0x1009c]
mov byte [esp + 0x10094], 0
call fcn.00404476
lea ecx, [esp + 0x100a0]
mov dword [esp + 0x10094], 0xffffffff
call fcn.00404476
or eax, 0xffffffff
jmp 0x401bb0
call fcn.00404476
lea ecx, [esp + 0x24]
mov byte [esp + 0x10094], 1
call fcn.00404638
lea ecx, [esp + 0x1009c]
mov byte [esp + 0x10094], 0
call fcn.00404476
lea ecx, [esp + 0x100a0]
mov dword [esp + 0x10094], 0xffffffff
call fcn.00404476
xor eax, eax
mov ecx, dword [esp + 0x1008c]
pop edi
pop esi
pop ebp
mov dword fs:[0], ecx
pop ebx
add esp, 0x10088
ret 8