Function at 0x401000
Capabilities:
Check for time delay via gettickcount
Check internet connectivity via wininet
Create http request
Download and write a file
Get http content length
Read data from internet
Receive and write data from server to client
Receive data
Write file on windows

Disassembly:
push ebp
mov ebp, esp
mov eax, 0x8064
call fcn.00409ad0
mov eax, dword [0x40f018]
xor eax, ebp
mov dword [ebp - 4], eax
push ebx
xor eax, eax
push esi
push eax
mov dword [ebp - 0x805c], eax
mov dword [ebp - 0x8050], eax
lea eax, [ebp - 0x8058]
push eax
mov esi, ecx
mov ebx, edx
mov dword [ebp - 0x8064], 4
call dword [sym.imp.WININET.dll_InternetGetConnectedState]
test byte [ebp - 0x8058], 0x20
je 0x401061
pop esi
mov eax, 4
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.00409024
mov esp, ebp
pop ebp
ret
push edi
mov edi, dword [sym.imp.KERNEL32.dll_GetTickCount]
call edi
mov ecx, eax
mov eax, 0x10624dd3
mul ecx
shr edx, 6
push edx
push str.Agent_ld
lea edx, [ebp - 0x44]
push 0x40
push edx
call dword [sym.imp.MSVCR100.dll__snprintf]
add esp, 0x10
test byte [ebp - 0x8058], 4
push 0
push 0
push 0
jne 0x4010a2
push 4
lea eax, [ebp - 0x44]
push eax
jmp 0x4010a8
push 0
lea ecx, [ebp - 0x44]
push ecx
call dword [sym.imp.WININET.dll_InternetOpenA]
mov dword [ebp - 0x8048], eax
test eax, eax
je 0x4012a0
push 0
push 0x84000100
push str.Accept:___r_n_r_n
call dword [sym.imp.KERNEL32.dll_lstrlenA]
mov edx, dword [ebp - 0x8048]
push eax
push str.Accept:___r_n_r_n
push esi
push edx
call dword [sym.imp.WININET.dll_InternetOpenUrlA]
mov esi, eax
mov dword [ebp - 0x8060], esi
test esi, esi
jne 0x40110f
mov eax, dword [ebp - 0x8048]
push eax
call dword [sym.imp.WININET.dll_InternetCloseHandle]
pop edi
lea eax, [esi + 1]
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.00409024
mov esp, ebp
pop ebp
ret
push 0x40b338
push ebx
call dword [sym.imp.MSVCR100.dll_fopen]
mov ebx, eax
add esp, 8
mov dword [ebp - 0x8054], ebx
test ebx, ebx
jne 0x40114b
mov ecx, dword [ebp - 0x8048]
push ecx
call dword [sym.imp.WININET.dll_InternetCloseHandle]
pop edi
pop esi
lea eax, [ebx + 2]
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.00409024
mov esp, ebp
pop ebp
ret
push 0
lea edx, [ebp - 0x8064]
push edx
lea eax, [ebp - 0x8050]
push eax
push 0x20000005
push esi
call dword [sym.imp.WININET.dll_HttpQueryInfoW]
test eax, eax
jne 0x401171
mov dword [ebp - 0x8050], eax
call edi
call edi
cmp dword [0x40f870], 0
mov esi, eax
jne 0x40126f
jmp 0x401190
mov eax, dword [ebp - 0x8060]
lea ecx, [ebp - 0x804c]
push ecx
push 0x8000
lea edx, [ebp - 0x8044]
push edx
push eax
call dword [sym.imp.WININET.dll_InternetReadFile]
test eax, eax
je 0x40123c
mov eax, dword [ebp - 0x804c]
test eax, eax
je 0x4011dc
push ebx
push eax
lea ecx, [ebp - 0x8044]
push 1
push ecx
call dword [sym.imp.MSVCR100.dll_fwrite]
mov eax, dword [ebp - 0x804c]
add esp, 0x10
mov ebx, dword [ebp - 0x805c]
add ebx, eax
mov dword [ebp - 0x805c], ebx
call edi
cmp ebx, dword [ebp - 0x8050]
jne 0x40120a
push 0x8000
lea edx, [ebp - 0x8044]
push 0
push edx
call sub.MSVCR100.dll_memset
add esp, 0xc
cmp dword [ebp - 0x804c], 0
jbe 0x401269
call edi
sub eax, esi
cmp eax, 0x32
jbe 0x401227
push eax
call dword [sym.imp.KERNEL32.dll_Sleep]
call edi
mov esi, eax
cmp dword [0x40f870], 0
mov ebx, dword [ebp - 0x8054]
je 0x401190
jmp 0x40126f
push ebx
call dword [sym.imp.MSVCR100.dll_fclose]
mov eax, dword [ebp - 0x8048]
add esp, 4
push eax
call dword [sym.imp.WININET.dll_InternetCloseHandle]
pop edi
pop esi
mov eax, 3
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.00409024
mov esp, ebp
pop ebp
ret
mov ebx, dword [ebp - 0x8054]
push ebx
call dword [sym.imp.MSVCR100.dll_fflush]
push ebx
call dword [sym.imp.MSVCR100.dll_fclose]
mov ecx, dword [ebp - 0x8048]
add esp, 8
push ecx
call dword [sym.imp.WININET.dll_InternetCloseHandle]
pop edi
pop esi
xor eax, eax
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.00409024
mov esp, ebp
pop ebp
ret
mov ecx, dword [ebp - 4]
pop edi
pop esi
xor ecx, ebp
mov eax, 4
pop ebx
call fcn.00409024
mov esp, ebp
pop ebp
ret