Function at 0x180141060
Capabilities:
Encode data using xor

Disassembly:
push rbx
push rdi
push r12
push r15
sub rsp, 0x38
xor edi, edi
mov r15d, r8d
mov r12, rdx
mov rbx, rcx
test r8d, r8d
jle 0x1801412cc
mov qword [rsp + 0x60], rbp
mov qword [rsp + 0x68], rsi
mov qword [rsp + 0x70], r13
mov qword [rsp + 0x30], r14
lea ebp, [rdi + 2]
cmp dword [rbx + 0x20], 0
je 0x1801411db
cmp dword [rbx + 0x28], r15d
movsxd rcx, dword [rbx + 0x24]
movsxd rax, dword [rbx + 0x28]
mov r14d, r15d
mov rdx, r12
cmovl r14d, dword [rbx + 0x28]
sub rcx, rax
add rcx, 8
movsxd r13, r14d
mov r8, r13
add rcx, rbx
call fcn.18017dd20
sub dword [rbx + 0x28], r14d
jne 0x18014128a
mov edx, dword [rbx + 8]
mov ecx, edx
shr ecx, 8
and ecx, 0x7f
cmp ecx, 0x7e
jge 0x1801410ea
xor esi, esi
jmp 0x1801410f5
mov esi, 8
cmp ecx, 0x7e
cmove esi, ebp
mov r9d, dword [rbx + 0x24]
mov ebp, edx
shr ebp, 0xd
and ebp, 4
lea r8d, [rbp + 2]
add r8d, esi
cmp r9d, r8d
jge 0x18014111f
mov eax, r8d
mov dword [rbx + 0x24], r8d
sub eax, r9d
mov dword [rbx + 0x28], eax
jmp 0x180141285
mov rax, qword [rbx]
mov r8d, dword [rax + 4]
test r8d, r8d
je 0x180141138
test ebp, ebp
je 0x1801412ba
test r8d, r8d
jne 0x180141140
test ebp, ebp
jg 0x1801412ba
test esi, esi
jne 0x180141149
movsxd r8, ecx
jmp 0x18014116c
cmp esi, 2
jne 0x180141160
shr edx, 0x10
movzx ecx, dx
call qword [sym.imp.WS2_32.dll_ntohs]
movzx r8d, ax
jmp 0x18014116c
mov rcx, qword [rbx + 0xa]
call sym.HPSocket4C_U.dll_SYS_NToH64
mov r8, rax
mov qword [rbx + 0x30], r8
mov qword [rbx + 0x38], r8
test ebp, ebp
jle 0x180141184
lea rcx, [rbx + 0xa]
movsxd rax, esi
add rcx, rax
jmp 0x180141186
xor ecx, ecx
mov qword [rbx + 0x18], rcx
mov edx, dword [rbx + 8]
movzx r9d, byte [rbx + 8]
mov eax, edx
mov qword [rsp + 0x28], r8
mov qword [rsp + 0x20], rcx
mov rcx, qword [rbx]
shr eax, 4
shr edx, 7
and al, 7
and r9b, 0xf
and edx, 1
movzx r8d, al
call fcn.180141910
mov edi, eax
cmp eax, 2
je 0x18014129b
cmp qword [rbx + 0x30], 0
jbe 0x180141276
mov dword [rbx + 0x20], 0
jmp 0x180141285
movsxd rax, r15d
cmp qword [rbx + 0x38], rax
jae 0x1801411ea
mov r14d, dword [rbx + 0x38]
jmp 0x1801411ed
mov r14d, r15d
cmp qword [rbx + 0x18], 0
je 0x18014122d
mov eax, dword [rbx + 0x30]
movsxd r9, r14d
sub eax, dword [rbx + 0x38]
and eax, 3
test r14d, r14d
jle 0x18014122d
mov rdx, r12
mov r8d, eax
nop dword [rax + rax]
mov rax, qword [rbx + 0x18]
mov rcx, r8
inc r8d
and ecx, 3
lea rdx, [rdx + 1]
movzx ecx, byte [rcx + rax]
xor byte [rdx - 1], cl
dec r9
jne 0x180141210
mov rax, qword [rbx]
movsxd r13, r14d
sub qword [rbx + 0x38], r13
mov rbp, qword [rax + 0x18]
mov r8, qword [rax + 0x10]
mov rdi, qword [r8 + 0x220]
mov rax, qword [rbp + 8]
lea rcx, [rbp + 8]
mov rsi, qword [rdi]
call qword [rax + 0x68]
mov r9, r12
mov rdx, rbp
mov rcx, rdi
mov r8, rax
mov dword [rsp + 0x20], r14d
call qword [rsi + 0x60]
mov edi, eax
cmp eax, 2
je 0x18014129b
cmp qword [rbx + 0x38], 0
jne 0x180141285
mov rcx, rbx
call fcn.1801419a0
mov edi, eax
cmp eax, 2
je 0x18014129b
mov ebp, 2
sub r15d, r14d
add r12, r13
test r15d, r15d
jg 0x180141096
mov eax, edi
mov r13, qword [rsp + 0x70]
mov rsi, qword [rsp + 0x68]
mov r14, qword [rsp + 0x30]
mov rbp, qword [rsp + 0x60]
add rsp, 0x38
pop r15
pop r12
pop rdi
pop rbx
ret
mov ecx, reloc.WS2_32.dll_listen
call qword [sym.imp.KERNEL32.dll_SetLastError]
mov eax, 2
jmp 0x18014129b
mov eax, edi
add rsp, 0x38
pop r15
pop r12
pop rdi
pop rbx
ret