Function at 0x180012c6c
Capabilities:
Encrypt data using rc4 prga

Disassembly:
mov rax, rsp
mov qword [rax + 8], rbx
mov qword [rax + 0x10], rbp
mov qword [rax + 0x18], rsi
mov qword [rax + 0x20], r14
push r15
sub rsp, 0x20
cmp dword [rcx + 0x4838], 0
mov rsi, r8
movsxd rbp, r9d
mov r14, rdx
mov rbx, rcx
je 0x180012cc4
mov edx, dword [0x18019f3b4]
mov rax, qword gs:[0x58]
mov rax, qword [rax + rdx*8]
lea rdx, [0x1800b8e20]
mov ecx, 0xa20
mov qword [rcx + rax], rdx
xor eax, eax
jmp 0x180012f6b
cmp dword [rcx + 0x4824], 0x10
jge 0x180012cd2
call fcn.180012644
cmp dword [rbx + 0x483c], 0
jne 0x180012f1c
xor edx, edx
mov r8d, 0x80
mov rcx, r14
call sub.msvcrt.dll_memset
cmp dword [rbx + 0x4824], 0x10
jge 0x180012d00
mov rcx, rbx
call fcn.180012644
mov r9d, dword [rbx + 0x4820]
lea r15, [0x180000000]
mov eax, r9d
shr rax, 0x17
cmp byte [rax + rsi], 0xff
jae 0x180012d3e
movzx eax, byte [rax + rsi]
mov r8d, dword [rbx + 0x4824]
movzx ecx, byte [rax + rsi + 0x500]
cmp ecx, r8d
jg 0x180012d75
shl r9d, cl
sub r8d, ecx
jmp 0x180012dcf
mov ecx, r9d
lea rax, [rsi + 0x62c]
shr ecx, 0x10
mov r10d, 0xa
jmp 0x180012d5a
inc r10d
lea rax, [rax + 4]
cmp ecx, dword [rax]
jae 0x180012d53
mov r8d, dword [rbx + 0x4824]
cmp r10d, 0x11
jne 0x180012d94
lea eax, [r8 - 0x10]
mov dword [rbx + 0x4824], eax
mov edx, dword [0x18019f3b4]
mov rax, qword gs:[0x58]
mov rax, qword [rax + rdx*8]
lea rdx, [0x1800b8e38]
jmp 0x180012cb4
cmp r10d, r8d
jg 0x180012d75
movsxd rax, r10d
mov ecx, 0x20
sub ecx, r10d
mov r11d, r9d
shr r11d, cl
and r11d, dword [r15 + rax*4 + 0xb9230]
add r11d, dword [rsi + rax*4 + 0x64c]
cmp r11d, 0xff
ja 0x180012d75
sub r8d, r10d
movsxd rax, r11d
mov ecx, r10d
shl r9d, cl
mov dword [rbx + 0x4824], r8d
mov dword [rbx + 0x4820], r9d
mov al, byte [rax + rsi + 0x400]
movzx esi, al
cmp esi, 0xf
ja 0x180012d75
test al, al
je 0x180012e4e
cmp r8d, esi
jge 0x180012dfd
mov rcx, rbx
call fcn.180012644
mov r10d, dword [rbx + 0x4824]
cmp r10d, esi
jl 0x180012e4e
mov r9d, dword [rbx + 0x4820]
sub r10d, esi
mov edx, dword [r15 + rsi*4 + 0xb9230]
mov r8d, r9d
shr r9d, 0x1f
mov eax, edx
dec r9d
mov dword [rbx + 0x4824], r10d
and r9d, dword [r15 + rsi*4 + 0xb91a0]
mov ecx, esi
rol r8d, cl
not eax
and eax, r8d
and edx, r8d
add r9d, edx
mov dword [rbx + 0x4820], eax
jmp 0x180012e51
xor r9d, r9d
lea r8, [rbp*2]
mov eax, r9d
add r8, rbp
not eax
shl r8, 5
mov edx, dword [r8 + rbx + 0x46b8]
mov ecx, edx
not ecx
xor ecx, eax
js 0x180012ec1
test edx, edx
jns 0x180012e8f
test r9d, r9d
jns 0x180012e8f
xor ecx, ecx
mov eax, 0x80000000
sub eax, r9d
cmp edx, eax
setge cl
jmp 0x180012e9e
xor ecx, ecx
mov eax, 0x7fffffff
sub eax, r9d
cmp edx, eax
setle cl
test ecx, ecx
jne 0x180012ec1
mov edx, dword [0x18019f3b4]
mov rax, qword gs:[0x58]
mov rax, qword [rax + rdx*8]
lea rdx, str.bad_delta
jmp 0x180012cb4
lea esi, [rdx + r9]
mov r11d, 1
mov dword [r8 + rbx + 0x46b8], esi
mov ecx, dword [rbx + 0x4840]
shl r11w, cl
movzx ecx, si
movzx edx, r11w
call fcn.180011fc0
test eax, eax
jne 0x180012f0c
mov edx, dword [0x18019f3b4]
mov rax, qword gs:[0x58]
mov rax, qword [rax + rdx*8]
lea rdx, [0x1800b8e60]
jmp 0x180012cb4
movsx eax, si
movsx ecx, r11w
imul ecx, eax
mov word [r14], cx
jmp 0x180012f66
cmp dword [rbx + 0x4824], 1
jge 0x180012f2d
mov rcx, rbx
call fcn.180012644
mov eax, dword [rbx + 0x4824]
cmp eax, 1
jl 0x180012f66
mov edx, dword [rbx + 0x4820]
lea ecx, [rdx + rdx]
mov dword [rbx + 0x4820], ecx
lea ecx, [rax - 1]
mov dword [rbx + 0x4824], ecx
test edx, edx
jns 0x180012f66
mov ecx, dword [rbx + 0x4840]
mov edx, 1
shl dx, cl
add word [r14], dx
mov eax, 1
mov rbx, qword [rsp + 0x30]
mov rbp, qword [rsp + 0x38]
mov rsi, qword [rsp + 0x40]
mov r14, qword [rsp + 0x48]
add rsp, 0x20
pop r15
ret