Function at 0x140085856
Capabilities:
Create tcp socket
Create udp socket

Disassembly:
push r15
push r14
push r13
push r12
push rsi
push rdi
push rbp
push rbx
sub rsp, 0xd8
mov rax, qword [rcx]
cmp byte [rax], 0
mov byte [rax], 0
je 0x140085d33
lea rsi, str.127.0.0.1:34254
lea rcx, [rsp + 0x30]
mov qword [rcx], rsi
mov qword [rcx + 8], 0xf
call fcn.1400113c0
mov rdi, rax
test dil, 1
je 0x14008591c
mov rbx, qword [rsp + 0x38]
test rbx, rbx
je 0x1400858ea
mov rax, qword [rsp + 0x30]
lea rcx, [rbx - 1]
mov dl, byte [rax]
inc rax
mov qword [rsp + 0x30], rax
mov qword [rsp + 0x38], rcx
cmp dl, 0x3a
jne 0x1400858ea
lea rdx, [rsp + 0x70]
mov dword [rdx + 0x10], 0xa
and qword [rdx], 0
mov byte [rdx + 0x14], 1
lea rcx, [rsp + 0x30]
call fcn.140011ca0
cmp ax, 1
jne 0x1400858ec
jmp 0x1400858f6
xor eax, eax
mov qword [rsp + 0x38], rbx
test ax, ax
je 0x14008591c
movabs rax, 0xffffffff00
and rdi, rax
shr rdi, 8
movzx eax, dx
shl rax, 0x30
shl rdi, 0x10
or rdi, rax
mov eax, 1
jmp 0x140085920
xor edi, edi
xor eax, eax
or rax, rdi
test ax, ax
je 0x140085bc8
movzx eax, ax
cmp eax, 1
jne 0x140085bd6
cmp qword [rsp + 0x38], 0
jne 0x140085bd6
mov eax, dword [rsp + 0x78]
mov dword [rsp + 0xb0], eax
mov rax, qword [rsp + 0x70]
mov qword [rsp + 0xa8], rax
mov al, byte [0x1401672b8]
mov ecx, 0x20
mov edx, 4
call fcn.140009f00
test rax, rax
je 0x140085d4d
and word [rax], 0
mov rcx, rdi
shr rcx, 0x10
and rcx, 0xffffffffffffff00
mov edx, edi
shr edx, 0x10
movzx edx, dl
or rdx, rcx
shr rdi, 0x30
mov word [rax + 6], di
mov dword [rax + 2], edx
mov rcx, qword [rsp + 0xa8]
mov qword [rax + 8], rcx
mov ecx, dword [rsp + 0xb0]
mov dword [rax + 0x10], ecx
and dword [rax + 0x14], 0
mov rcx, rax
add rcx, 0x20
mov qword [rsp + 0x50], rax
mov qword [rsp + 0x58], 1
mov qword [rsp + 0x60], rax
mov qword [rsp + 0x68], rcx
mov rax, qword [rsp + 0x50]
mov rcx, qword [rsp + 0x58]
mov rdx, qword [rsp + 0x60]
mov qword [rsp + 0x80], rdx
mov rdx, qword [rsp + 0x68]
mov qword [rsp + 0x88], rdx
mov qword [rsp + 0x70], rax
mov qword [rsp + 0x78], rcx
mov rdi, qword [rsp + 0x80]
mov rax, qword [rsp + 0x88]
mov qword [rsp + 0xb8], rax
xor r14d, r14d
cmp rdi, qword [rsp + 0xb8]
je 0x140085c9f
mov rax, rdi
add rdi, 0x20
mov qword [rsp + 0x80], rdi
movzx esi, word [rax]
cmp si, 2
je 0x140085c9f
mov r12d, dword [rax + 0x14]
mov r13d, dword [rax + 0x18]
movzx r15d, word [rax + 0x1c]
movzx eax, word [rdi - 0xe]
mov word [rsp + 0x60], ax
movups xmm0, xmmword [rdi - 0x1e]
movaps xmmword [rsp + 0x50], xmm0
mov rax, qword [0x140167228]
cmp rax, 3
jne 0x140085bbe
mov qword [rsp + 0xa0], r14
mov ebp, 2
test si, si
je 0x140085a95
mov ebp, 0x17
mov dword [rsp + 0x28], 0x81
and dword [rsp + 0x20], 0
mov ecx, ebp
mov edx, 2
xor r8d, r8d
xor r9d, r9d
call qword [sym.imp.ws2_32.dll_WSASocketW]
mov rbx, rax
cmp rax, 0xffffffffffffffff
je 0x140085ad4
test si, si
je 0x140085b39
mov r8d, 0x1c
mov ax, 0x17
movups xmm0, xmmword [rsp + 0x52]
jmp 0x140085b51
call qword [sym.imp.ws2_32.dll_WSAGetLastError]
cmp eax, 0x2739
je 0x140085aef
mov r14d, eax
cmp eax, 0x2726
jne 0x140085b99
mov dword [rsp + 0x28], 1
and dword [rsp + 0x20], 0
mov ecx, ebp
mov edx, 2
xor r8d, r8d
xor r9d, r9d
call qword [sym.imp.ws2_32.dll_WSASocketW]
cmp rax, 0xffffffffffffffff
je 0x140085bb3
mov rbx, rax
mov rcx, rax
mov edx, 1
xor r8d, r8d
call qword [sym.imp.kernel32.dll_SetHandleInformation]
test eax, eax
jne 0x140085abe
call qword [sym.imp.kernel32.dll_GetLastError]
jmp 0x140085b8d
movzx r15d, word [rsp + 0x54]
mov r12d, dword [rsp + 0x50]
mov r8d, 0x10
mov ax, 2
xorps xmm0, xmm0
rol r15w, 8
mov word [rsp + 0x30], ax
mov word [rsp + 0x32], r15w
mov dword [rsp + 0x34], r12d
movups xmmword [rsp + 0x38], xmm0
mov dword [rsp + 0x48], r13d
mov rcx, rbx
lea rdx, [rsp + 0x30]
call qword [sym.imp.ws2_32.dll_bind]
cmp eax, 0xffffffff
jne 0x140085cc5
call qword [sym.imp.ws2_32.dll_WSAGetLastError]
mov r14d, eax
mov rcx, rbx
call qword [sym.imp.ws2_32.dll_closesocket]
shl r14, 0x20
or r14, 2
mov rcx, qword [rsp + 0xa0]
call fcn.140085832
jmp 0x140085a24
call qword [sym.imp.ws2_32.dll_WSAGetLastError]
mov r14d, eax
jmp 0x140085b99
call fcn.1400a84e0
jmp 0x140085a7e
mov qword [rsp + 0x30], rsi
mov qword [rsp + 0x38], 0xf
mov qword [rsp + 0x70], rsi
mov qword [rsp + 0x78], 0xf
and qword [rsp + 0x80], 0
mov qword [rsp + 0x90], 1
movabs rax, 0x3a0000003a
mov qword [rsp + 0x98], rax
mov bl, 0x3a
mov edi, 0xf
mov cl, 0x3a
mov rdx, rsi
mov r8, rdi
call fcn.140014780
cmp rax, 1
jne 0x140085c39
mov rdi, rdx
cmp rdx, 0xf
jae 0x140085c33
cmp byte [rdi + rsi], bl
je 0x140085c5a
cmp rdi, 0xf
jbe 0x140085c12
lea rcx, str.invalid_socket_address
call fcn.14003770c
nop
add rsp, 0xd8
pop rbx
pop rbp
pop rdi
pop rsi
pop r12
pop r13
pop r14
pop r15
ret
lea rcx, [rdi + rsi]
inc rcx
mov edx, 0xe
sub rdx, rdi
call fcn.1400157b0
test al, 1
jne 0x140085cb9
shr eax, 0x10
lea rdx, [rsp + 0x70]
mov qword [rdx], rsi
mov qword [rdx + 8], rdi
mov word [rdx + 0x10], ax
lea rsi, [rsp + 0x30]
mov rcx, rsi
call fcn.140090110
cmp qword [rsi], 0
je 0x140085cf9
mov rcx, qword [rsp + 0x38]
jmp 0x140085c40
lea rcx, [rsp + 0x70]
call fcn.140085817
test r14, r14
lea rcx, str.could_not_resolve_to_any_addresses
cmovne rcx, r14
jmp 0x140085c40
lea rcx, str.invalid_port_value
jmp 0x140085c40
lea rcx, [rsp + 0x70]
call fcn.140085817
mov rcx, qword [rsp + 0xa0]
call fcn.140085832
mov rcx, rbx
add rsp, 0xd8
pop rbx
pop rbp
pop rdi
pop rsi
pop r12
pop r13
pop r14
pop r15
jmp qword [sym.imp.ws2_32.dll_closesocket]
mov rax, qword [rsp + 0x38]
movups xmm0, xmmword [rsp + 0x40]
lea rdx, [rsp + 0xc0]
movups xmmword [rdx + 8], xmm0
mov qword [rdx], rax
lea rsi, [rsp + 0x50]
mov rcx, rsi
call fcn.140090310
cmp qword [rsi], 0
jne 0x1400859db
mov rcx, qword [rsp + 0x58]
jmp 0x140085c40
lea rcx, str.called__Option::unwrap____on_a__None__value
lea r8, str._rustc_a28077b28a02b92985b3a3faecf92813155f1ea1library_std_src_synconce.rs
mov edx, 0x2b
call fcn.1400a55b0
ud2
mov ecx, 4
mov edx, 0x20
call fcn.1400a5170
ud2