Function at 0x140049a90
Capabilities:
Encrypt data using rc4 ksa

Disassembly:
push rbx
push rbp
push rsi
push r12
push r13
push r15
sub rsp, 0xb8
mov rax, qword [0x1400b2010]
xor rax, rsp
mov qword [rsp + 0x90], rax
mov rax, qword [rcx + 0xb8]
mov rbx, rcx
mov rcx, qword [rcx + 0xc0]
xor ebp, ebp
mov qword [rsp + 0x80], r9
mov qword [rsp + 0x60], r8
mov qword [rsp + 0x48], rdx
cmp rax, rcx
jb 0x140049af8
cmp dword [rbx + 0x30], ebp
je 0x140049b19
mov rcx, rbx
call fcn.14003ffb0
mov rax, qword [rbx + 0xb8]
mov rcx, qword [rbx + 0xc0]
movzx edx, byte [rax]
inc rax
movzx r8d, dl
mov dword [rsp + 0x54], r8d
mov qword [rbx + 0xb8], rax
mov byte [rsp + 0x30], dl
cmp rax, rcx
jae 0x140049b22
jmp 0x140049b3d
mov byte [rsp + 0x30], bpl
mov dword [rsp + 0x54], ebp
cmp dword [rbx + 0x30], ebp
je 0x140049b66
mov rcx, rbx
call fcn.14003ffb0
mov rax, qword [rbx + 0xb8]
mov rcx, qword [rbx + 0xc0]
movzx esi, byte [rax]
inc rax
movzx edx, sil
mov dword [rsp + 0x34], edx
mov qword [rbx + 0xb8], rax
cmp rax, rcx
jae 0x140049b6d
movzx ecx, byte [rax]
inc rax
mov qword [rbx + 0xb8], rax
jmp 0x140049b92
xor sil, sil
mov dword [rsp + 0x34], ebp
cmp dword [rbx + 0x30], ebp
je 0x140049b90
mov rcx, rbx
call fcn.14003ffb0
mov rax, qword [rbx + 0xb8]
movzx ecx, byte [rax]
inc rax
mov qword [rbx + 0xb8], rax
jmp 0x140049b92
xor cl, cl
movzx eax, cl
mov rcx, rbx
mov dword [rsp + 0x3c], eax
call fcn.1400401b0
mov rcx, rbx
mov dword [rsp + 0x78], eax
call fcn.1400401b0
mov rcx, qword [rbx + 0xb8]
mov dword [rsp + 0x50], eax
cmp rcx, qword [rbx + 0xc0]
jae 0x140049bd0
movzx edx, byte [rcx]
inc rcx
mov qword [rbx + 0xb8], rcx
jmp 0x140049bf5
cmp dword [rbx + 0x30], ebp
je 0x140049bf3
mov rcx, rbx
call fcn.14003ffb0
mov rax, qword [rbx + 0xb8]
movzx edx, byte [rax]
inc rax
mov qword [rbx + 0xb8], rax
jmp 0x140049bf5
xor dl, dl
mov qword [rsp + 0xb0], rdi
mov rcx, rbx
mov qword [rsp + 0xa8], r14
movzx r15d, dl
call fcn.1400401b0
mov rcx, rbx
call fcn.1400401b0
mov rcx, rbx
call fcn.1400401b0
mov rcx, rbx
mov dword [rsp + 0x44], eax
call fcn.1400401b0
mov rcx, qword [rbx + 0xc0]
mov dword [rsp + 0x40], eax
mov rax, qword [rbx + 0xb8]
cmp rax, rcx
jb 0x140049c5f
cmp dword [rbx + 0x30], ebp
je 0x140049c87
mov rcx, rbx
call fcn.14003ffb0
mov rax, qword [rbx + 0xb8]
mov rcx, qword [rbx + 0xc0]
movzx edx, byte [rax]
inc rax
movzx r14d, dl
mov qword [rbx + 0xb8], rax
mov edi, r14d
cmp rax, rcx
jae 0x140049c8c
movzx ecx, byte [rax]
inc rax
mov qword [rbx + 0xb8], rax
jmp 0x140049cb1
mov r14d, ebp
mov edi, ebp
cmp dword [rbx + 0x30], ebp
je 0x140049caf
mov rcx, rbx
call fcn.14003ffb0
mov rax, qword [rbx + 0xb8]
movzx ecx, byte [rax]
inc rax
mov qword [rbx + 0xb8], rax
jmp 0x140049cb1
xor cl, cl
mov edx, dword [rsp + 0x3c]
mov r13d, 1
cmp edx, 8
movzx eax, cl
mov qword [rsp + 0x70], rbp
mov r12d, ebp
mov dword [rsp + 0x88], ebp
lea ecx, [rdx - 8]
mov dword [rsp + 0x58], ebp
cmovb ecx, edx
mov dword [rsp + 0x38], ebp
shr eax, 5
mov edx, r13d
and eax, r13d
sub edx, eax
mov dword [rsp + 0x5c], edx
cmp dword [rsp + 0x34], ebp
je 0x140049d15
mov ecx, r15d
sub ecx, 8
je 0x140049d5f
sub ecx, 7
je 0x140049d52
sub ecx, r13d
je 0x140049d52
sub ecx, 8
je 0x140049d35
cmp ecx, 8
jne 0x14004a409
jmp 0x140049d35
sub edi, 8
je 0x140049d5f
sub edi, 7
je 0x140049d52
sub edi, r13d
je 0x140049d47
sub edi, 8
je 0x140049d32
cmp edi, 8
jne 0x14004a409
mov r15d, r14d
shr r15d, 3
mov dword [rsp + 0x38], ebp
test r15d, r15d
jne 0x140049d62
jmp 0x14004a409
cmp ecx, 3
jne 0x140049d52
lea r15d, [rcx - 1]
jmp 0x140049d62
mov r15d, 3
mov dword [rsp + 0x38], r13d
jmp 0x140049d62
mov r15d, r13d
mov rax, qword [rsp + 0x48]
mov r9d, dword [rsp + 0x44]
mov r8d, dword [rsp + 0x40]
mov dword [rax], r9d
mov rax, qword [rsp + 0x60]
mov dword [rax], r8d
mov rax, qword [rsp + 0x80]
test rax, rax
je 0x140049d8c
mov dword [rax], r15d
test r9d, r9d
js 0x14004a409
test r8d, r8d
js 0x14004a409
je 0x140049db9
mov eax, 0x7fffffff
mov ecx, ebp
cdq
idiv r8d
cmp r9d, eax
setle cl
test ecx, ecx
je 0x14004a409
mov ecx, r8d
imul ecx, r9d
mov dword [rsp + 0x60], ecx
test ecx, ecx
js 0x14004a409
xor edx, edx
mov eax, 0x7fffffff
div r15d
mov edi, eax
cmp ecx, eax
jg 0x14004a409
test r8d, r8d
je 0x140049df7
mov eax, 0x7fffffff
cdq
idiv r8d
cmp r9d, eax
jg 0x14004a409
mov eax, r15d
imul eax, r8d
imul eax, r9d
movsxd rcx, eax
call qword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_malloc]
mov qword [rsp + 0x48], rax
mov r8, rax
test rax, rax
je 0x14004a409
cmp qword [rbx + 0x10], rbp
je 0x140049e54
mov ecx, dword [rbx + 0xc0]
sub ecx, dword [rbx + 0xb8]
mov edx, dword [rsp + 0x54]
cmp ecx, edx
jge 0x140049e54
mov rax, qword [rbx + 0xc0]
sub edx, ecx
mov rcx, qword [rbx + 0x28]
mov qword [rbx + 0xb8], rax
call qword [rbx + 0x18]
mov r8, qword [rsp + 0x48]
jmp 0x140049e60
movzx eax, byte [rsp + 0x30]
add qword [rbx + 0xb8], rax
cmp dword [rsp + 0x34], ebp
jne 0x140049f1f
mov ecx, dword [rsp + 0x3c]
mov edi, r14d
mov dword [rsp + 0x34], r14d
mov byte [rsp + 0x30], sil
cmp ecx, 8
jae 0x14004a068
mov eax, dword [rsp + 0x38]
mov dword [rsp + 0x34], r14d
mov byte [rsp + 0x30], sil
test eax, eax
jne 0x14004a068
mov esi, dword [rsp + 0x40]
mov r12d, dword [rsp + 0x44]
test esi, esi
jle 0x14004a39e
mov ebp, r12d
mov edi, esi
imul ebp, r15d
cmp dword [rsp + 0x5c], eax
je 0x140049ef1
mov eax, ebp
neg eax
movsxd r14, eax
lea eax, [rsi - 1]
imul eax, r15d
imul eax, r12d
movsxd rsi, eax
add rsi, r8
mov r8d, ebp
mov rdx, rsi
mov rcx, rbx
call fcn.140040020
add rsi, r14
sub rdi, r13
jne 0x140049ed2
mov esi, dword [rsp + 0x40]
jmp 0x14004a39a
movsxd r14, ebp
mov rsi, r8
nop word [rax + rax]
mov r8d, ebp
mov rdx, rsi
mov rcx, rbx
call fcn.140040020
add rsi, r14
sub rdi, r13
jne 0x140049f00
mov esi, dword [rsp + 0x40]
jmp 0x14004a39a
movsxd rdx, dword [rsp + 0x78]
test edx, edx
jns 0x140049f38
mov rax, qword [rbx + 0xc0]
mov qword [rbx + 0xb8], rax
jmp 0x140049f6e
cmp qword [rbx + 0x10], rbp
je 0x140049f67
mov ecx, dword [rbx + 0xc0]
sub ecx, dword [rbx + 0xb8]
cmp ecx, edx
jge 0x140049f67
mov rax, qword [rbx + 0xc0]
sub edx, ecx
mov rcx, qword [rbx + 0x28]
mov qword [rbx + 0xb8], rax
call qword [rbx + 0x18]
jmp 0x140049f6e
add qword [rbx + 0xb8], rdx
mov ecx, dword [rsp + 0x50]
test ecx, ecx
js 0x14004a3fe
cmp ecx, edi
mov eax, ebp
setle al
test eax, eax
je 0x14004a3fe
mov edi, r15d
imul edi, ecx
movsxd rcx, edi
call qword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_malloc]
mov qword [rsp + 0x70], rax
test rax, rax
je 0x14004a3fe
mov dword [rsp + 0x34], r14d
mov byte [rsp + 0x30], sil
cmp dword [rsp + 0x38], ebp
je 0x14004a0c3
mov ecx, dword [rsp + 0x50]
mov rdi, rax
test ecx, ecx
jle 0x14004a061
mov byte [rsp + 0x30], sil
mov r12d, ecx
mov esi, r15d
mov dword [rsp + 0x34], r14d
nop dword [rax]
mov rcx, rbx
call fcn.1400401b0
movzx r8d, ax
mov eax, r8d
shr eax, 0xa
and eax, 0x1f
imul ecx, eax, 0xff
mov eax, 0x84210843
imul ecx
add edx, ecx
sar edx, 4
mov eax, edx
shr eax, 0x1f
add edx, eax
mov eax, r8d
shr eax, 5
and r8d, 0x1f
and eax, 0x1f
mov byte [rdi], dl
imul ecx, eax, 0xff
mov eax, 0x84210843
imul ecx
add edx, ecx
imul ecx, r8d, 0xff
sar edx, 4
mov eax, edx
shr eax, 0x1f
add edx, eax
mov eax, 0x84210843
mov byte [rdi + 1], dl
imul ecx
add edx, ecx
sar edx, 4
mov eax, edx
shr eax, 0x1f
add edx, eax
mov byte [rdi + 2], dl
add rdi, rsi
sub r12, r13
jne 0x140049fe0
mov r12d, ebp
mov ecx, dword [rsp + 0x3c]
mov edi, r14d
mov eax, dword [rsp + 0x60]
mov esi, r15d
test eax, eax
jle 0x14004a317
mov r14, qword [rsp + 0x48]
lea rdx, [rsp + 0x88]
sub r14, rdx
mov r9d, r15d
mov r8d, eax
mov qword [rsp + 0x68], rax
cmp ecx, 8
jb 0x14004a134
test r12d, r12d
jne 0x14004a125
mov rax, qword [rbx + 0xb8]
cmp rax, qword [rbx + 0xc0]
jae 0x14004a0ea
movzx ecx, byte [rax]
inc rax
mov qword [rbx + 0xb8], rax
jmp 0x14004a10f
mov r8d, edi
mov rdx, rax
mov rcx, rbx
call fcn.140040020
test eax, eax
jne 0x14004a061
mov rcx, qword [rsp + 0x48]
call qword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
mov rcx, qword [rsp + 0x70]
jmp 0x14004a403
cmp dword [rbx + 0x30], ebp
je 0x14004a10d
mov rcx, rbx
call fcn.14003ffb0
mov rax, qword [rbx + 0xb8]
movzx ecx, byte [rax]
inc rax
mov qword [rbx + 0xb8], rax
jmp 0x14004a10f
xor cl, cl
movzx eax, cl
mov r12d, eax
and r12d, 0x7f
inc r12d
shr eax, 7
mov dword [rsp + 0x58], eax
jmp 0x14004a134
cmp dword [rsp + 0x58], ebp
je 0x14004a134
test r13d, r13d
je 0x14004a2ce
cmp byte [rsp + 0x30], bpl
je 0x14004a1cc
cmp edi, 8
jne 0x14004a193
mov rax, qword [rbx + 0xb8]
cmp rax, qword [rbx + 0xc0]
jae 0x14004a166
movzx ecx, byte [rax]
inc rax
mov qword [rbx + 0xb8], rax
movzx eax, cl
jmp 0x14004a19b
cmp dword [rbx + 0x30], ebp
je 0x14004a18c
mov rcx, rbx
call fcn.14003ffb0
mov rax, qword [rbx + 0xb8]
movzx ecx, byte [rax]
inc rax
mov qword [rbx + 0xb8], rax
movzx eax, cl
jmp 0x14004a19b
xor cl, cl
movzx eax, cl
jmp 0x14004a19b
mov rcx, rbx
call fcn.1400401b0
cmp eax, dword [rsp + 0x50]
cmovge eax, ebp
test r15d, r15d
je 0x14004a2c3
imul eax, r15d
lea rcx, [rsp + 0x88]
mov r8, rsi
movsxd rdx, eax
add rdx, qword [rsp + 0x70]
call sub.VCRUNTIME140.dll_memcpy
jmp 0x14004a2c3
cmp dword [rsp + 0x38], ebp
je 0x14004a25b
mov rcx, rbx
call fcn.1400401b0
movzx r8d, ax
mov eax, r8d
shr eax, 0xa
and eax, 0x1f
imul ecx, eax, 0xff
mov eax, 0x84210843
imul ecx
add edx, ecx
sar edx, 4
mov eax, edx
shr eax, 0x1f
add edx, eax
mov eax, r8d
shr eax, 5
and r8d, 0x1f
and eax, 0x1f
mov byte [rsp + 0x88], dl
imul ecx, eax, 0xff
mov eax, 0x84210843
imul ecx
add edx, ecx
imul ecx, r8d, 0xff
sar edx, 4
mov eax, edx
shr eax, 0x1f
add edx, eax
mov eax, 0x84210843
mov byte [rsp + 0x89], dl
imul ecx
add edx, ecx
sar edx, 4
mov eax, edx
shr eax, 0x1f
add edx, eax
mov byte [rsp + 0x8a], dl
jmp 0x14004a2c3
mov rdi, rbp
test r15d, r15d
je 0x14004a2c3
nop dword [rax]
nop word [rax + rax]
mov rax, qword [rbx + 0xb8]
cmp rax, qword [rbx + 0xc0]
jae 0x14004a28f
movzx ecx, byte [rax]
inc rax
mov qword [rbx + 0xb8], rax
jmp 0x14004a2b4
cmp dword [rbx + 0x30], ebp
je 0x14004a2b2
mov rcx, rbx
call fcn.14003ffb0
mov rax, qword [rbx + 0xb8]
movzx ecx, byte [rax]
inc rax
mov qword [rbx + 0xb8], rax
jmp 0x14004a2b4
xor cl, cl
mov byte [rsp + rdi + 0x88], cl
inc rdi
cmp rdi, rsi
jl 0x14004a270
mov r8, qword [rsp + 0x68]
mov r13d, ebp
mov r9d, r15d
mov rdx, rbp
test r15d, r15d
je 0x14004a2fa
nop word [rax + rax]
lea rcx, [rsp + 0x88]
add rcx, rdx
inc rdx
movzx eax, byte [rcx]
mov byte [r14 + rcx], al
cmp rdx, rsi
jl 0x14004a2e0
mov edi, dword [rsp + 0x34]
dec r12d
mov ecx, dword [rsp + 0x3c]
add r14, r9
sub r8, 1
mov qword [rsp + 0x68], r8
jne 0x14004a092
mov esi, dword [rsp + 0x40]
mov r12d, dword [rsp + 0x44]
cmp dword [rsp + 0x5c], ebp
je 0x14004a387
test esi, esi
jle 0x14004a387
mov rdi, qword [rsp + 0x48]
lea r10d, [rsi - 1]
imul r10d, r15d
mov r11d, r15d
imul r11d, r12d
mov ebx, ebp
imul r10d, r12d
mov r8d, r11d
test r11d, r11d
jle 0x14004a37a
movsxd rax, ebx
movsxd r9, r10d
sub r9, rax
lea rdx, [rax + rdi]
nop dword [rax]
movzx eax, byte [r9 + rdx]
dec r8d
movzx ecx, byte [rdx]
mov byte [rdx], al
mov byte [r9 + rdx], cl
lea rdx, [rdx + 1]
test r8d, r8d
jg 0x14004a360
add ebx, r11d
sub r10d, r11d
add ebp, 2
cmp ebp, esi
jl 0x14004a344
mov rax, qword [rsp + 0x70]
test rax, rax
je 0x14004a39a
mov rcx, rax
call qword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
mov eax, dword [rsp + 0x38]
cmp r15d, 3
jb 0x14004a3d9
test eax, eax
mov rax, qword [rsp + 0x48]
jne 0x14004a3de
mov ecx, dword [rsp + 0x60]
mov r8, rax
test ecx, ecx
jle 0x14004a3de
mov r11d, r15d
mov r10d, ecx
nop
movzx ecx, byte [r8]
movzx eax, byte [r8 + 2]
mov byte [r8], al
mov byte [r8 + 2], cl
add r8, r11
sub r10, 1
jne 0x14004a3c0
mov rax, qword [rsp + 0x48]
cmp r15d, 4
je 0x14004a40b
mov r9d, r12d
mov dword [rsp + 0x20], esi
mov r8d, 4
mov edx, r15d
mov rcx, rax
call fcn.140040270
jmp 0x14004a40b
mov rcx, qword [rsp + 0x48]
call qword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
xor eax, eax
mov r14, qword [rsp + 0xa8]
mov rdi, qword [rsp + 0xb0]
mov rcx, qword [rsp + 0x90]
xor rcx, rsp
call fcn.14008f590
add rsp, 0xb8
pop r15
pop r13
pop r12
pop rsi
pop rbp
pop rbx
ret