Function at 0x180040d24
Capabilities:
Encode data using xor

Disassembly:
mov qword [rsp + 0x10], rbx
mov qword [rsp + 8], rcx
push rbp
push rsi
push rdi
push r12
push r13
push r14
push r15
lea rbp, [rsp - 0x1f]
sub rsp, 0xb0
mov rdi, r9
movzx eax, r8w
mov r9, rcx
mov r15, rdx
mov ecx, 0x3f8
sub ax, cx
mov ecx, 0x7bf
cmp ax, cx
jbe 0x1800411c9
mov eax, 0x3ec
cmp r8w, ax
je 0x1800411c9
lea ecx, [rax - 4]
xor r14d, r14d
movzx eax, r8w
sub ax, cx
mov ecx, 0xf9f
cmp ax, cx
mov eax, 0x3ed
ja 0x180040dc6
cmp r8w, ax
je 0x180040ddd
lea ecx, [rax + 1]
cmp r8w, cx
je 0x180040dcc
lea ecx, [rax + 0xa]
cmp r8w, cx
je 0x180040dcc
mov rcx, qword [rdi + 0x10]
cmp rcx, 0x7b
jbe 0x180040df7
call fcn.180034d4c
mov dword [r15], 8
jmp 0x1800411d5
cmp r8w, ax
je 0x180040ddd
call fcn.180034d4c
mov dword [r15], 0x19
jmp 0x1800411d5
mov rcx, qword [rdi + 0x10]
test rcx, rcx
je 0x180040daf
call fcn.180034d4c
mov dword [r15], 0x1a
jmp 0x1800411d5
mov qword [rbp - 0x71], r14
mov rdx, r14
mov qword [rbp - 0x61], rdx
mov qword [rbp - 0x59], reloc.WS2_32.dll_ntohs
cmp r8w, ax
je 0x180040ec2
movzx ecx, r8w
call qword [sym.imp.WS2_32.dll_htons]
mov rdx, qword [rdi + 0x10]
movzx ebx, ax
add rdx, 2
mov word [rbp - 0x51], ax
cmp rdx, qword [rbp - 0x61]
ja 0x180040e4b
cmp qword [rbp - 0x59], 0x10
lea rax, [rbp - 0x71]
mov qword [rbp - 0x61], rdx
cmovae rax, qword [rbp - 0x71]
mov byte [rax + rdx], r14b
jmp 0x180040e5b
sub rdx, qword [rbp - 0x61]
lea rcx, [rbp - 0x71]
xor r8d, r8d
call fcn.18002a1d4
cmp qword [rbp - 0x59], 0x10
lea rax, [rbp - 0x71]
lea rcx, [rbp - 0x71]
cmovae rax, qword [rbp - 0x71]
mov byte [rax], bl
cmp qword [rbp - 0x59], 0x10
mov al, byte [rbp - 0x50]
cmovae rcx, qword [rbp - 0x71]
mov byte [rcx + 1], al
lea rax, [rbp - 0x71]
cmp qword [rbp - 0x59], 0x10
mov rcx, rdi
cmovae rax, qword [rbp - 0x71]
cmp qword [rdi + 0x18], 0x10
jb 0x180040e9a
mov rcx, qword [rdi]
mov r8, qword [rdi + 0x10]
add r8, rcx
cmp qword [rdi + 0x18], 0x10
jb 0x180040eab
mov rdi, qword [rdi]
sub r8, rdi
lea rcx, [rax + 2]
mov rdx, rdi
call fcn.180056680
mov rdx, qword [rbp - 0x61]
mov r9, qword [rbp + 0x5f]
mov rbx, qword [rbp + 0x7f]
mov rsi, qword [rbx + 8]
test rsi, rsi
je 0x180040edb
lock inc dword [rsi + 8]
mov rsi, qword [rbx + 8]
mov rdx, qword [rbp - 0x61]
mov r13, qword [rbx]
or edi, 0xffffffff
test r13, r13
jne 0x180040f33
call fcn.180034d4c
mov dword [r15], 6
mov qword [r15 + 8], rax
test rsi, rsi
je 0x180041173
mov eax, edi
lock xadd dword [rsi + 8], eax
add eax, edi
jne 0x180041173
mov rax, qword [rsi]
mov rcx, rsi
call qword [rax]
mov eax, edi
lock xadd dword [rsi + 0xc], eax
add eax, edi
jne 0x180041173
mov rax, qword [rsi]
mov rcx, rsi
call qword [rax + reloc.WS2_32.dll_htonl]
jmp 0x180041173
cmp rdx, 0x7d
jbe 0x180040f47
call fcn.180034d4c
mov dword [r15], 8
jmp 0x180040ef2
mov bl, byte [r9 + 9]
lea r12, [r13 + 0x50]
test bl, bl
movzx eax, r14b
mov ecx, 0x80
mov byte [rbp + 0x6f], 0x88
cmove eax, ecx
or al, byte [rbp - 0x61]
mov byte [rbp + 0x70], al
cmp rdx, qword [r12 + 0x10]
ja 0x180040f88
cmp qword [r12 + 0x18], 0x10
mov rax, r12
jb 0x180040f7d
mov rax, qword [r12]
mov qword [r12 + 0x10], rdx
mov byte [rax + rdx], r14b
jmp 0x180040f9c
sub rdx, qword [r12 + 0x10]
xor r8d, r8d
mov rcx, r12
call fcn.18002a1d4
mov r9, qword [rbp + 0x5f]
test bl, bl
jne 0x180041084
mov rcx, qword [r9 + 0x98]
call fcn.180021968
mov rdx, qword [rbp - 0x61]
lea rcx, [rbp - 0x41]
mov ebx, eax
xor eax, eax
mov qword [rbp - 0x41], rax
mov dword [rbp - 0x39], eax
call fcn.18002ecd0
movsxd rcx, eax
lea r8, [rbp - 0x41]
lea rdx, [rbp + 0x6f]
mov dword [rbp + rcx - 0x41], ebx
lea rcx, [rbp - 0x21]
call fcn.180041830
lea rcx, [r13 + 0x10]
mov rdx, rax
call fcn.180020e28
mov rdx, qword [rbp - 9]
cmp rdx, 0x10
jb 0x180041027
mov rcx, qword [rbp - 0x21]
inc rdx
mov rax, rcx
cmp rdx, 0x1000
jb 0x180041022
mov rcx, qword [rcx - 8]
add rdx, 0x27
sub rax, rcx
add rax, 0xfffffffffffffff8
cmp rax, 0x1f
ja 0x180041234
call fcn.180054638
cmp qword [r12 + 0x18], 0x10
mov dword [rbp - 0x49], ebx
jb 0x180041036
mov r12, qword [r12]
cmp qword [rbp - 0x59], 0x10
lea rcx, [rbp - 0x71]
jb 0x18004104e
mov rax, qword [rbp - 0x71]
mov rcx, qword [rbp - 0x61]
add rcx, rax
jmp 0x180041056
add rcx, qword [rbp - 0x61]
lea rax, [rbp - 0x71]
mov r8, r14
cmp rax, rcx
je 0x180041128
sub r12, rax
mov dl, byte [rbp + r8 - 0x49]
xor dl, byte [rax]
inc r8
mov byte [r12 + rax], dl
and r8d, 3
inc rax
cmp rax, rcx
jne 0x180041065
jmp 0x180041128
mov rdx, qword [rbp - 0x61]
lea rcx, [rbp - 0x31]
xor eax, eax
mov qword [rbp - 0x31], rax
mov dword [rbp - 0x29], eax
call fcn.18002ecd0
lea r8, [rbp - 0x31]
lea rdx, [rbp + 0x6f]
lea rcx, [rbp - 1]
call fcn.180041830
lea rcx, [r13 + 0x10]
mov rdx, rax
call fcn.180020e28
mov rdx, qword [rbp + 0x17]
cmp rdx, 0x10
jb 0x1800410f2
mov rcx, qword [rbp - 1]
inc rdx
mov rax, rcx
cmp rdx, 0x1000
jb 0x1800410ed
mov rcx, qword [rcx - 8]
add rdx, 0x27
sub rax, rcx
add rax, 0xfffffffffffffff8
cmp rax, 0x1f
ja 0x18004123a
call fcn.180054638
cmp qword [r12 + 0x18], 0x10
jb 0x1800410fe
mov r12, qword [r12]
cmp qword [rbp - 0x59], 0x10
lea rcx, [rbp - 0x71]
mov r8, qword [rbp - 0x61]
jb 0x180041116
mov rdx, qword [rbp - 0x71]
add r8, rdx
jmp 0x18004111d
add r8, rcx
lea rdx, [rbp - 0x71]
sub r8, rdx
mov rcx, r12
call fcn.180056680
mov dword [r13 + 0x70], 8
lea rax, [0x1800c1050]
mov qword [r15 + 8], rax
mov byte [r13 + 0x74], 1
mov dword [r15], r14d
test rsi, rsi
je 0x18004116f
mov eax, edi
lock xadd dword [rsi + 8], eax
add eax, edi
jne 0x18004116f
mov rax, qword [rsi]
mov rcx, rsi
call qword [rax]
mov eax, edi
lock xadd dword [rsi + 0xc], eax
add eax, edi
jne 0x18004116f
mov rax, qword [rsi]
mov rcx, rsi
call qword [rax + reloc.WS2_32.dll_htonl]
mov rbx, qword [rbp + 0x7f]
mov rdx, qword [rbp - 0x59]
cmp rdx, 0x10
jb 0x1800411ae
mov rcx, qword [rbp - 0x71]
inc rdx
mov rax, rcx
cmp rdx, 0x1000
jb 0x1800411a9
mov rcx, qword [rcx - 8]
add rdx, 0x27
sub rax, rcx
add rax, 0xfffffffffffffff8
cmp rax, 0x1f
ja 0x18004122e
call fcn.180054638
mov rbx, qword [rbx + 8]
mov qword [rbp - 0x61], r14
mov qword [rbp - 0x59], reloc.WS2_32.dll_ntohs
mov byte [rbp - 0x71], r14b
test rbx, rbx
je 0x180041210
jmp 0x1800411e9
call fcn.180034d4c
mov dword [r15], 0x18
mov qword [r15 + 8], rax
mov rax, qword [rbp + 0x7f]
mov rbx, qword [rax + 8]
test rbx, rbx
je 0x180041210
or edi, 0xffffffff
mov eax, edi
lock xadd dword [rbx + 8], eax
add eax, edi
jne 0x180041210
mov rax, qword [rbx]
mov rcx, rbx
call qword [rax]
mov eax, edi
lock xadd dword [rbx + 0xc], eax
add eax, edi
jne 0x180041210
mov rax, qword [rbx]
mov rcx, rbx
call qword [rax + reloc.WS2_32.dll_htonl]
mov rbx, qword [rsp + 0xf8]
mov rax, r15
add rsp, 0xb0
pop r15
pop r14
pop r13
pop r12
pop rdi
pop rsi
pop rbp
ret
call fcn.18005affc
int3
call fcn.18005affc
int3
call fcn.18005affc
int3