Function at 0x140008f80
Capabilities:
Act as tcp client
Connect socket
Connect tcp socket
Create tcp socket
Initialize winsock library
Query environment variable
Receive data
Receive data on socket
Send data
Send data on socket
Send http request
Send http request with host header

Disassembly:
push r15
push r14
push r13
push r12
push rbp
push rdi
push rsi
push rbx
sub rsp, 0x7f8
mov esi, ecx
mov rbx, rdx
call fcn.140001897
cmp esi, 2
je 0x140008fce
mov r8, qword [rbx]
mov ecx, 2
mov qword [rsp + 0x38], r8
call qword [fcn.140008d20]
mov r8, qword [rsp + 0x38]
lea rdx, str.Usage:__s__url__n
mov rcx, rax
call fcn.140008f20
jmp 0x1400091b2
mov rsi, qword [rbx + 8]
lea rdx, str.http:__
mov rcx, rsi
call sub.msvcrt.dll_strstr
test rax, rax
je 0x140008fea
add rsi, 7
mov edx, 0x2f
mov rcx, rsi
call sub.msvcrt.dll_strchr
mov edx, 0x3a
mov rcx, rsi
mov rbx, rax
call sub.msvcrt.dll_strchr
test rbx, rbx
je 0x140009012
mov byte [rbx], 0
inc rbx
lea r14, [0x14000b061]
test rax, rax
je 0x140009025
mov byte [rax], 0
lea r14, [rax + 1]
lea rdx, [rsp + 0x258]
mov ecx, 0x202
call qword [sym.imp.WS2_32.dll_WSAStartup]
mov r13d, eax
test eax, eax
je 0x140009050
lea rcx, str.WSAStartup
call sub.msvcrt.dll_perror
jmp 0x1400091b2
mov r8d, 6
mov edx, 1
mov ecx, 2
call qword [sym.imp.WS2_32.dll_socket]
mov r12, rax
cmp eax, 0xffffffff
jne 0x14000907f
lea rcx, str.socket
call sub.msvcrt.dll_perror
jmp 0x1400091ac
mov rcx, r14
lea r15, [rsp + 0x48]
movsxd r12, r12d
mov qword [rsp + 0x48], 0
mov qword [rsp + 0x50], 0
mov word [rsp + 0x48], 2
call sub.msvcrt.dll_atoi
movzx ecx, ax
call qword [sym.imp.WS2_32.dll_htons]
mov rcx, rsi
mov word [rsp + 0x4a], ax
call qword [sym.imp.WS2_32.dll_inet_addr]
mov rcx, r12
mov r8d, 0x10
mov rdx, r15
mov dword [rsp + 0x4c], eax
call qword [sym.imp.WS2_32.dll_connect]
lea rcx, str.connect
inc eax
je 0x14000919e
test rbx, rbx
jne 0x1400090f0
lea rbx, [0x14000b064]
mov qword [rsp + 0x20], rsi
mov r9, rbx
lea r14, [rsp + 0x158]
lea r8, str.GET__s_HTTP_1.1_r_nHost:__s_r_nConnection:_close_r_n_r_n
mov edx, 0x100
mov rcx, r14
call fcn.140008f50
mov rcx, r14
call sub.msvcrt.dll_strlen
xor r9d, r9d
mov rdx, r14
mov rcx, r12
mov r8d, eax
call qword [sym.imp.WS2_32.dll_send]
lea rcx, str.USERPROFILE
call sub.msvcrt.dll_getenv
lea rcx, str.getenv_USERPROFILE_
mov r9, rax
test rax, rax
je 0x14000919e
lea r14, [rsp + 0x58]
lea r8, str._sdownloaded_file.exe
mov edx, 0x100
xor ebp, ebp
mov rcx, r14
call fcn.140008f50
mov rcx, r14
mov r8d, 0x1a4
mov edx, 0x301
call sub.msvcrt.dll__open
mov r14d, eax
cmp eax, 0xffffffff
je 0x140009197
mov rsi, qword [sym.imp.WS2_32.dll_recv]
lea rbx, [rsp + 0x3f0]
lea rdi, str._r_n_r_n
jmp 0x1400091f6
lea rcx, str.open
call sub.msvcrt.dll_perror
mov rcx, r12
call qword [sym.imp.WS2_32.dll_closesocket]
call qword [sym.imp.WS2_32.dll_WSACleanup]
mov r13d, 1
jmp 0x140009234
test ebp, ebp
jne 0x140009210
mov rdx, rdi
mov rcx, rbx
mov dword [rsp + 0x38], r8d
call sub.msvcrt.dll_strstr
test rax, rax
je 0x1400091f6
mov r8d, dword [rsp + 0x38]
mov rcx, rax
lea rdx, [rax + 4]
mov ebp, 1
sub rcx, rbx
sub r8d, 4
sub r8d, ecx
mov ecx, r14d
call sub.msvcrt.dll__write
mov r8d, 0x400
xor r9d, r9d
mov rdx, rbx
mov rcx, r12
call rsi
mov r8d, eax
test eax, eax
jg 0x1400091ba
jmp 0x14000921d
mov rdx, rbx
mov ecx, r14d
call sub.msvcrt.dll__write
jmp 0x1400091f6
mov ecx, r14d
call sub.msvcrt.dll__close
mov rcx, r12
call qword [sym.imp.WS2_32.dll_closesocket]
call qword [sym.imp.WS2_32.dll_WSACleanup]
mov eax, r13d
add rsp, 0x7f8
pop rbx
pop rsi
pop rdi
pop rbp
pop r12
pop r13
pop r14
pop r15
ret