Function at 0x18017fd64
Capabilities:
Encode data using xor

Disassembly:
push r15
push r14
push r13
push r12
push rsi
push rdi
push rbp
push rbx
sub rsp, 0x58
mov r14d, r9d
mov r15, r8
mov edi, edx
mov rsi, rcx
mov ebp, dword [rsp + 0xd8]
mov ecx, ebp
call fcn.18010df24
mov r12d, eax
test eax, eax
jne 0x180180060
mov ecx, dword [rsp + 0xd0]
call fcn.1802afaf4
mov r12d, eax
test eax, eax
jne 0x180180060
mov eax, dword [rsp + 0xc0]
movsxd rcx, ebp
imul rcx, rcx, 0x78
lea rdx, [0x180611330]
mov edx, dword [rcx + rdx + 0xc]
mov ebx, eax
shr ebx, 3
and eax, 7
cmp eax, 1
sbb ebx, 0xffffffff
lea ecx, [rdx + rdx]
lea eax, [rbx - 2]
mov r12d, 0x20012
sub eax, ecx
jbe 0x180180060
cmp eax, edi
jb 0x180180060
mov dword [rsp + 0x4c], ecx
mov qword [rsp + 0x50], rbx
mov ebx, ebx
mov rcx, rbx
mov r12, rdx
call fcn.1802fb6e2
mov r13, rax
mov rcx, rbx
call fcn.1802fb6e2
mov qword [rsp + 0x30], rax
mov qword [rsp + 0x40], r12
mov rcx, r12
mov rbx, r13
call fcn.1802fb6e2
test r13, r13
mov qword [rsp + 0x38], rax
je 0x18017fe3f
cmp qword [rsp + 0x30], 0
je 0x18017fe3f
test rax, rax
jne 0x18017fe7f
test rbx, rbx
je 0x18017fe51
mov rcx, rbx
call fcn.1802fbeb6
mov rax, qword [rsp + 0x38]
cmp qword [rsp + 0x30], 0
je 0x18017fe68
mov rcx, qword [rsp + 0x30]
call fcn.1802fbeb6
mov rax, qword [rsp + 0x38]
mov r12d, 0xc
test rax, rax
je 0x180180060
mov rcx, rax
jmp 0x18018005b
mov r13, qword [rsp + 0x50]
mov dword [rsp + 0x2c], r13d
lea rax, [rsp + 0x2c]
test r15, r15
je 0x18017fea2
mov qword [rsp + 0x20], rax
mov ecx, ebp
mov rdx, r15
mov r8d, r14d
jmp 0x18017feaf
mov qword [rsp + 0x20], rax
mov ecx, ebp
mov rdx, rbx
xor r8d, r8d
mov r9, rbx
call fcn.180218554
mov r15, rbx
mov r12d, eax
test eax, eax
jne 0x180180044
mov r12, qword [rsp + 0xc8]
mov r14, qword [rsp + 0x40]
mov dword [rsp + 0x2c], r14d
mov ebx, 0xfffffffe
sub ebx, edi
add ebx, r13d
sub ebx, dword [rsp + 0x4c]
lea rcx, [r15 + r14]
xor edx, edx
mov r8, rbx
call fcn.1802f6e84
mov eax, dword [rsp + 0x2c]
mov ecx, ebx
add ecx, eax
lea eax, [rax + rbx]
add eax, 1
mov dword [rsp + 0x2c], eax
mov byte [r15 + rcx], 1
mov r8d, edi
mov ecx, dword [rsp + 0x2c]
add rcx, r15
mov rdx, rsi
call fcn.18017fd34
add dword [rsp + 0x2c], edi
movsxd rax, dword [rsp + 0xd0]
lea rbx, [rax + rax*4]
shl rbx, 4
lea rax, [0x18060ebb0]
mov rcx, qword [rsp + 0x38]
mov edx, r14d
mov r8, r12
call qword [rbx + rax + 0x28]
mov r12d, 0x20007
cmp eax, r14d
jne 0x180180044
mov r8, qword [rsp + 0x40]
mov esi, r8d
not esi
add esi, r13d
mov dword [rsp + 0x20], esi
mov ecx, ebp
mov rdx, qword [rsp + 0x38]
mov r9, qword [rsp + 0x30]
call fcn.18020dba4
mov r12d, eax
test eax, eax
jne 0x180180044
test esi, esi
je 0x18017ff9e
mov eax, esi
xor ecx, ecx
mov rdx, qword [rsp + 0x30]
mov dl, byte [rdx + rcx]
xor byte [r15 + rcx], dl
inc rcx
cmp rcx, rax
jne 0x18017ff8a
mov rax, qword [rsp + 0x40]
mov dword [rsp + 0x20], eax
mov ecx, ebp
mov rdx, r15
mov r8d, esi
mov r9, qword [rsp + 0x30]
call fcn.18020dba4
mov r12d, eax
test eax, eax
jne 0x180180044
mov rdi, qword [rsp + 0xe8]
mov rbp, qword [rsp + 0x40]
test ebp, ebp
mov rdx, qword [rsp + 0x38]
je 0x18017ffef
xor eax, eax
mov rcx, qword [rsp + 0x30]
mov cl, byte [rcx + rax]
xor byte [rdx + rax], cl
inc rax
cmp rax, rbp
jne 0x18017ffdc
cmp dword [rdi], r13d
jae 0x18017ffff
mov dword [rdi], r13d
mov r12d, 0x20004
jmp 0x180180044
mov rbx, qword [rsp + 0xe0]
mov dword [rsp + 0x2c], 1
mov byte [rbx], 0
lea rcx, [rbx + 1]
mov r8, rbp
call fcn.18017fd34
add ebp, dword [rsp + 0x2c]
mov dword [rsp + 0x2c], ebp
mov r8d, esi
add rbp, rbx
mov rcx, rbp
mov rdx, r15
call fcn.18017fd34
add esi, dword [rsp + 0x2c]
mov dword [rsp + 0x2c], esi
mov dword [rdi], esi
xor r12d, r12d
mov rcx, qword [rsp + 0x38]
call fcn.1802fbeb6
mov rcx, qword [rsp + 0x30]
call fcn.1802fbeb6
mov rcx, r15
call fcn.1802fbeb6
mov eax, r12d
add rsp, 0x58
pop rbx
pop rbp
pop rdi
pop rsi
pop r12
pop r13
pop r14
pop r15
ret