Function at 0x140016480
Capabilities:
Encode data using xor

Disassembly:
push rsi
push rdi
push r13
push r14
sub rsp, 0x68
mov rax, qword [rcx + 0x180]
mov r10, qword [rcx + 0x168]
mov rdi, rcx
mov qword [rsp + 0x40], rax
mov rax, qword [rcx + 0x38]
mov rsi, r9
lea rcx, [r9 + rax]
movabs rax, 0xfffffffe0
mov r14, r8
mov r13, rdx
mov qword [rsp + 0x38], r10
cmp rcx, rax
ja 0x14001679a
cmp rcx, r9
jb 0x14001679a
mov qword [rsp + 0x98], rbx
mov qword [rsp + 0x60], rbp
mov ebp, dword [rdi + 0x170]
xor ebx, ebx
mov qword [rdi + 0x38], rcx
mov dword [rsp + 0x30], ebp
cmp dword [rdi + 0x174], ebx
je 0x140016545
test r9, r9
jne 0x140016518
lea rdx, [rdi + 0x60]
lea rcx, [rdi + 0x40]
call qword [rdi + 0x160]
mov dword [rdi + 0x174], ebx
xor eax, eax
jmp 0x140016782
mov rax, qword [rdi + 0x40]
mov ebp, reloc.WS2_32.dll_recv
mov dword [rdi + 0x174], ebx
mov qword [rdi + 0x188], rax
mov rax, qword [rdi + 0x48]
mov qword [rdi + 0x40], rbx
mov qword [rdi + 0x48], rbx
mov dword [rsp + 0x30], ebp
mov qword [rdi + 0x190], rax
mov qword [rsp + 0x58], r12
mov qword [rsp + 0x50], r15
mov r15d, dword [rdi + 0xc]
mov r12d, ebp
bswap r15d
and r12d, 0xf
mov dword [rsp + 0x90], r15d
mov dword [rsp + 0x34], r12d
je 0x1400165d1
movsxd rdx, ebp
nop
test rsi, rsi
je 0x1400165a8
movzx ecx, byte [r12 + rdi + 0x10]
inc rdx
inc ebp
xor cl, byte [r13]
inc r14
inc r13
mov byte [r14 - 1], cl
dec rsi
mov byte [rdx + rdi + 0x187], cl
inc r12d
and r12d, 0xf
mov dword [rsp + 0x34], r12d
jne 0x140016570
jmp 0x1400165b1
test r12d, r12d
jne 0x140016770
lea r8, [rdi + 0x188]
lea rdx, [rdi + 0x60]
lea rcx, [rdi + 0x40]
mov r9d, ebp
call r10
mov r10, qword [rsp + 0x38]
mov ebp, ebx
mov dword [rsp + 0x30], ebx
cmp rsi, 0x10
jb 0x1400165f6
test ebp, ebp
je 0x1400165f6
lea r8, [rdi + 0x188]
lea rdx, [rdi + 0x60]
lea rcx, [rdi + 0x40]
mov r9d, ebp
call r10
mov ebp, ebx
mov dword [rsp + 0x30], ebx
mov r10, qword [rsp + 0xb0]
cmp rsi, 0xc00
jb 0x1400166b0
mov rbp, qword [rsp + 0x38]
movabs rax, 0xaaaaaaaaaaaaaaab
mul rsi
mov rbx, rdx
shr rbx, 0xb
mov rax, rbx
imul rax, rax, 0xfffffffffffff400
add rsi, rax
mov qword [rsp + 0xa8], rsi
nop dword [rax]
mov r9, qword [rsp + 0x40]
mov r8d, 0xc0
mov rdx, r14
mov rcx, r13
mov qword [rsp + 0x20], rdi
call r10
add r15d, 0xc0
lea rdx, [rdi + 0x60]
mov eax, r15d
lea rcx, [rdi + 0x40]
mov r9d, 0xc00
bswap eax
mov r8, r14
mov dword [rdi + 0xc], eax
call rbp
mov r10, qword [rsp + 0xb0]
add r14, 0xc00
add r13, 0xc00
sub rbx, 1
jne 0x140016640
mov rsi, qword [rsp + 0xa8]
mov ebp, dword [rsp + 0x30]
mov r12d, dword [rsp + 0x34]
mov dword [rsp + 0x90], r15d
mov r15, rsi
and r15, 0xfffffffffffffff0
je 0x140016708
mov r9, qword [rsp + 0x40]
mov rbx, r15
mov rdx, r14
shr rbx, 4
mov rcx, r13
mov qword [rsp + 0x20], rdi
mov r8, rbx
call r10
add dword [rsp + 0x90], ebx
lea rdx, [rdi + 0x60]
mov ebx, dword [rsp + 0x90]
lea rcx, [rdi + 0x40]
mov r9, r15
mov eax, ebx
mov r8, r14
add r13, r15
bswap eax
sub rsi, r15
mov dword [rdi + 0xc], eax
call qword [rsp + reloc.WS2_32.dll_getservbyport]
add r14, r15
jmp 0x14001670f
mov ebx, dword [rsp + 0x90]
test rsi, rsi
je 0x140016770
mov r8, qword [rsp + 0x40]
lea rdx, [rdi + 0x10]
mov rcx, rdi
call qword [rdi + 0x178]
inc ebx
movsxd rcx, r12d
movsxd rax, ebp
bswap ebx
sub r13, r14
lea rdx, [rcx + r14]
lea r9, [rcx + rdi + 0x10]
mov dword [rdi + 0xc], ebx
lea r8, [rax + rdi + 0x188]
add ebp, esi
nop dword [rax]
movzx eax, byte [r13 + rdx]
inc r8
inc r9
xor al, byte [r9 - 1]
inc rdx
sub rsi, 1
mov byte [rdx - 1], al
mov byte [r8 - 1], al
jne 0x140016750
mov r12, qword [rsp + 0x58]
mov r15, qword [rsp + 0x50]
mov dword [rdi + 0x170], ebp
xor eax, eax
mov rbx, qword [rsp + 0x98]
mov rbp, qword [rsp + 0x60]
add rsp, 0x68
pop r14
pop r13
pop rdi
pop rsi
ret
or eax, 0xffffffff
add rsp, 0x68
pop r14
pop r13
pop rdi
pop rsi
ret