Function at 0x180004820
Capabilities:
Encode data using xor

Disassembly:
mov qword [rsp + 0x18], r8
push rbp
push rsi
push rdi
push r12
push r14
lea rbp, [rsp - 0x70]
sub rsp, 0x170
xor edi, edi
mov r12, r8
mov r14d, edx
mov rsi, rcx
cmp edx, 0x40
jbe 0x180004aec
mov qword [rsp + 0x1a0], rbx
mov ebx, dword [0x18000a1a0]
add ebx, 7
shr ebx, 3
cmp ebx, 0x40
jb 0x180004ae4
lea r8, [rcx - 0x40]
lea rdx, [rbp + 0xa8]
lea rcx, [rsp + 0x70]
add r8, r14
call fcn.180006330
test eax, eax
jne 0x180004ae4
cmp dword [rbp + 0xa8], ebx
jne 0x180004ae4
cmp byte [rsp + 0x70], dil
jne 0x180004ae4
cmp byte [rsp + 0x71], 1
jne 0x180004ae4
lea edx, [rbx - 1]
mov ecx, 2
cmp edx, ecx
jbe 0x1800048ce
lea rax, [rsp + 0x72]
nop dword [rax]
cmp byte [rax], 0xff
jne 0x1800048ce
inc ecx
inc rax
cmp ecx, edx
jb 0x1800048c0
mov eax, ecx
inc ecx
cmp byte [rsp + rax + 0x70], dil
jne 0x180004ae4
mov edx, ebx
sub edx, ecx
lea eax, [rdx + 0xb]
cmp eax, ebx
ja 0x180004ae4
mov r8d, edx
mov eax, ecx
lea rdx, [rsp + 0x70]
lea rcx, [rsp + 0x40]
add rdx, rax
mov qword [rsp + 0x168], r13
call sub.ntdll.dll_memcpy
mov r13d, dword [rsp + 0x60]
add r14d, 0xffffffc0
cmp r13d, r14d
ja 0x180004adc
xor ecx, ecx
lea rax, [rsp + 0x50]
mov qword [rsp + 0x160], r15
nop dword [rax]
cmp byte [rax], dil
jne 0x180004972
inc ecx
inc rax
cmp ecx, 0x10
jb 0x180004930
mov rcx, qword [0x18000a270]
mov r8, r13
xor edx, edx
mov edi, r13d
call qword [sym.imp.KERNEL32.dll_HeapAlloc]
mov r15, rax
test rax, rax
jne 0x180004abb
mov r8, r13
mov rdx, rsi
xor ecx, ecx
call sub.ntdll.dll_memcpy
jmp 0x180004a78
and r14d, 0xfffffff0
test rsi, rsi
je 0x180004ad4
mov rcx, qword [0x18000a270]
mov r8d, r14d
xor edx, edx
call qword [sym.imp.KERNEL32.dll_HeapAlloc]
mov r15, rax
test rax, rax
je 0x180004ad4
lea rdx, [rsp + 0x50]
lea rcx, [rbp - 0x50]
call fcn.1800068d0
mov eax, r14d
shr eax, 4
test eax, eax
je 0x180004a69
lea rdi, [rsi + 0xc]
lea rbx, [r15 + 8]
mov r12d, eax
nop word [rax + rax]
mov r9d, dword [rdi - 0xc]
mov eax, dword [rdi - 4]
mov r10d, dword [rdi - 8]
sub r9d, dword [rbp + 0x58]
mov r11d, dword [rdi]
sub eax, dword [rbp + 0x5c]
mov esi, 0x13
nop word [rax + rax]
mov ecx, r11d
mov r11d, eax
mov eax, r10d
sub eax, dword [rbp + rsi*8 - 0x44]
mov r10d, r9d
mov r9d, ecx
sub r9d, dword [rbp + rsi*8 - 0x48]
lea r8d, [r10*2 + 1]
lea edx, [r11*2 + 1]
imul r8d, r10d
ror r8d, 5
imul edx, r11d
mov ecx, r8d
ror edx, 5
rol eax, cl
mov ecx, edx
xor eax, edx
rol r9d, cl
xor r9d, r8d
dec rsi
jns 0x1800049f0
sub r10d, dword [rbp - 0x50]
sub r11d, dword [rbp - 0x4c]
mov dword [rbx - 8], r9d
mov dword [rbx - 4], r10d
mov dword [rbx + 4], r11d
mov dword [rbx], eax
add rbx, 0x10
add rdi, 0x10
dec r12
jne 0x1800049d0
mov r12, qword [rbp + 0xb0]
lea eax, [r13 + 0xf]
and eax, 0xfffffff0
cmp r14d, eax
jne 0x180004abb
mov edi, r13d
lea r8, [rsp + 0x30]
mov edx, r13d
mov rcx, r15
call fcn.180004be0
mov eax, dword [rsp + 0x40]
cmp dword [rsp + 0x30], eax
jne 0x180004abb
mov eax, dword [rsp + 0x44]
cmp dword [rsp + 0x34], eax
jne 0x180004abb
mov eax, dword [rsp + 0x48]
cmp dword [rsp + 0x38], eax
jne 0x180004abb
mov eax, dword [rsp + 0x4c]
cmp dword [rsp + 0x3c], eax
jne 0x180004abb
mov qword [r12], r15
test r13d, r13d
jne 0x180004ad4
jmp 0x180004abd
xor edi, edi
test r15, r15
je 0x180004ad4
mov rcx, qword [0x18000a270]
mov r8, r15
xor edx, edx
call qword [sym.imp.KERNEL32.dll_HeapFree]
mov r15, qword [rsp + 0x160]
mov r13, qword [rsp + 0x168]
mov rbx, qword [rsp + 0x1a0]
mov eax, edi
add rsp, 0x170
pop r14
pop r12
pop rdi
pop rsi
pop rbp
ret