Function at 0x180037d40
Capabilities:
Encode data using xor

Disassembly:
push rbp
push r15
push r14
push r13
push r12
push rsi
push rdi
push rbx
sub rsp, 0xb8
lea rbp, [rsp + 0x80]
mov qword [rbp + 0x30], 0xfffffffffffffffe
mov qword [rbp - 0x50], r8
cmp qword [rcx + 0x18], 0
je 0x180038108
mov rdi, r8
mov r15, rdx
lea rax, [rcx + 0x20]
lea rdx, [rbp - 0x50]
mov rsi, rcx
mov rcx, rax
call fcn.18005c9e0
mov rcx, qword [rsi]
mov rdx, qword [rsi + 8]
mov r8, rdx
and r8, rax
shr rax, 0x39
movd xmm0, eax
punpcklbw xmm0, xmm0
pshuflw xmm0, xmm0, 0
pshufd xmm0, xmm0, 0
lea rax, [rcx - 0x48]
xor r9d, r9d
pcmpeqd xmm1, xmm1
movdqu xmm2, xmmword [rcx + r8]
movdqa xmm3, xmm2
pcmpeqb xmm3, xmm0
pmovmskb r10d, xmm3
test r10d, r10d
je 0x180037e05
nop word cs:[rax + rax]
tzcnt r11d, r10d
add r11, r8
and r11, rdx
neg r11
lea r11, [r11 + r11*8]
cmp qword [rax + r11*8], rdi
je 0x180037e27
lea r11d, [r10 - 1]
and r11w, r10w
mov r10d, r11d
jne 0x180037de0
pcmpeqb xmm2, xmm1
pmovmskb r10d, xmm2
test r10d, r10d
jne 0x180038108
add r8, r9
add r8, 0x10
add r9, 0x10
and r8, rdx
jmp 0x180037db9
mov r14, qword [rcx + r11*8 - 0x38]
mov rax, qword [rcx + r11*8 - 0x30]
lea rax, [rax + rax*2]
shl rax, 4
add rax, r14
mov qword [rbp - 0x40], rax
mov qword [rbp - 0x38], r15
jmp 0x180037e58
mov r14, qword [rbp - 0x48]
mov r15, qword [rbp - 0x38]
cmp r14, qword [rbp - 0x40]
je 0x180038108
lea r12, [r14 + 0x30]
mov rsi, qword [r14 + 0x10]
test rsi, rsi
js 0x18003811c
mov rdi, qword [r14 + 8]
mov qword [rbp - 0x48], r12
je 0x180037ea0
movzx eax, byte [0x18028ecd1]
mov ebx, 1
mov edx, 1
mov rcx, rsi
call fcn.18006a570
test rax, rax
jne 0x180037ea5
jmp 0x18003811e
mov eax, 1
mov qword [rbp + 0x18], rax
mov rcx, rax
mov rdx, rdi
mov qword [rbp + 0x20], rsi
mov r8, rsi
call sub.VCRUNTIME140.dll_memcpy
mov rcx, r15
call fcn.18003bb00
mov r12, rax
mov rcx, r15
call fcn.18003b000
mov r13d, eax
mov ebx, edx
mov rax, qword [0x180277178]
movzx eax, byte [rax]
test al, al
je 0x180037f60
mov eax, 1
mov ecx, 0x20000001
lock cmpxchg dword [0x18028e7f0], ecx
mov esi, 1
mov r15d, 1
lea rdi, [0x18028e7f0]
je 0x180037ff0
cmp eax, 0x100
jae 0x180037f35
mov ecx, eax
or ecx, 0x20000000
mov r15d, eax
lock cmpxchg dword [0x18028e7f0], ecx
mov esi, r15d
lea rdi, [0x18028e7f0]
je 0x180037ff0
mov byte [rbp + 0x2f], 0
lea rcx, [rbp - 0x18]
lea rdx, [0x18028e7f0]
lea r8, [rbp + 0x2e]
mov r9, r8
call fcn.180184750
mov rdi, qword [rbp - 0x10]
mov r15d, dword [rbp - 8]
mov esi, dword [rbp - 4]
jmp 0x180037ff0
mov eax, 1
mov ecx, 0x20000001
lock cmpxchg dword [0x18028e7f0], ecx
jne 0x180037f88
mov esi, 1
mov r15d, 1
lea rdi, [0x18028e7f0]
jmp 0x180037ff0
mov r15d, eax
cmp eax, 0x100
jae 0x180037fb2
mov ecx, r15d
or ecx, 0x20000000
mov eax, r15d
lock cmpxchg dword [0x18028e7f0], ecx
lea rdi, [0x18028e7f0]
mov esi, r15d
je 0x180037fd8
mov byte [rbp + 0x2f], 0
lea rcx, [rbp - 0x18]
lea rdx, [0x18028e7f0]
lea r8, [rbp + 0x2e]
mov r9, r8
call fcn.180184750
mov rdi, qword [rbp - 0x10]
mov r15d, dword [rbp - 8]
mov esi, dword [rbp - 4]
test sil, 1
je 0x1800380cc
nop word cs:[rax + rax]
lea rcx, [0x18028e780]
shr r12, 0x18
and r12d, 0xffffff
shl r13d, 4
shl ebx, 3
lea eax, [rbx + rbx*2]
mov qword [rbp - 0x30], rcx
mov qword [rbp - 0x28], rdi
mov dword [rbp - 0x20], r15d
mov dword [rbp - 0x1c], esi
add r13d, dword [r14 + 0x1c]
add eax, dword [r14 + 0x20]
movzx edx, word [r14 + 0x28]
movzx r8d, byte [r14 + 0x2a]
mov r9, qword [rbp + 0x20]
mov qword [rbp - 0x18], r9
mov r10, qword [rbp + 0x18]
mov qword [rbp - 0x10], r10
mov qword [rbp - 8], r9
mov byte [rbp + 2], r8b
mov word [rbp], dx
mov edx, r12d
shr edx, 0x10
mov byte [rbp + 5], dl
mov word [rbp + 3], r12w
mov dword [rbp + 8], r13d
mov dword [rbp + 0xc], eax
movabs rax, 0x100000000
mov qword [rbp + 0x10], rax
lea rdx, [rbp - 0x18]
call fcn.18002a850
mov eax, r15d
or eax, 0x20000000
lock cmpxchg dword [rdi], esi
je 0x180037e50
xor r15d, esi
or r15d, 0x20000000
mov eax, dword [rdi]
nop word cs:[rax + rax]
mov ecx, eax
xor ecx, r15d
lock cmpxchg dword [rdi], ecx
jne 0x1800380a0
cmp eax, 0x40000000
jb 0x180037e50
xor eax, r15d
mov byte [rbp + 0x2f], 1
mov rcx, rdi
mov edx, eax
call fcn.18018eaa0
jmp 0x180037e50
lea rax, [0x18028e780]
mov qword [rbp - 0x18], rax
mov qword [rbp - 0x10], rdi
mov dword [rbp - 8], r15d
mov dword [rbp - 4], esi
lea rcx, [rbp - 0x30]
lea rdx, [rbp - 0x18]
call fcn.18018be00
mov rcx, qword [rbp - 0x30]
mov rdi, qword [rbp - 0x28]
test rcx, rcx
je 0x180038129
mov r15d, dword [rbp - 0x20]
mov esi, dword [rbp - 0x1c]
jmp 0x180037ff7
add rsp, 0xb8
pop rbx
pop rdi
pop rsi
pop r12
pop r13
pop r14
pop r15
pop rbp
ret
xor ebx, ebx
mov rcx, rbx
mov rdx, rsi
call fcn.18019deb5
mov dword [rbp - 0x18], edi
mov byte [rbp + 0x2f], 0
lea rax, [0x1801a2fa8]
mov qword [rsp + 0x20], rax
lea rcx, [0x1801a3018]
lea r9, [0x1801a2ff8]
lea r8, [rbp - 0x18]
mov edx, 0x2b
call fcn.18019e500
ud2