Function at 0x140001450
Capabilities:
Act as tcp client
Connect socket
Connect tcp socket
Create tcp socket
Download and write a file
Initialize winsock library
Receive and write data from server to client
Receive data
Receive data on socket
Send data
Send data on socket
Send http request
Send http request with host header
Write file on windows

Disassembly:
push rbp
sub rsp, 0xa10
lea rbp, [rsp + 0x80]
mov qword [rbp + 0x9a0], rcx
mov qword [rbp + 0x9a8], rdx
mov qword [rbp + 0x9b0], r8
lea rax, [rbp + 0x7c0]
mov rdx, rax
mov ecx, 0x202
mov rax, qword [sym.imp.WS2_32.dll_WSAStartup]
call rax
test eax, eax
setne al
test al, al
je 0x1400014af
lea rax, str.WSAStartup_failed_n
mov rcx, rax
call fcn.1400084a0
mov eax, 1
jmp 0x14000183e
mov r8d, 6
mov edx, 1
mov ecx, 2
mov rax, qword [sym.imp.WS2_32.dll_socket]
call rax
mov qword [rbp + 0x978], rax
cmp qword [rbp + 0x978], 0xffffffffffffffff
sete al
test al, al
je 0x14000150b
mov rax, qword [sym.imp.WS2_32.dll_WSAGetLastError]
call rax
mov edx, eax
lea rax, str.socket_creation_failed:__d_n
mov rcx, rax
call fcn.1400084a0
mov rax, qword [sym.imp.WS2_32.dll_WSACleanup]
call rax
mov eax, 1
jmp 0x14000183e
mov word [rbp + 0x7b0], 2
mov ecx, 0x1ff5
mov rax, qword [sym.imp.WS2_32.dll_htons]
call rax
mov word [rbp + 0x7b2], ax
mov rax, qword [rbp + 0x9a0]
mov rcx, rax
mov rax, qword [sym.imp.WS2_32.dll_inet_addr]
call rax
mov dword [rbp + 0x7b4], eax
lea rdx, [rbp + 0x7b0]
mov rax, qword [rbp + 0x978]
mov r8d, 0x10
mov rcx, rax
mov rax, qword [sym.imp.WS2_32.dll_connect]
call rax
cmp eax, 0xffffffff
sete al
test al, al
je 0x1400015ac
mov rax, qword [sym.imp.WS2_32.dll_WSAGetLastError]
call rax
mov edx, eax
lea rax, str.connection_failed:__d_n
mov rcx, rax
call fcn.1400084a0
mov rax, qword [rbp + 0x978]
mov rcx, rax
mov rax, qword [sym.imp.WS2_32.dll_closesocket]
call rax
mov rax, qword [sym.imp.WS2_32.dll_WSACleanup]
call rax
mov eax, 1
jmp 0x14000183e
mov rcx, qword [rbp + 0x9a8]
lea rax, [rbp + 0x3b0]
mov rdx, qword [rbp + 0x9a0]
mov qword [rsp + 0x20], rdx
mov r9, rcx
lea r8, str.GET__s_HTTP_1.1_r_nHost:__s_r_nConnection:_close_r_n_r_n
mov edx, 0x400
mov rcx, rax
call fcn.140008500
lea rax, [rbp + 0x3b0]
mov rcx, rax
call sub.msvcrt.dll_strlen
mov ecx, eax
lea rdx, [rbp + 0x3b0]
mov rax, qword [rbp + 0x978]
mov r9d, 0
mov r8d, ecx
mov rcx, rax
mov rax, qword [sym.imp.WS2_32.dll_send]
call rax
mov rax, qword [rbp + 0x9b0]
lea rdx, [0x14000a079]
mov rcx, rax
call sub.msvcrt.dll_fopen
mov qword [rbp + 0x970], rax
cmp qword [rbp + 0x970], 0
jne 0x14000166d
lea rax, str.Error_opening_file_for_writing_n
mov rcx, rax
call fcn.1400084a0
mov rax, qword [rbp + 0x978]
mov rcx, rax
mov rax, qword [sym.imp.WS2_32.dll_closesocket]
call rax
mov rax, qword [sym.imp.WS2_32.dll_WSACleanup]
call rax
mov eax, 1
jmp 0x14000183e
mov dword [rbp + 0x98c], 0
mov dword [rbp + 0x988], 0xffffffff
lea rdx, [rbp - 0x50]
mov rax, qword [rbp + 0x978]
mov r9d, 0
mov r8d, 0x400
mov rcx, rax
mov rax, qword [sym.imp.WS2_32.dll_recv]
call rax
mov dword [rbp + 0x984], eax
cmp dword [rbp + 0x984], 0
jle 0x140001800
lea rax, [rbp - 0x50]
lea rdx, str._r_n_r_n
mov rcx, rax
call sub.msvcrt.dll_strstr
mov qword [rbp + 0x968], rax
cmp qword [rbp + 0x968], 0
je 0x140001800
mov rax, qword [rbp + 0x968]
mov byte [rax], 0
lea rax, [rbp - 0x50]
lea rdx, str.Content_Length:
mov rcx, rax
call sub.msvcrt.dll_strstr
mov qword [rbp + 0x960], rax
cmp qword [rbp + 0x960], 0
je 0x14000172a
add qword [rbp + 0x960], 0x10
mov rax, qword [rbp + 0x960]
mov rcx, rax
call sub.msvcrt.dll_atoi
mov dword [rbp + 0x988], eax
mov eax, dword [rbp + 0x984]
movsxd rdx, eax
lea rax, [rbp - 0x50]
mov rcx, qword [rbp + 0x968]
sub rcx, rax
lea rax, [rcx + 4]
sub rdx, rax
mov rcx, rdx
mov rax, qword [rbp + 0x968]
add rax, 4
mov rdx, qword [rbp + 0x970]
mov r9, rdx
mov r8, rcx
mov edx, 1
mov rcx, rax
call sub.msvcrt.dll_fwrite
mov edx, dword [rbp + 0x984]
lea rax, [rbp - 0x50]
mov rcx, qword [rbp + 0x968]
sub rcx, rax
mov eax, ecx
sub edx, eax
mov eax, dword [rbp + 0x98c]
add eax, edx
sub eax, 4
mov dword [rbp + 0x98c], eax
jmp 0x140001800
lea rdx, [rbp - 0x50]
mov rax, qword [rbp + 0x978]
mov r9d, 0
mov r8d, 0x400
mov rcx, rax
mov rax, qword [sym.imp.WS2_32.dll_recv]
call rax
mov dword [rbp + 0x984], eax
cmp dword [rbp + 0x984], 0
jle 0x140001800
mov eax, dword [rbp + 0x984]
movsxd rdx, eax
mov rcx, qword [rbp + 0x970]
lea rax, [rbp - 0x50]
mov r9, rcx
mov r8, rdx
mov edx, 1
mov rcx, rax
call sub.msvcrt.dll_fwrite
mov eax, dword [rbp + 0x984]
add dword [rbp + 0x98c], eax
cmp dword [rbp + 0x984], 0
jle 0x140001817
mov eax, dword [rbp + 0x98c]
cmp eax, dword [rbp + 0x988]
jl 0x14000179b
mov rax, qword [rbp + 0x970]
mov rcx, rax
call sub.msvcrt.dll_fclose
mov rax, qword [rbp + 0x978]
mov rcx, rax
mov rax, qword [sym.imp.WS2_32.dll_closesocket]
call rax
mov eax, 0
add rsp, 0xa10
pop rbp
ret