Function at 0x140136990
Capabilities:
Encrypt data using rc4 ksa

Disassembly:
mov qword [rsp + 8], rbx
mov qword [rsp + 0x10], rsi
push rdi
sub rsp, 0x20
mov eax, dword [rcx + 0x60]
mov rbx, qword [rcx + 8]
mov rsi, rdx
add rax, qword [rcx + 0x38]
mov rdi, rcx
mov qword [rcx + 0x50], rax
cmp rbx, rdx
je 0x140136a6c
nop dword [rax]
dec byte [rbx]
jne 0x140136a43
movzx eax, byte [rbx + 1]
mov edx, dword [rbx + 4]
add rdx, qword [rdi + 0x38]
cmp byte [rdx], 0x40
setae cl
and al, 0x10
shl cl, 3
add cl, al
mov byte [rbx + 1], cl
mov eax, dword [rdx]
mov dword [rbx + 2], eax
movzx eax, word [rdx + 4]
mov word [rbx + 6], ax
mov rax, qword [rdi + 0x58]
cmp rdx, rax
je 0x140136a2c
mov dword [rdx], 0xffffffff
mov eax, dword [rdi + 0x128]
mov dword [rdx + 4], eax
movzx eax, byte [rdi + 0x80]
mov dword [rdx + 8], eax
sub edx, dword [rdi + 0x38]
inc dword [rdi + 0x1c0]
mov dword [rdi + 0x128], edx
movzx eax, byte [rbx + 3]
add eax, 0xb
shr eax, 3
mov byte [rbx + 3], al
jmp 0x140136a5c
add rax, 0xc
mov qword [rdi + 0x58], rax
movzx eax, byte [rbx + 3]
add eax, 0xb
shr eax, 3
mov byte [rbx + 3], al
jmp 0x140136a5c
movzx r8d, byte [rbx]
xor r9d, r9d
mov rdx, rbx
add r8d, 3
mov rcx, rdi
sar r8d, 1
call fcn.1401363c0
mov ebx, dword [rbx + 8]
add rbx, qword [rdi + 0x38]
cmp rbx, rsi
jne 0x1401369c0
cmp rbx, qword [rdi]
je 0x140136aca
movzx ecx, byte [rbx]
test cl, cl
jne 0x140136a88
movzx ecx, byte [rbx + 3]
movzx eax, cl
shr al, 1
sub cl, al
mov byte [rbx + 3], cl
jmp 0x140136abe
movzx eax, word [rbx + 2]
movzx r8d, cl
add eax, 4
lea ecx, [r8*4 + 0x80]
mov word [rbx + 2], ax
movzx eax, ax
cmp eax, ecx
jle 0x140136abe
add r8d, 2
mov r9d, 1
mov rdx, rbx
sar r8d, 1
mov rcx, rdi
call fcn.1401363c0
mov ebx, dword [rbx + 8]
add rbx, qword [rdi + 0x38]
cmp rbx, qword [rdi]
jne 0x140136a71
cmp dword [rdi + 0x64], 0
je 0x140136b99
xor r8d, r8d
lea rcx, [rdi + 0x81]
lea rdx, [rdi + 0x1c4]
lea r10d, [r8 + 0x13]
xor r9d, r9d
nop dword [rax]
movzx eax, byte [rcx - 1]
lea rdx, [rdx + 8]
lea rcx, [rcx + 2]
imul eax, dword [rdx - 0xc]
add r8d, eax
movzx eax, byte [rcx - 2]
imul eax, dword [rdx - 8]
add r9d, eax
dec r10
jne 0x140136af0
mov ecx, dword [rdi + 0x30]
add r8d, r9d
imul eax, r8d, 0xfffffff4
sub eax, dword [rdi + 0x58]
sub eax, dword [rdi + 0x48]
add eax, dword [rdi + 0x40]
add eax, ecx
shr ecx, 1
add eax, dword [rdi + 0x50]
cmp eax, ecx
jb 0x140136b99
mov rax, qword [rdi + 8]
cmp dword [rax + 8], r10d
je 0x140136b50
mov rcx, qword [rdi + 0x38]
nop
mov eax, dword [rax + 8]
add rax, rcx
mov qword [rdi + 8], rax
cmp dword [rax + 8], 0
jne 0x140136b40
mov rdx, qword [rdi + 8]
xor r8d, r8d
mov rcx, rdi
call fcn.1401356d0
mov rcx, rdi
call fcn.1401359a0
mov rcx, rdi
call fcn.140135ad0
mov ecx, dword [rdi + 0x30]
shr ecx, 2
lea ecx, [rcx + rcx*2]
cmp eax, ecx
ja 0x140136b50
mov eax, dword [rdi + 0x24]
mov dword [rdi + 0x34], 0
mov dword [rdi + 0x18], eax
mov rbx, qword [rsp + 0x30]
mov rsi, qword [rsp + 0x38]
add rsp, 0x20
pop rdi
ret
mov rcx, rdi
mov rbx, qword [rsp + 0x30]
mov rsi, qword [rsp + 0x38]
add rsp, 0x20
pop rdi
jmp fcn.140136740
push rbx
push rsi
push rdi
push r13
push r14
push r15
sub rsp, 0x38
xor esi, esi
mov rbx, rcx
mov rcx, qword [rcx + 0x10]
movzx r14d, byte [rcx + 1]
movzx r15d, word [rcx + 4]
movzx eax, word [rcx + 2]
movzx r13d, byte [rcx]
shl r15d, 0x10
mov dword [rsp + 0x88], r14d
or r15d, eax
mov r10d, esi
cmp r14b, 0x1f
jae 0x140136eb0
mov rax, qword [rbx]
mov ecx, dword [rax + 8]
test ecx, ecx
je 0x140136eb0
mov rax, qword [rbx + 0x38]
cmp byte [rax + rcx], sil
lea r9, [rax + rcx]
jne 0x140136e56
movzx eax, byte [r9 + 3]
lea r10, [r9 + 2]
cmp al, 0x20
jae 0x140136eb0
inc al
mov byte [r10 + 1], al
jmp 0x140136eb0
mov r10d, dword [r9 + 4]
add r10, rax
cmp byte [r10], r13b
je 0x140136e9b
add r10, 6
cmp byte [r10], r13b
jne 0x140136e62
movzx eax, byte [r10 - 5]
cmp byte [r10 + 1], al
jb 0x140136e9b
mov eax, dword [r10 - 6]
mov ecx, dword [r10]
movzx edx, word [r10 + 4]
mov dword [r10], eax
movzx eax, word [r10 - 2]
add r10, 0xfffffffffffffffa
mov word [r10 + 0xa], ax
mov dword [r10], ecx
mov word [r10 + 4], dx
movzx eax, byte [r10 + 1]
cmp al, 0x73
jae 0x140136eb0
add al, 2
mov byte [r10 + 1], al
add word [r9 + 2], 2
mov rdi, qword [rbx + 8]
cmp dword [rbx + 0x18], esi
jne 0x140136f1e
test r15d, r15d
je 0x140136f1e
mov r9, qword [rbx]
mov r8, r10
mov edx, 1
mov rcx, rbx
call fcn.140135460
mov rdx, rax
test rax, rax
jne 0x140136ef8
mov rax, qword [rbx + 0x10]
mov dword [rax + 2], esi
mov rdx, rdi
mov rcx, rbx
add rsp, 0x38
pop r15
pop r14
pop r13
pop rdi
pop rsi
pop rbx
jmp 0x140136990
mov ecx, eax
mov rax, qword [rbx + 0x10]
sub ecx, dword [rbx + 0x38]
mov word [rax + 2], cx
shr ecx, 0x10
mov word [rax + 4], cx
mov qword [rbx + 8], rdx
add rsp, 0x38
pop r15
pop r14
pop r13
pop rdi
pop rsi
pop rbx
ret
mov rcx, qword [rbx + 0x50]
mov rax, qword [rbx + 0x10]
movzx eax, byte [rax]
mov byte [rcx], al
inc qword [rbx + 0x50]
mov r11d, dword [rbx + 0x50]
sub r11d, dword [rbx + 0x38]
mov rcx, qword [rbx + 0x58]
mov dword [rsp + 0x78], r11d
cmp qword [rbx + 0x50], rcx
jae 0x140136ee0
test r15d, r15d
jne 0x140136f6b
mov r8, qword [rbx]
mov rdx, r10
mov rcx, rbx
call fcn.140136230
mov r15, rax
test rax, rax
je 0x140136ee0
sub r15d, dword [rbx + 0x38]
jmp 0x140136f96
mov eax, r15d
add rax, qword [rbx + 0x38]
cmp rax, rcx
jae 0x140136f9b
mov r9, qword [rbx]
mov r8, r10
xor edx, edx
mov rcx, rbx
call fcn.140135460
test rax, rax
je 0x140136ee0
sub eax, dword [rbx + 0x38]
mov r15d, eax
mov r11d, dword [rsp + 0x78]
dec dword [rbx + 0x18]
mov qword [rsp + 0x28], r12
jne 0x140136fbe
mov rax, qword [rbx]
mov rcx, rsi
mov r11d, r15d
cmp qword [rbx + 8], rax
mov dword [rsp + 0x78], r15d
setne cl
sub qword [rbx + 0x50], rcx
mov rax, qword [rbx]
mov qword [rsp + 0x30], rbp
movzx r12d, byte [rax]
movzx r10d, word [rax + 2]
sub r10d, r12d
sub r10d, r14d
cmp r13b, 0x40
setae sil
mov dword [rsp + 0x80], r10d
shl sil, 3
mov byte [rsp + 0x70], sil
cmp rdi, rax
je 0x14013726a
nop word [rax + rax]
movzx ebp, byte [rdi]
test ebp, ebp
je 0x1401370ea
test bpl, 1
je 0x1401370d4
lea esi, [rbp + 1]
shr esi, 1
movzx ecx, byte [rsi + rbx + 0xa6]
lea eax, [rsi - 1]
movzx r14d, byte [rax + rbx + 0xa6]
cmp r14d, ecx
je 0x1401370c7
lea edx, [r14 + 1]
mov rcx, rbx
call fcn.140135310
mov r9, rax
test rax, rax
je 0x14013725d
mov r8d, dword [rdi + 4]
mov rdx, rax
add r8, qword [rbx + 0x38]
sub rdx, r8
lea rcx, [r8 + 8]
mov eax, dword [rcx - 8]
lea rcx, [rcx + 0xc]
mov dword [rdx + rcx - 0x14], eax
mov eax, dword [rcx - 0x10]
mov dword [rdx + rcx - 0x10], eax
mov eax, dword [rcx - 0xc]
mov dword [rdx + rcx - 0xc], eax
dec esi
jne 0x140137061
mov r10d, dword [rsp + 0x80]
mov r11d, dword [rsp + 0x78]
mov dword [r8], 0xffffffff
mov eax, dword [rbx + r14*4 + 0x128]
mov dword [r8 + 4], eax
movzx eax, byte [r14 + rbx + 0x80]
mov dword [r8 + 8], eax
sub r8d, dword [rbx + 0x38]
inc dword [rbx + r14*4 + 0x1c0]
mov dword [rbx + r14*4 + 0x128], r8d
sub r9d, dword [rbx + 0x38]
mov dword [rdi + 4], r9d
mov r14d, dword [rsp + 0x88]
movzx esi, byte [rsp + 0x70]
lea eax, [rbp*2 + 1]
add eax, ebp
cmp eax, r12d
adc word [rdi + 2], 0
jmp 0x140137194
mov eax, dword [rbx + 0x128]
test eax, eax
je 0x14013710b
mov edx, eax
add rdx, qword [rbx + 0x38]
mov eax, dword [rdx + 4]
dec dword [rbx + 0x1c0]
mov dword [rbx + 0x128], eax
jmp 0x14013714b
movzx eax, byte [rbx + 0x80]
lea ecx, [rax + rax*2]
mov eax, dword [rbx + 0x48]
sub eax, dword [rbx + 0x40]
shl ecx, 2
cmp ecx, eax
ja 0x140137131
mov rdx, qword [rbx + 0x40]
mov eax, ecx
add rax, rdx
mov qword [rbx + 0x40], rax
jmp 0x14013714b
xor edx, edx
mov rcx, rbx
call fcn.140135370
mov r10d, dword [rsp + 0x80]
mov r11d, dword [rsp + 0x78]
mov rdx, rax
test rdx, rdx
je 0x14013725d
mov ecx, dword [rdi + 2]
mov dword [rdx], ecx
movzx ecx, word [rdi + 6]
mov word [rdx + 4], cx
mov ecx, edx
sub ecx, dword [rbx + 0x38]
mov dword [rdi + 4], ecx
movzx eax, byte [rdx + 1]
cmp al, 0x1e
jae 0x140137178
add al, al
mov byte [rdx + 1], al
jmp 0x14013717c
mov byte [rdx + 1], 0x78
movzx eax, byte [rdx + 1]
xor ecx, ecx
cmp r12d, 2
seta cl
add cx, word [rbx + 0x1c]
add cx, ax
mov word [rdi + 2], cx
movzx r9d, word [rdi + 2]
add r10d, r9d
lea r8d, [r9 + 6]
lea eax, [r10 + r10*2]
add eax, eax
imul r8d, r14d
add r8d, r8d
cmp r8d, eax
jae 0x1401371d8
xor ecx, ecx
lea eax, [r10*4]
cmp r8d, eax
setae cl
xor eax, eax
cmp r8d, r10d
seta al
lea r8d, [rax + 1]
add r8d, ecx
add r9w, 4
jmp 0x14013720c
xor edx, edx
imul eax, r10d, 0xf
cmp r8d, eax
lea eax, [r10 + r10*2]
seta dl
xor ecx, ecx
shl eax, 2
cmp r8d, eax
lea eax, [r10 + r10*8]
seta cl
add edx, ecx
xor ecx, ecx
cmp r8d, eax
seta cl
lea r8d, [rcx + 4]
add r8d, edx
add r9w, r8w
mov word [rdi + 2], r9w
lea rax, [rbp + 1]
inc bpl
lea rcx, [rax + rax*2]
mov eax, dword [rdi + 4]
lea rdx, [rax + rcx*2]
mov eax, r11d
add rdx, qword [rbx + 0x38]
shr eax, 0x10
mov word [rdx + 2], r11w
mov word [rdx + 4], ax
mov byte [rdx], r13b
mov byte [rdx + 1], r8b
or byte [rdi + 1], sil
mov byte [rdi], bpl
mov edi, dword [rdi + 8]
add rdi, qword [rbx + 0x38]
cmp rdi, qword [rbx]
je 0x14013726a
mov r10d, dword [rsp + 0x80]
jmp 0x140137000
mov rdx, rdi
mov rcx, rbx
call 0x140136990
jmp 0x140137278
mov edx, r15d
add rdx, qword [rbx + 0x38]
mov qword [rbx], rdx
mov qword [rbx + 8], rdx
mov rbp, qword [rsp + 0x30]
mov r12, qword [rsp + 0x28]
add rsp, 0x38
pop r15
pop r14
pop r13
pop rdi
pop rsi
pop rbx
ret