Function at 0x18022e870
Capabilities:
Connect socket
Set socket configuration

Disassembly:
push rbx
push rbp
push rsi
push rdi
push r12
sub rsp, 0x70
mov rax, qword [0x1803c1370]
xor rax, rsp
mov qword [rsp + 0x60], rax
xor esi, esi
mov ebp, edx
mov rdi, rcx
mov qword [rsp + 0x38], rcx
or ebx, 0xffffffff
mov r12d, esi
mov dword [rsp + 0x34], esi
call sym.VBoxRT.dll_BIO_sock_init
cmp eax, 1
je 0x18022e8b1
or eax, ebx
jmp 0x18022eb59
mov rcx, rdi
mov qword [rsp + 0xb0], r14
call sym.VBoxRT.dll_BUF_strdup
mov r14, rax
test rax, rax
jne 0x18022e8d1
or eax, 0xffffffff
jmp 0x18022eb51
mov qword [rsp + 0xb8], r15
mov rdi, rsi
mov r15, rax
cmp byte [r14], sil
je 0x18022e90c
movzx ecx, byte [rax]
cmp cl, 0x3a
jne 0x18022e8f5
lea rdi, [rax + 1]
mov byte [rax], sil
jmp 0x18022e8fa
cmp cl, 0x2f
je 0x18022e904
inc rax
cmp byte [rax], sil
jne 0x18022e8e4
jmp 0x18022e907
mov byte [rax], sil
test rdi, rdi
jne 0x18022e916
mov rdi, r14
lea r15, [0x180261a48]
lea rdx, [rsp + 0x30]
mov rcx, rdi
call sym.VBoxRT.dll_BIO_get_port
test eax, eax
je 0x18022eb2a
movzx ecx, word [rsp + 0x30]
xor eax, eax
mov qword [rsp + 0xa8], r13
mov qword [rsp + 0x40], rax
mov r13d, 2
mov qword [rsp + 0x48], rax
mov word [rsp + 0x40], r13w
call sub.WS2_32.dll_htons
lea rdi, [0x180261a48]
mov rsi, r15
mov ecx, r13d
mov word [rsp + 0x42], ax
repe cmpsb byte [rsi], byte [rdi]
jne 0x18022e972
mov dword [rsp + 0x44], r12d
jmp 0x18022e9b3
lea rdx, [rsp + 0x30]
mov rcx, r15
call sym.VBoxRT.dll_BIO_get_host_ip
test eax, eax
je 0x18022eb22
movzx eax, byte [rsp + 0x31]
movzx ecx, byte [rsp + 0x30]
shl ecx, 8
or ecx, eax
movzx eax, byte [rsp + 0x32]
shl ecx, 8
or ecx, eax
movzx eax, byte [rsp + 0x33]
shl ecx, 8
or ecx, eax
call sub.WS2_32.dll_htonl
mov dword [rsp + 0x44], eax
mov edx, 1
mov ecx, r13d
lea r8d, [rdx + 5]
call sub.WS2_32.dll_socket
mov rbx, rax
cmp eax, 0xffffffff
je 0x18022ead5
cmp ebp, 2
jne 0x18022ea01
lea r9, [rsp + 0x34]
lea r8d, [rbp + 2]
movsxd rcx, ebx
mov edx, 0xffff
mov dword [rsp + 0x34], 1
mov dword [rsp + 0x20], 4
call sub.WS2_32.dll_setsockopt
xor ebp, ebp
mov dword [rsp + 0x34], eax
movsxd r13, ebx
lea rdx, [rsp + 0x40]
mov r8d, reloc.WS2_32.dll_recv
mov rcx, r13
call sub.WS2_32.dll_bind
cmp eax, 0xffffffff
jne 0x18022ebc2
call sub.WS2_32.dll_WSAGetLastError
cmp ebp, 1
mov ebp, 2
mov r12d, eax
jne 0x18022eb71
cmp eax, 0x2740
jne 0x18022eb71
movaps xmm0, xmmword [rsp + 0x40]
lea rdi, [0x180261a48]
mov rsi, r15
mov ecx, ebp
movdqa xmmword [rsp + 0x50], xmm0
repe cmpsb byte [rsi], byte [rdi]
jne 0x18022ea6a
mov ecx, 0x7f000001
call sub.WS2_32.dll_htonl
mov dword [rsp + 0x54], eax
mov edx, 1
mov ecx, ebp
lea r8d, [rdx + 5]
call sub.WS2_32.dll_socket
cmp eax, 0xffffffff
je 0x18022eb71
movsxd rsi, eax
lea rdx, [rsp + 0x50]
mov r8d, reloc.WS2_32.dll_recv
mov rcx, rsi
call sub.WS2_32.dll_connect
mov rcx, rsi
mov edi, eax
call sub.WS2_32.dll_closesocket
cmp edi, 0xffffffff
jne 0x18022eb71
mov rcx, r13
call sub.WS2_32.dll_closesocket
mov r13, rbp
lea edx, [rdi + 2]
lea r8d, [rdi + 7]
mov ecx, r13d
call sub.WS2_32.dll_socket
mov ebx, eax
cmp eax, edi
jne 0x18022e9d0
mov r12d, dword [rsp + 0x34]
call sub.WS2_32.dll_WSAGetLastError
xor esi, esi
xor r9d, r9d
lea edx, [rsi + 4]
mov r8d, eax
mov ecx, r13d
mov dword [rsp + 0x20], esi
call sym.VBoxRT.dll_ERR_put_error
mov r8, qword [rsp + 0x38]
lea r9, [0x1803095c4]
lea rdx, str.port
lea ecx, [rsi + 3]
call sym.VBoxRT.dll_ERR_add_error_data
lea edx, [rsi + 0x69]
lea ecx, [rsi + 0x20]
lea r8d, [rsi + 0x76]
xor r9d, r9d
mov dword [rsp + 0x20], esi
call sym.VBoxRT.dll_ERR_put_error
mov r13, qword [rsp + 0xa8]
mov rcx, r14
call sym.VBoxRT.dll_CRYPTO_free
mov r15, qword [rsp + 0xb8]
test r12d, r12d
jne 0x18022eb4f
cmp ebx, 0xffffffff
je 0x18022eb4f
movsxd rcx, ebx
call sub.WS2_32.dll_closesocket
or ebx, 0xffffffff
mov eax, ebx
mov r14, qword [rsp + 0xb0]
mov rcx, qword [rsp + 0x60]
xor rcx, rsp
call fcn.180227610
add rsp, 0x70
pop r12
pop rdi
pop rsi
pop rbp
pop rbx
ret
xor esi, esi
xor r9d, r9d
mov r8d, r12d
lea edx, [rsi + 6]
mov ecx, ebp
mov dword [rsp + 0x20], esi
call sym.VBoxRT.dll_ERR_put_error
mov r8, qword [rsp + 0x38]
lea r9, [0x1803095c4]
lea rdx, str.port
lea ecx, [rsi + 3]
call sym.VBoxRT.dll_ERR_add_error_data
lea edx, [rsi + 0x69]
lea ecx, [rsi + 0x20]
lea r8d, [rsi + 0x75]
xor r9d, r9d
mov dword [rsp + 0x20], esi
call sym.VBoxRT.dll_ERR_put_error
mov r12d, dword [rsp + 0x34]
jmp 0x18022eb22
movsxd rcx, ebx
mov edx, 5
call sub.WS2_32.dll_listen
cmp eax, 0xffffffff
jne 0x18022ec35
call sub.WS2_32.dll_WSAGetLastError
xor r9d, r9d
mov dword [rsp + 0x20], 0
lea edx, [r9 + 6]
mov r8d, eax
lea ecx, [rdx - 4]
call sym.VBoxRT.dll_ERR_put_error
mov r8, qword [rsp + 0x38]
lea r9, [0x1803095c4]
lea rdx, str.port
mov ecx, 3
call sym.VBoxRT.dll_ERR_add_error_data
xor r9d, r9d
mov dword [rsp + 0x20], 0
lea edx, [r9 + 0x69]
lea r8d, [r9 + 0x77]
lea ecx, [rdx - 0x49]
call sym.VBoxRT.dll_ERR_put_error
mov r12d, dword [rsp + 0x34]
jmp 0x18022eb22
mov r12d, 1
jmp 0x18022eb22