Function at 0x1402a88a0
Capabilities:
Encrypt data using rc4 prga

Disassembly:
sub rsp, 0x38
mov r8, rcx
mov rcx, qword [rcx + 0x88]
movzx r9d, word [r8 + 0x44]
mov r10, qword [r8 + 0x38]
lea rax, [r10 + r9]
cmp rax, qword [rcx + 0x58]
ja 0x1402a88fd
movzx eax, word [rcx + 0x12]
add rax, qword [rcx + 0x50]
cmp r10, rax
jb 0x1402a88fd
mov eax, dword [rdx + 0x28]
add eax, dword [rdx + 0x24]
cmp r9d, eax
jne 0x1402a88f1
mov dword [rsp + 0x20], r9d
mov r8, rdx
xor r9d, r9d
mov rdx, r10
call fcn.1402a8940
add rsp, 0x38
ret
mov rcx, r8
add rsp, 0x38
jmp 0x1402a8a30
lea rax, [0x1403f4d04]
mov r9d, 0x137c9
lea r8, str.database_corruption
mov qword [rsp + 0x20], rax
lea rdx, str._s_at_line__d_of___.10s_
mov ecx, VariantTimeToDosDateTime
call fcn.1402608a0
mov eax, VariantTimeToDosDateTime
add rsp, 0x38
ret
push rbx
push rbp
push r13
push r15
sub rsp, 0x58
mov rax, qword [0x1404af540]
xor rax, rsp
mov qword [rsp + 0x38], rax
mov r15d, dword [rdx + 0x28]
mov r13, rdx
movzx eax, word [rcx + 0x44]
mov r8, rdx
add r15d, dword [rdx + 0x24]
mov rbx, rcx
mov rbp, qword [rcx + 0x88]
xor r9d, r9d
mov rdx, qword [rcx + 0x38]
mov rcx, rbp
mov dword [rsp + 0x20], eax
call fcn.1402a8940
test eax, eax
jne 0x1402a8c0a
mov rax, qword [rbx + 0x38]
mov qword [rsp + 0x90], rsi
mov qword [rsp + 0x50], rdi
movzx edi, word [rbx + 0x44]
mov qword [rsp + 0x48], r12
mov r12, qword [rbp + 0x48]
mov ebp, 0x64
mov qword [rsp + 0x40], r14
mov esi, dword [rdi + rax]
bswap esi
mov r14d, dword [r12 + 0x38]
sub r14d, 4
nop word [rax + rax]
mov rax, qword [r12]
lea r8, [rsp + 0x30]
xor r9d, r9d
mov edx, esi
mov rcx, rax
call qword [rax + 0x110]
test eax, eax
jne 0x1402a8bf3
mov rcx, qword [rsp + 0x30]
mov rbx, qword [rcx + 0x10]
cmp esi, dword [rbx + 4]
je 0x1402a8b0b
mov rax, qword [rcx + 8]
mov qword [rbx + 0x50], rax
xor eax, eax
cmp esi, 1
mov qword [rbx + 0x70], rcx
mov qword [rbx + 0x48], r12
cmove eax, ebp
mov dword [rbx + 4], esi
mov byte [rbx + 9], al
mov rax, qword [rbx + 0x70]
cmp dword [rax + 0x38], 1
jne 0x1402a8b52
cmp byte [rbx], 0
jne 0x1402a8b52
lea eax, [r14 + rdi]
cmp eax, r15d
jae 0x1402a8b2d
mov rax, qword [rbx + 0x50]
mov esi, dword [rax]
bswap esi
jmp 0x1402a8b33
mov r14d, r15d
sub r14d, edi
mov rdx, qword [rbx + 0x50]
mov r9d, edi
add rdx, 4
mov dword [rsp + 0x20], r14d
mov r8, r13
mov rcx, rbx
call fcn.1402a8940
mov ebp, eax
jmp 0x1402a8b81
lea rax, [0x1403f4d04]
mov r9d, 0x137ad
lea r8, str.database_corruption
mov qword [rsp + 0x20], rax
lea rdx, str._s_at_line__d_of___.10s_
mov ecx, VariantTimeToDosDateTime
call fcn.1402608a0
mov ebp, VariantTimeToDosDateTime
mov r8, qword [rbx + 0x70]
test r8, r8
je 0x1402a8bd8
test byte [r8 + 0x34], 0x20
je 0x1402a8bd0
mov r10, qword [r8 + 0x28]
dec dword [r10 + 0x98]
mov rax, qword [r10 + 0xa8]
mov qword [r8 + 0x20], rax
mov rcx, qword [r10 + 0x48]
mov qword [r10 + 0xa8], r8
mov edx, dword [r8 + 0x30]
mov r8, qword [r8 + 8]
dec edx
imul rdx, qword [r10 + 0xc8]
mov r9, qword [rcx]
call qword [r9 + 0x90]
jmp 0x1402a8bd8
mov rcx, r8
call fcn.14036ff60
test ebp, ebp
jne 0x1402a8bf1
add edi, r14d
mov ebp, 0x64
cmp edi, r15d
jl 0x1402a8ac0
xor eax, eax
jmp 0x1402a8bf3
mov eax, ebp
mov r12, qword [rsp + 0x48]
mov rdi, qword [rsp + 0x50]
mov rsi, qword [rsp + 0x90]
mov r14, qword [rsp + 0x40]
mov rcx, qword [rsp + 0x38]
xor rcx, rsp
call fcn.1403ca460
add rsp, 0x58
pop r15
pop r13
pop rbp
pop rbx
ret