Function at 0x14004e160
Capabilities:
Encrypt data using rc4 ksa

Disassembly:
mov qword [rsp + 0x10], rdx
mov qword [rsp + 8], rcx
push rbp
push rsi
push r12
push r13
push r14
push r15
sub rsp, 0xc8
mov r10, qword [rcx]
mov r14, qword [rcx + 0x18]
mov rdx, qword [rcx + 8]
mov word [rsp + 0x110], 0xffff
movzx r8d, byte [r14 + 0x10]
mov rax, qword [r10 + 8]
imul r8, r8, 0x70
mov r15, qword [r8 + rax + 0x70]
mov r11, qword [r8 + rax + 0x28]
lea r12, [r8 + rax + 8]
mov r9d, 1
xor r13d, r13d
test r15, r15
mov rsi, rcx
mov qword [rsp + 0x40], r10
mov dword [rsp + 0x118], r9d
mov qword [rsp + 0x38], r12
mov qword [rsp + 0x30], r11
mov qword [rsp + 0x20], rdx
jne 0x14004e284
test byte [r11 + 0x3e], 0x20
je 0x14004e1ed
mov r15, qword [r11 + 0x10]
jmp 0x14004e284
xor edx, edx
lea rcx, [rsp + 0x50]
lea r8d, [rdx + 0x60]
call sub.msvcrt.dll_memset
mov r11, qword [rsp + 0x30]
mov word [rsp + 0xa6], 1
mov word [rsp + 0xa8], 1
mov byte [rsp + 0xaa], 5
mov qword [rsp + 0x68], r11
lea rax, [rsp + 0x110]
mov qword [rsp + 0x58], rax
lea rax, [rsp + 0x28]
mov qword [rsp + 0x60], rax
movzx eax, word [r11 + 0x3c]
mov word [rsp + 0xa4], ax
movzx eax, word [r11 + 0x3a]
mov word [rsp + 0x2a], r13w
mov word [rsp + 0x28], ax
test byte [r12 + 0x40], 1
jne 0x14004e26d
mov rax, qword [r12 + 0x20]
mov rcx, qword [rax + 0x10]
mov qword [rsp + 0x78], rcx
mov rdx, qword [rsp + 0x20]
mov r9d, dword [rsp + 0x118]
mov r10, qword [rsp + 0x40]
lea r15, [rsp + 0x50]
movzx ebp, word [r11 + 0x3a]
mov qword [rsp + 0xb8], rdi
lea r8, [0x140000000]
cmp bp, 0xa
jg 0x14004e2a6
xor di, di
jmp 0x14004e324
movsx rax, bp
mov cx, 0x28
cmp rax, 8
jae 0x14004e2cf
cmp rax, 2
jae 0x14004e2c0
xor di, di
jmp 0x14004e320
add rax, rax
add cx, 0xfff6
cmp rax, 8
jb 0x14004e2c0
jmp 0x14004e30d
cmp rax, 0xff
jbe 0x14004e2f0
nop
nop
nop
shr rax, 4
add cx, 0x28
cmp rax, 0xff
ja 0x14004e2e0
cmp rax, 0xf
jbe 0x14004e30d
nop
nop
nop
shr rax, 1
add cx, 0xa
cmp rax, 0xf
ja 0x14004e300
and eax, 7
movzx edi, word [r8 + rax*2 + 0xbf298]
add di, cx
sub di, 0xa
sub di, 0x21
cmp qword [rsi + 0x20], r13
mov qword [rsp + 0xc0], rbx
jne 0x14004e490
test byte [r10 + 0x32], 0x80
jne 0x14004e490
mov rax, qword [r10]
mov rcx, qword [rax]
bt dword [rcx + 0x2c], 0x14
jae 0x14004e490
cmp qword [r12 + 0x68], r13
jne 0x14004e490
mov eax, dword [r12 + 0x40]
test al, 1
jne 0x14004e490
test byte [r11 + 0x3e], 0x20
jne 0x14004e490
test al, 2
jne 0x14004e490
test al, 8
jne 0x14004e490
movsxd rsi, dword [rdx + 0x14]
mov rbx, qword [rdx + 0x20]
imul rsi, rsi, 0x38
add rsi, rbx
cmp rbx, rsi
jae 0x14004e47e
mov rax, qword [r14 + 8]
test qword [rbx + 0x28], rax
jne 0x14004e44c
xor r8d, r8d
mov rdx, r12
mov rcx, rbx
call fcn.1400134d0
test eax, eax
je 0x14004e44c
mov rax, qword [r14 + 0x38]
mov word [r14 + 0x18], 1
mov word [r14 + 0x2e], 0
mov qword [r14 + 0x20], 0
mov word [r14 + 0x2c], 1
mov qword [rax], rbx
lea eax, [rbp + rdi + 4]
mov word [r14 + 0x12], ax
cmp qword [r11 + 0x18], 0
jne 0x14004e405
test byte [r11 + 0x3e], 2
jne 0x14004e405
add ax, 0x18
mov word [r14 + 0x12], ax
mov dx, 0x2b
movzx ecx, di
mov word [r14 + 0x16], 0x2b
call fcn.140007cb0
mov rcx, qword [rsp + 0x100]
mov dword [r14 + 0x28], 0x4000
mov word [r14 + 0x14], ax
mov rax, qword [rsp + 0x108]
mov rdx, r14
or rax, qword [rbx + 0x28]
mov qword [r14], rax
call fcn.14001f9b0
mov r11, qword [rsp + 0x30]
mov r13d, eax
add rbx, 0x38
test r13d, r13d
je 0x14004e394
mov eax, r13d
mov rdi, qword [rsp + 0xb8]
mov rbx, qword [rsp + 0xc0]
add rsp, 0xc8
pop r15
pop r14
pop r13
pop r12
pop rsi
pop rbp
ret
test r13d, r13d
jne 0x14004e459
mov rdx, qword [rsp + 0x20]
mov r9d, dword [rsp + 0x118]
mov ebp, 0x240
test r15, r15
je 0x14004e459
mov rdi, qword [r15 + 0x48]
test rdi, rdi
je 0x14004e570
mov esi, dword [r12 + 0x44]
mov r12, qword [rdx + 0x20]
xor ebp, ebp
cmp dword [rdx + 0x14], ebp
jle 0x14004e8de
nop
nop
mov rbx, qword [r12]
mov r8d, esi
mov rdx, rdi
mov rcx, rbx
call fcn.140004c60
test eax, eax
je 0x14004e525
cmp byte [rdi], 0x47
jne 0x14004e501
mov rdx, qword [rdi + 0x10]
mov r8d, esi
mov rcx, rbx
call fcn.14000ab00
test eax, eax
jne 0x14004e525
mov rdx, qword [rdi + 0x18]
mov r8d, esi
mov rcx, rbx
call fcn.14000ab00
test eax, eax
jne 0x14004e525
cmp byte [rdi], 0x4d
jne 0x14004e533
mov rdx, qword [rdi + 0x10]
mov rcx, qword [rbx + 0x10]
mov r8d, esi
call fcn.140004c60
test eax, eax
jne 0x14004e533
movzx eax, byte [rbx]
cmp al, 0x4c
je 0x14004e533
cmp al, 0x49
je 0x14004e533
test byte [rbx + 4], 1
je 0x14004e566
movsx eax, word [rbx + 0x34]
cmp eax, esi
je 0x14004e55a
mov rdx, qword [rsp + 0x20]
add ebp, 1
add r12, 0x38
cmp ebp, dword [rdx + 0x14]
jl 0x14004e4c0
mov r12, qword [rsp + 0x38]
mov r9d, dword [rsp + 0x118]
jmp 0x14004e8bb
mov r12, qword [rsp + 0x38]
mov ebp, 0x240
jmp 0x14004e570
mov r12, qword [rsp + 0x38]
mov ebp, 0x240
mov rax, qword [r15 + 0x10]
movzx edi, word [rax]
mov rax, qword [rsp + 0x108]
mov word [r14 + 0x18], 0
mov qword [r14], rax
mov word [r14 + 0x2e], 0
mov word [r14 + 0x2c], 0
mov byte [r14 + 0x11], 0
mov word [r14 + 0x12], 0
mov word [r14 + 0x16], di
mov qword [r14 + 0x20], r15
mov ebx, dword [r15 + 0x5c]
test bl, 4
je 0x14004e5c5
mov rsi, qword [rsp + 0x100]
xor r11d, r11d
jmp 0x14004e67b
mov rsi, qword [rsp + 0x100]
mov rax, qword [rsi]
mov rcx, qword [rax + 0x10]
test rcx, rcx
jne 0x14004e5e1
xor r11d, r11d
jmp 0x14004e67b
mov r11d, dword [rcx]
xor r10d, r10d
test r11d, r11d
jle 0x14004e678
mov r9, qword [rcx + 8]
mov rcx, qword [r9]
test rcx, rcx
je 0x14004e625
nop
mov eax, dword [rcx + 4]
bt eax, 0xc
jae 0x14004e625
bt eax, 0x12
jae 0x14004e61c
mov rax, qword [rcx + 0x20]
mov rcx, qword [rax + 8]
mov rcx, qword [rcx]
jmp 0x14004e620
mov rcx, qword [rcx + 0x10]
test rcx, rcx
jne 0x14004e600
cmp byte [rcx], 0x9a
jne 0x14004e6e4
mov eax, dword [r12 + 0x44]
cmp dword [rcx + 0x2c], eax
jne 0x14004e667
movzx r8d, word [rcx + 0x30]
test r8w, r8w
js 0x14004e6dc
movzx edx, word [r15 + 0x56]
xor ecx, ecx
test edx, edx
jle 0x14004e667
mov rax, qword [r15 + 8]
cmp r8w, word [rax]
je 0x14004e6d4
add ecx, 1
add rax, 2
cmp ecx, edx
jl 0x14004e656
add r10d, 1
add r9, 0x28
cmp r10d, r11d
jl 0x14004e5f4
xor r11d, r11d
cmp dword [r15 + 0x50], 0
jg 0x14004e6e9
movzx eax, byte [rsp + 0x118]
xor ecx, ecx
test r11d, r11d
cmovne ecx, eax
lea eax, [rdi + 0x10]
movzx r8d, di
mov byte [r14 + 0x11], cl
mov rcx, qword [rsp + 0x20]
mov rdx, r14
mov dword [r14 + 0x28], 0x100
mov word [r14 + 0x14], ax
call fcn.1400092b0
mov rdx, r14
mov rcx, rsi
call fcn.14001f9b0
mov word [r14 + 0x16], di
test eax, eax
jne 0x14004e45c
jmp 0x14004e88e
mov r11d, 1
jmp 0x14004e67b
mov r11d, 1
jmp 0x14004e67b
xor r11d, r11d
jmp 0x14004e67b
test bl, 0x20
je 0x14004e6f7
mov dword [r14 + 0x28], ebp
xor r10d, r10d
jmp 0x14004e745
movzx eax, word [r15 + 0x58]
xor r9d, r9d
sub eax, 1
movsxd rdx, eax
js 0x14004e72e
mov rax, qword [r15 + 8]
lea r8, [rax + rdx*2]
nop
movsx ecx, word [r8]
cmp ecx, 0x3e
ja 0x14004e724
mov eax, 1
shl rax, cl
or r9, rax
sub r8, 2
sub rdx, 1
jns 0x14004e710
mov r10, qword [r12 + 0x58]
not r9
mov eax, 0x200
and r10, r9
cmove eax, ebp
mov dword [r14 + 0x28], eax
test r11d, r11d
jne 0x14004e794
mov rax, qword [rsp + 0x30]
test byte [rax + 0x3e], 0x20
jne 0x14004e794
test r10, r10
jne 0x14004e88e
test byte [r15 + 0x5c], 4
jne 0x14004e88e
movzx eax, word [rax + 0x3c]
cmp word [r15 + 0x54], ax
jge 0x14004e88e
mov rax, qword [rsp + 0x40]
test byte [rax + 0x32], 4
jne 0x14004e88e
cmp dword [0x1400bf020], r10d
je 0x14004e88e
movzx eax, byte [rsp + 0x118]
xor ecx, ecx
test r11d, r11d
cmovne ecx, eax
mov byte [r14 + 0x11], cl
movsx eax, word [r15 + 0x54]
mov rcx, qword [rsp + 0x30]
movsx ecx, word [rcx + 0x3c]
imul eax, eax, 0xf
cdq
idiv ecx
mov r8d, eax
add r8w, di
add r8w, 1
test r10, r10
mov word [r14 + 0x14], r8w
je 0x14004e865
lea edx, [rdi + 0x10]
cmp r8w, dx
jl 0x14004e81d
movsx ecx, dx
movsx r9d, r8w
lea eax, [rcx + 0x31]
cmp r9d, eax
jg 0x14004e860
lea eax, [rcx + 0x1f]
cmp r9d, eax
jle 0x14004e7fd
add r8w, 1
jmp 0x14004e860
movsx rcx, r8w
movsx rax, dx
sub rcx, rax
lea rax, [0x140000000]
movzx eax, byte [rcx + rax + 0xabce0]
add r8w, ax
jmp 0x14004e860
movsx ecx, r8w
movsx r9d, dx
lea eax, [rcx + 0x31]
cmp r9d, eax
jle 0x14004e833
mov r8w, dx
jmp 0x14004e860
lea eax, [rcx + 0x1f]
cmp r9d, eax
jle 0x14004e841
lea r8d, [rdx + 1]
jmp 0x14004e860
movsx rax, r8w
movsx rcx, dx
sub rcx, rax
lea rax, [0x140000000]
movzx r8d, byte [rcx + rax + 0xabce0]
add r8w, dx
mov word [r14 + 0x14], r8w
mov rcx, qword [rsp + 0x20]
movzx r8d, di
mov rdx, r14
call fcn.1400092b0
mov rdx, r14
mov rcx, rsi
call fcn.14001f9b0
mov word [r14 + 0x16], di
test eax, eax
jne 0x14004e45c
xor r9d, r9d
mov r8, r15
mov rdx, r12
mov rcx, rsi
call fcn.14004a070
cmp qword [r12 + 0x68], 0
mov r13d, eax
jne 0x14004e45c
mov rdx, qword [rsp + 0x20]
mov r9d, dword [rsp + 0x118]
mov r15, qword [r15 + 0x28]
add r9d, 1
test r13d, r13d
mov dword [rsp + 0x118], r9d
jne 0x14004e459
mov ebp, 0x240
jmp 0x14004e495
mov r12, qword [rsp + 0x38]
jmp 0x14004e8bb