Function at 0x40438c
Capabilities:
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, 0x10078
call fcn.0041ed40
mov eax, dword [0x43b5a0]
xor eax, ebp
mov dword [ebp - 4], eax
mov eax, dword [ebp + 0xc]
push ebx
mov ebx, dword [ebp + 8]
push esi
mov esi, dword [ebp + 0x10]
push edi
mov dword [ebp - 0x74], eax
xor edi, edi
push edi
lea eax, [ebp - 0x6c]
push eax
mov dword [ebp - 0x68], esi
call dword [sym.imp.WININET.dll_InternetGetConnectedState]
test eax, eax
jne 0x4043d8
push 0x435d94
call fcn.00413e5c
or dword [esi], 0xffffffff
jmp 0x4045b3
push 0x435dc8
call fcn.00413e5c
cmp dword [ebx + 0x14], 0x10
pop ecx
jb 0x4043ed
mov eax, dword [ebx]
jmp 0x4043ef
mov eax, ebx
push edi
push 1
push eax
call dword [sym.imp.WININET.dll_InternetCheckConnectionA]
test eax, eax
jne 0x404404
push 0x435dd8
jmp 0x4043cb
push 0x435e0c
call fcn.00413e5c
push 0x40
lea eax, [ebp - 0x54]
push edi
push eax
call fcn.00417240
push edi
lea eax, [ebp - 0x54]
push str.Agent_ld
push eax
call fcn.0041207a
add esp, 0x1c
test byte [ebp - 0x6c], 4
push edi
push edi
lea eax, [ebp - 0x54]
push edi
jne 0x40443c
push 4
jmp 0x40443d
push edi
push eax
call dword [sym.imp.WININET.dll_InternetOpenA]
mov dword [ebp - 0x5c], eax
test eax, eax
jne 0x404455
push 0x435e28
jmp 0x4043cb
push 0x435e58
call fcn.00413e5c
cmp dword [ebx + 0x14], 0x10
mov esi, str.Accept:___r_n_r_n
lea edi, [ebp - 0x14]
movsd dword es:[edi], dword [esi]
movsd dword es:[edi], dword [esi]
movsd dword es:[edi], dword [esi]
pop ecx
movsd dword es:[edi], dword [esi]
jb 0x404476
mov esi, dword [ebx]
jmp 0x404478
mov esi, ebx
push 0
push 0x84000100
lea eax, [ebp - 0x14]
push eax
call dword [sym.imp.KERNEL32.dll_lstrlenA]
mov edi, dword [ebp - 0x5c]
push eax
lea eax, [ebp - 0x14]
push eax
push esi
push edi
call dword [sym.imp.WININET.dll_InternetOpenUrlA]
mov esi, eax
mov dword [ebp - 0x78], esi
test esi, esi
jne 0x4044c9
cmp dword [ebx + 0x14], 0x10
jb 0x4044aa
mov ebx, dword [ebx]
push ebx
push 0x435e78
call fcn.00413e5c
pop ecx
pop ecx
push edi
call dword [sym.imp.WININET.dll_InternetCloseHandle]
mov eax, dword [ebp - 0x68]
or dword [eax], 0xffffffff
jmp 0x4045b4
cmp dword [ebx + 0x14], 0x10
jb 0x4044d1
mov ebx, dword [ebx]
push ebx
push 0x435e8c
call fcn.00413e5c
mov eax, dword [ebp - 0x74]
pop ecx
cmp dword [eax + 0x14], 0x10
pop ecx
jb 0x4044e9
mov eax, dword [eax]
push 0x435c04
push eax
lea eax, [ebp - 0x58]
push eax
call fcn.00413355
add esp, 0xc
xor ebx, ebx
push ebx
lea eax, [ebp - 0x70]
push eax
lea eax, [ebp - 0x64]
push eax
push 0x20000005
push esi
mov dword [ebp - 0x64], ebx
mov dword [ebp - 0x70], 4
call dword [sym.imp.WININET.dll_HttpQueryInfoA]
test eax, eax
jne 0x40454e
call fcn.00414347
mov esi, eax
call fcn.00414347
push dword [esi]
mov edi, eax
call fcn.00414045
push eax
push dword [edi]
push 0x435d58
call fcn.00413e5c
mov esi, dword [ebp - 0x78]
mov edi, dword [ebp - 0x5c]
add esp, 0x10
mov dword [ebp - 0x64], ebx
push 0x435d84
call fcn.00413e5c
mov dword [esp], 0x10000
lea eax, [ebp - 0x10078]
push ebx
push eax
call fcn.00417240
mov ebx, dword [sym.imp.WININET.dll_InternetReadFile]
add esp, 0xc
jmp 0x404594
cmp dword [ebp - 0x60], 0
push dword [ebp - 0x58]
je 0x4045c8
push dword [ebp - 0x60]
lea eax, [ebp - 0x10078]
push 1
push eax
call fcn.00413760
add esp, 0x10
lea eax, [ebp - 0x60]
push eax
push 0x4000
lea eax, [ebp - 0x10078]
push eax
push esi
call ebx
test eax, eax
jne 0x404577
push dword [ebp - 0x58]
call fcn.00413d19
pop ecx
or eax, 0xffffffff
mov ecx, dword [ebp - 4]
pop edi
pop esi
xor ecx, ebp
pop ebx
call fcn.0041206b
leave
ret 0xc
call fcn.00413d19
pop ecx
push esi
mov esi, dword [sym.imp.WININET.dll_InternetCloseHandle]
call esi
push edi
call esi
xor eax, eax
jmp 0x4045b7