Function at 0x78c660
Capabilities:
Encode data using xor

Disassembly:
push r15
push r14
push r13
push r12
push rbp
push rdi
push rsi
push rbx
sub rsp, 0x58
cmp byte [rcx + 0xb8d], 0
mov ebp, dword [rdx + 0x18]
mov qword [rsp + 0xb0], r8
mov rbx, rcx
mov rsi, rdx
mov r15, r9
je 0x78cdd9
sub ebp, dword [rdx + 0x1c]
jmp 0x78c7b7
lea r9, [rsp + 0x48]
lea r8, [rsp + 0x4c]
mov rdx, rsi
mov rcx, rbx
call fcn.0078d670
mov r12d, dword [rbx + 0x2e0]
mov r8d, dword [rbx + 0xb90]
mov edx, dword [rsp + 0x4c]
mov edi, dword [rsp + 0x48]
and r8d, ebp
mov rcx, r12
mov r11, r12
mov eax, r8d
shl rcx, 4
lea rcx, [rcx + rax + 0x35ce]
mov rax, qword [rbx + 0x18]
add rcx, rcx
lea r14, [rbx + rcx]
lea r13, [rax + 1]
cmp edx, 0xffffffff
je 0x78ca40
lea r10, [rbx + rax*4]
lea r9, [rbx + rax*8]
lea r12, [r12 + r12 + 0x6d1c]
mov dword [r10 + 0x28], 1
mov qword [r9 + 0x110], r14
lea r14, [rbx + r12]
mov qword [rbx + 0x18], r13
lea r13, [rax + 2]
cmp edx, 3
ja 0x78c860
mov dword [r10 + 0x2c], 1
mov qword [r9 + 0x118], r14
lea r14, [rax + 3]
mov qword [rbx + 0x18], r13
lea r13, [rbx + r12 + 0x18]
mov qword [rsp + 0x38], r14
lea r14, [rax + 4]
test edx, edx
jne 0x78cb18
xor eax, eax
cmp edi, 1
mov dword [r10 + 0x30], 0
setne al
mov qword [r9 + 0x120], r13
mov dword [r10 + 0x34], eax
lea rax, [rbx + rcx + 0x1e0]
mov qword [r9 + 0x128], rax
mov qword [rbx + 0x18], r14
cmp edi, 1
jne 0x78cba9
cmp r11d, 7
mov r9d, dword [rsi + 0x1c]
sbb eax, eax
and eax, 0xfffffffe
add eax, 0xb
mov dword [rbx + 0x2e0], eax
mov eax, 1
sub r9d, edi
add ebp, eax
mov dword [rsi + 0x1c], r9d
mov r9, qword [rsp + 0xc0]
mov rdx, qword [rsp + 0xb0]
mov r8, r15
mov rcx, rbx
call fcn.0078bef0
test al, al
jne 0x78cdb8
cmp dword [rsp + 0xc8], 0xffffffff
mov eax, dword [rsi + 0x18]
je 0x78c812
mov edx, eax
sub edx, dword [rsi + 0x1c]
cmp edx, dword [rsp + 0xc8]
jae 0x78cd59
mov rcx, qword [r15]
mov rdx, qword [rbx + 8]
lea rdx, [rcx + rdx + 4]
cmp rdx, 0xeffe
ja 0x78cd59
cmp dword [rsi + 0x20], eax
ja 0x78c82d
mov edx, dword [rsi + 0x68]
test edx, edx
je 0x78cdb8
mov eax, dword [rsi + 0x1c]
test eax, eax
je 0x78ce79
cmp byte [rbx + 0xb8c], 0
jne 0x78c6a0
mov dword [rsp + 0x20], ebp
lea r9, [rsp + 0x48]
mov rdx, rsi
mov rcx, rbx
lea r8, [rsp + 0x4c]
call fcn.0078db60
jmp 0x78c6b5
cmp r11d, 7
mov dword [r10 + 0x2c], 0
lea r12d, [rdx - 4]
mov rcx, rbx
sbb eax, eax
mov qword [r9 + 0x118], r14
lea rdx, [rbx + 0x7200]
mov r9d, edi
and eax, 0xfffffffd
mov qword [rbx + 0x18], r13
add eax, 0xa
mov dword [rbx + 0x2e0], eax
movzx eax, byte [rbx + 0xb8c]
mov dword [rsp + 0x20], eax
call fcn.0078c490
cmp r12d, 0x1fff
jbe 0x78cbf0
mov eax, r12d
cmp r12d, 0x1ffffff
jbe 0x78cca0
mov rdx, qword [0x02471fa0]
shr eax, 0x18
movzx r9d, byte [rdx + rax]
add r9d, 0x30
cmp edi, 5
mov eax, 5
mov r14, qword [rbx + 0x18]
mov r8d, 1
cmovbe eax, edi
lea r11, [r14 + 6]
lea r13d, [r14 + 5]
lea r10d, [rax - 2]
mov rax, r14
shl r10, 7
add r10, 0x6efc
nop dword [rax]
mov ecx, r13d
mov edx, r9d
sub ecx, eax
shr edx, cl
mov ecx, r8d
lea rcx, [r10 + rcx*2]
and edx, 1
add rcx, rbx
mov dword [rbx + rax*4 + 0x28], edx
lea r8d, [rdx + r8*2]
mov qword [rbx + rax*8 + 0x110], rcx
add rax, 1
cmp rax, r11
jne 0x78c908
mov qword [rbx + 0x18], rax
cmp r9d, 3
jbe 0x78c9fa
mov ecx, r9d
mov edx, r9d
and ecx, 1
shr edx, 1
mov eax, ecx
lea ecx, [rdx - 1]
or eax, 2
shl eax, cl
mov ecx, eax
mov eax, r12d
sub eax, ecx
cmp r9d, 0xd
jbe 0x78cce0
mov r8d, eax
lea ecx, [rdx - 5]
lea r9, [rbx + r14*4 + 0x40]
shr r8d, 4
nop dword [rax + rax]
sub ecx, 1
mov r10d, r8d
add r9, 4
shr r10d, cl
and r10d, 1
add r10d, 2
mov dword [r9 - 4], r10d
test ecx, ecx
jne 0x78c980
sub edx, 6
and eax, 0xf
mov ecx, 1
add r11, rdx
lea r13, [rbx + 0x71e0]
lea rdx, [r11 + 2]
lea r10, [r11 + 6]
nop word [rax + rax]
mov r8d, eax
mov r9d, ecx
shr eax, 1
and r8d, 1
lea r9, [r13 + r9*2]
mov dword [rbx + rdx*4 + 0x24], r8d
lea ecx, [r8 + rcx*2]
mov qword [rbx + rdx*8 + 0x108], r9
add rdx, 1
cmp r10, rdx
jne 0x78c9c0
add r11, 5
add dword [rbx + 0x10ed8], 1
mov qword [rbx + 0x18], r11
mov eax, dword [rbx + 0x2ec]
add dword [rbx + 0x10e94], 1
mov r9d, dword [rsi + 0x1c]
mov dword [rbx + 0x2f0], eax
mov eax, dword [rbx + 0x2e8]
mov dword [rbx + 0x2ec], eax
mov eax, dword [rbx + 0x2e4]
mov dword [rbx + 0x2e4], r12d
mov dword [rbx + 0x2e8], eax
mov eax, dword [rsp + 0x48]
jmp 0x78c7ae
mov r8d, dword [rsi + 0x18]
mov r9d, dword [rsi + 0x1c]
mov dword [rbx + rax*4 + 0x28], 0
mov qword [rbx + rax*8 + 0x110], r14
mov r14d, dword [rbx + 0xb94]
mov ecx, r8d
mov qword [rbx + 0x18], r13
mov r13, qword [rsi]
sub ecx, r9d
mov r10d, dword [rbx + 0xb98]
mov edx, ecx
sub ecx, 1
movzx r12d, byte [r13 + rcx]
mov ecx, 8
and r10d, ebp
movzx edx, byte [r13 + rdx]
sub ecx, r14d
sar r12d, cl
mov ecx, r14d
shl r10d, cl
lea ecx, [r12 + r10]
lea rcx, [rcx + rcx*2]
shl rcx, 9
lea r12, [rbx + rcx + 0xb9c]
cmp r11d, 6
ja 0x78cc08
lea r10, [rax + 2]
mov r13d, 1
mov ecx, 8
nop dword [rax]
sub ecx, 1
mov r8d, edx
mov r14d, r13d
shr r8d, cl
lea r14, [r12 + r14*2]
and r8d, 1
mov dword [rbx + r10*4 + 0x24], r8d
lea r13d, [r8 + r13*2]
mov qword [rbx + r10*8 + 0x108], r14
add r10, 1
test ecx, ecx
jne 0x78cac8
add rax, 9
mov qword [rbx + 0x18], rax
cmp r11d, 3
ja 0x78cd50
mov dword [rbx + 0x2e0], ecx
mov eax, edi
jmp 0x78c7ae
mov ecx, edx
mov ecx, dword [rbx + rcx*4 + 0x2e4]
mov dword [r10 + 0x30], 1
mov qword [r9 + 0x120], r13
lea r13, [rax + 3]
mov qword [rbx + 0x18], r13
lea r13, [rbx + r12 + 0x30]
cmp edx, 1
je 0x78ccc0
mov dword [r10 + 0x34], 1
add rax, 5
mov qword [r9 + 0x128], r13
lea r13d, [rdx - 2]
mov dword [r10 + 0x38], r13d
lea r10, [rbx + r12 + 0x48]
mov qword [r9 + 0x130], r10
mov qword [rbx + 0x18], rax
cmp edx, 3
jne 0x78cb82
mov eax, dword [rbx + 0x2ec]
mov dword [rbx + 0x2f0], eax
mov eax, dword [rbx + 0x2e8]
mov dword [rbx + 0x2ec], eax
mov eax, dword [rbx + 0x2e4]
mov dword [rbx + 0x2e4], ecx
mov dword [rbx + 0x2e8], eax
cmp edi, 1
je 0x78c793
movzx eax, byte [rbx + 0xb8c]
mov r9d, edi
lea rdx, [rbx + 0xba48]
mov rcx, rbx
mov dword [rsp + 0x20], eax
call fcn.0078c490
cmp dword [rbx + 0x2e0], 7
mov r9d, dword [rsi + 0x1c]
sbb eax, eax
and eax, 0xfffffffd
add eax, 0xb
mov dword [rbx + 0x2e0], eax
mov eax, dword [rsp + 0x48]
jmp 0x78c7ae
mov rdx, qword [0x02471fa0]
mov eax, r12d
movzx r9d, byte [rdx + rax]
jmp 0x78c8d6
sub r8d, 1
add edx, 0x100
add rax, 2
mov ecx, 0x100
sub r8d, r9d
sub r8d, dword [rbx + 0x2e4]
movzx r8d, byte [r13 + r8]
nop dword [rax + rax]
mov r10d, edx
add r8d, r8d
mov r13d, edx
add edx, edx
shr r10d, 7
shr r13d, 8
and r10d, 1
mov dword [rbx + rax*4 + 0x24], r10d
mov r10d, r8d
and r10d, ecx
add r10d, r13d
add r10d, ecx
lea r10, [r12 + r10*2]
mov qword [rbx + rax*8 + 0x108], r10
mov r10d, r8d
xor r10d, edx
not r10d
and ecx, r10d
mov r10, rax
add rax, 1
cmp edx, 0xffff
jbe 0x78cc30
mov qword [rbx + 0x18], r10
cmp r11d, 9
jbe 0x78cd50
lea ecx, [r11 - 6]
jmp 0x78cb07
mov rdx, qword [0x02471fa0]
shr eax, 0xc
movzx r9d, byte [rdx + rax]
add r9d, 0x18
jmp 0x78c8d6
mov dword [r10 + 0x34], 0
mov qword [r9 + 0x128], r13
mov qword [rbx + 0x18], r14
jmp 0x78cb8e
sub rcx, r9
lea r13d, [rdx - 2]
lea r11, [rbx + 0x70fc]
mov r8d, 1
lea r10, [rcx + rcx - 2]
lea rcx, [r14 + 7]
mov qword [rsp + 0x38], rcx
lea r14, [r14 + r13 + 8]
mov rdx, rcx
nop word [rax + rax]
mov ecx, r8d
mov r9d, eax
shr eax, 1
lea rcx, [r10 + rcx*2]
and r9d, 1
add rcx, r11
mov dword [rbx + rdx*4 + 0x24], r9d
lea r8d, [r9 + r8*2]
mov qword [rbx + rdx*8 + 0x108], rcx
add rdx, 1
cmp r14, rdx
jne 0x78cd10
add r13, qword [rsp + 0x38]
mov qword [rbx + 0x18], r13
jmp 0x78c9fa
lea ecx, [r11 - 3]
jmp 0x78cb07
cmp byte [rbx + 0xb8e], 0
jne 0x78cdcb
mov byte [rbx + 0xb8e], 1
mov rax, qword [rbx + 0x18]
lea rdx, [rbx + rax*4]
add rax, 5
mov r9, qword [rsp + 0xc0]
mov r8, r15
movabs rcx, 0x400000004
mov dword [rdx + 0x38], 4
mov qword [rdx + 0x28], rcx
mov qword [rdx + 0x30], rcx
mov rdx, qword [rsp + 0xb0]
mov rcx, rbx
mov qword [rbx + 0x18], rax
call fcn.0078bef0
test al, al
je 0x78cdcb
nop dword [rax]
xor eax, eax
add rsp, 0x58
pop rbx
pop rsi
pop rdi
pop rbp
pop r12
pop r13
pop r14
pop r15
ret
mov byte [rbx + 0xb8e], 0
mov eax, 1
jmp 0x78cdba
cmp dword [rdx + 0x20], ebp
je 0x78d0b9
mov edx, 1
mov rcx, rsi
call qword [rsi + 0x38]
mov r11, qword [rbx + 0x18]
mov r8d, 1
lea rax, [rbx + 0x6b9c]
mov dword [rsi + 0x1c], 0
lea r9, [rbx + 0xb9c]
mov ecx, 8
mov dword [rbx + r11*4 + 0x28], 0
lea rdx, [r11 + 2]
mov qword [rbx + r11*8 + 0x110], rax
lea rax, [r11 + 1]
mov qword [rbx + 0x18], rax
mov rax, qword [rsi]
movzx r10d, byte [rax]
nop dword [rax]
sub ecx, 1
mov eax, r10d
mov edi, r8d
shr eax, cl
lea rdi, [r9 + rdi*2]
and eax, 1
mov dword [rbx + rdx*4 + 0x24], eax
lea r8d, [rax + r8*2]
mov qword [rbx + rdx*8 + 0x108], rdi
add rdx, 1
test ecx, ecx
jne 0x78ce38
add r11, 9
mov ebp, dword [rsi + 0x18]
mov qword [rbx + 0x18], r11
mov byte [rbx + 0xb8d], 1
jmp 0x78c7b7
cmp byte [rbx + 0xb8e], 0
jne 0x78cdcb
cmp dword [rsp + 0xc8], 0xffffffff
mov rax, qword [rbx + 0x18]
mov byte [rbx + 0xb8e], 1
jne 0x78cd6d
mov r10d, dword [rbx + 0x2e0]
and ebp, dword [rbx + 0xb90]
lea r8, [rbx + rax*4]
lea rdi, [rax*8]
mov r9d, ebp
lea rdx, [rbx + rdi]
mov dword [r8 + 0x28], 1
movzx esi, byte [rbx + 0xb8c]
mov rcx, r10
mov r11, r10
lea r10, [rbx + r10*2 + 0x6d1c]
shl r11, 4
cmp ecx, 7
lea rdi, [rbx + rdi + 0x18]
sbb ecx, ecx
lea r11, [r11 + r9 + 0x35ce]
and ecx, 0xfffffffd
lea r11, [rbx + r11*2]
add ecx, 0xa
mov qword [rdx + 0x110], r11
mov r11, r9
mov dword [r8 + 0x2c], 0
shl r11, 4
mov qword [rdx + 0x118], r10
lea r10, [rbx + 0x7200]
add r11, 4
mov dword [rbx + 0x2e0], ecx
lea rcx, [rbx + rax*4 + 0x34]
mov dword [r8 + 0x30], 0
mov r8d, 1
mov qword [rdx + 0x120], r10
mov qword [rcx], 0
mov dword [rcx + 8], 0
mov ecx, r8d
add rdx, 8
add r8d, r8d
lea rcx, [r11 + rcx*2]
add rcx, r10
mov qword [rdx + 0x120], rcx
cmp rdx, rdi
jne 0x78cf52
lea r8, [rax + 6]
mov qword [rbx + 0x18], r8
test sil, sil
jne 0x78cf92
add r9, 0x1200
sub dword [rbx + r9*4 + 0x7208], 1
je 0x78d0cc
mov rax, qword [0x02471fa0]
lea r11, [r8 + 6]
mov r10d, 1
lea rdi, [rbx + 0x6efc]
lea esi, [r8 + 5]
movzx r9d, byte [rax + 0xff]
mov rax, r8
add r9d, 0x30
nop dword [rax]
mov ecx, esi
mov edx, r9d
sub ecx, eax
shr edx, cl
mov ecx, r10d
and edx, 1
lea rcx, [rdi + rcx*2]
mov dword [rbx + rax*4 + 0x28], edx
lea r10d, [rdx + r10*2]
mov qword [rbx + rax*8 + 0x110], rcx
add rax, 1
cmp rax, r11
jne 0x78cfc0
mov r10d, r9d
mov eax, r9d
lea r8, [rbx + r8*4 + 0x40]
shr r10d, 1
and eax, 1
lea ecx, [r10 - 1]
or eax, 2
shl eax, cl
lea ecx, [r10 - 5]
not eax
mov r9d, eax
shr r9d, 4
sub ecx, 1
mov edx, r9d
add r8, 4
shr edx, cl
and edx, 1
add edx, 2
mov dword [r8 - 4], edx
test ecx, ecx
jne 0x78d013
lea edx, [r10 - 6]
and eax, 0xf
lea rsi, [rbx + 0x71e0]
mov r8d, 1
add r11, rdx
mov ecx, eax
lea rdx, [r11 + 1]
lea rax, [r11 + 5]
mov r9d, ecx
mov r10d, r8d
shr ecx, 1
and r9d, 1
lea r10, [rsi + r10*2]
mov dword [rbx + rdx*4 + 0x28], r9d
lea r8d, [r9 + r8*2]
mov qword [rbx + rdx*8 + 0x110], r10
add rdx, 1
cmp rax, rdx
jne 0x78d04e
mov edx, dword [rbx + 0x2ec]
add dword [rbx + 0x10ed8], 1
add dword [rbx + 0x10e94], 1
mov dword [rbx + 0x2f0], edx
mov edx, dword [rbx + 0x2e8]
mov dword [rbx + 0x2ec], edx
mov edx, dword [rbx + 0x2e4]
mov dword [rbx + 0x2e4], 0xffffffff
mov dword [rbx + 0x2e8], edx
jmp 0x78cd6d
mov ecx, dword [rdx + 0x68]
test ecx, ecx
je 0x78cdb8
sub ebp, dword [rdx + 0x1c]
jmp 0x78ce6d
mov edx, ebp
mov rcx, r10
call fcn.0078c140
mov r8, qword [rbx + 0x18]
jmp 0x78cf92