Function at 0x1800b8980
Capabilities:
Encrypt data using rc4 ksa

Disassembly:
push rbx
push rbp
push rdi
push r13
push r14
push r15
sub rsp, 0x168
mov rax, qword [0x1801203c0]
xor rax, rsp
mov qword [rsp + 0x150], rax
mov rax, qword [rcx]
xor ebp, ebp
mov r13, r8
mov qword [rsp + 0x80], r8
mov r14, rdx
mov qword [rsp + 0x78], rdx
mov rdi, rcx
mov qword [rsp + 0x68], rcx
mov dword [rax + 8], ebp
call fcn.1800b9c40
mov rdx, qword [rdi]
movsxd rcx, dword [rdx + 8]
test eax, eax
jne 0x1800b8a38
mov rbx, rcx
test ecx, ecx
jle 0x1800b8b8d
add rdi, 0x46d8
mov rcx, qword [rdi]
test rcx, rcx
je 0x1800b89fd
call qword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
mov qword [rdi], rbp
mov qword [rdi - 8], rbp
mov rcx, qword [rdi + 8]
test rcx, rcx
je 0x1800b8a14
call qword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
mov qword [rdi + 8], rbp
mov qword [rdi + 0x18], rbp
mov rcx, qword [rdi + 0x10]
test rcx, rcx
je 0x1800b8a27
call qword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
mov qword [rdi + 0x10], rbp
add rdi, 0x60
sub rbx, 1
jne 0x1800b89e8
xor eax, eax
jmp 0x1800b912e
cmp ecx, 3
jne 0x1800b8b2d
cmp dword [rdi + 0x4850], ecx
je 0x1800b8a61
cmp dword [rdi + 0x484c], ebp
jne 0x1800b8b2d
cmp dword [rdi + 0x4848], ebp
jne 0x1800b8b2d
mov qword [rsp + 0x38], 1
mov r15, rcx
mov qword [rsp + 0x1b8], rsi
xorps xmm0, xmm0
mov qword [rsp + 0x160], r12
xorps xmm1, xmm1
movdqu xmmword [rsp + 0x48], xmm0
movdqu xmmword [rsp + 0x58], xmm1
test r15, r15
jle 0x1800b8be8
lea rbx, [rsp + 0xac]
xor r12d, r12d
lea rsi, [rdi + 0x46a4]
nop word [rax + rax]
mov rax, qword [rdi]
mov ecx, dword [rax]
add ecx, 3
call qword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_malloc]
mov qword [rsi + 0x44], rax
test rax, rax
je 0x1800b8c08
mov eax, dword [rdi + 0x4688]
cdq
mov dword [rbx + 0xc], r12d
idiv dword [rsi]
mov r9d, eax
mov dword [rbx - 4], eax
mov eax, dword [rdi + 0x468c]
cdq
idiv dword [rsi + 4]
xor edx, edx
mov ecx, eax
mov dword [rbx], eax
sar ecx, 1
mov r8d, eax
mov dword [rbx + 8], ecx
mov rcx, qword [rdi]
mov eax, dword [rcx]
mov rcx, qword [rsi + 0x2c]
dec eax
add eax, r9d
mov qword [rbx - 0xc], rcx
div r9d
mov qword [rbx - 0x14], rcx
mov dword [rbx + 4], eax
cmp r9d, 1
jne 0x1800b8ba3
cmp r8d, r9d
jne 0x1800b8b94
lea rax, [0x1800b9c30]
jmp 0x1800b8bce
mov qword [rsp + 0x38], rbp
mov r15, rcx
test ecx, ecx
jg 0x1800b8a6d
xor eax, eax
jmp 0x1800b912e
xor eax, eax
jmp 0x1800b912e
cmp r8d, 2
jne 0x1800b8bc7
lea rax, [0x1800b9a10]
jmp 0x1800b8bce
cmp r9d, 2
jne 0x1800b8bc7
cmp r8d, 1
jne 0x1800b8bb8
lea rax, [0x1800b9920]
jmp 0x1800b8bce
cmp r8d, 2
jne 0x1800b8bc7
mov rax, qword [rdi + 0x4880]
jmp 0x1800b8bce
lea rax, [0x1800b95f0]
mov qword [rbx - 0x1c], rax
inc rbp
add rbx, 0x30
add rsi, 0x60
cmp rbp, r15
jl 0x1800b8ab0
xor ebp, ebp
mov rax, qword [rdi]
mov ecx, dword [rax]
mov r8d, dword [rax + 4]
test ecx, ecx
js 0x1800b9099
jne 0x1800b8c6e
lea r9d, [rcx*4]
jmp 0x1800b8c90
mov rax, qword [rdi]
movsxd rbx, dword [rax + 8]
test rbx, rbx
jle 0x1800b90f9
add rdi, 0x46d8
nop
mov rcx, qword [rdi]
test rcx, rcx
je 0x1800b8c35
call qword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
mov qword [rdi], r12
mov qword [rdi - 8], r12
mov rcx, qword [rdi + 8]
test rcx, rcx
je 0x1800b8c4c
call qword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
mov qword [rdi + 8], r12
mov qword [rdi + 0x18], r12
mov rcx, qword [rdi + 0x10]
test rcx, rcx
je 0x1800b8c5f
call qword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
mov qword [rdi + 0x10], r12
add rdi, 0x60
sub rbx, 1
jne 0x1800b8c20
jmp 0x1800b90f9
mov eax, 0x7fffffff
cdq
idiv ecx
cmp eax, 4
jl 0x1800b9099
lea r9d, [rcx*4]
test r9d, r9d
js 0x1800b9099
test r8d, r8d
js 0x1800b9099
je 0x1800b8cad
mov eax, 0x7fffffff
cdq
idiv r8d
cmp r9d, eax
jg 0x1800b9099
imul ecx, r8d
lea eax, [rcx*4 + 1]
movsxd rcx, eax
call qword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_malloc]
mov rcx, qword [rdi]
mov r12, rax
test rax, rax
je 0x1800b909c
cmp dword [rcx + 4], 0
mov eax, ebp
mov dword [rsp + 0x30], eax
jbe 0x1800b9026
mov rsi, qword [rsp + 0x58]
mov r14, qword [rsp + 0x50]
mov rbx, qword [rsp + 0x48]
mov qword [rsp + 0x40], r12
imul eax, dword [rcx]
shl eax, 2
mov r13d, eax
add r13, r12
mov qword [rsp + 0x70], r13
test r15, r15
jle 0x1800b8dd7
lea rsi, [rdi + 0x46c0]
mov rdi, qword [rsp + 0x40]
lea rbx, [rsp + 0xb4]
mov rax, qword [rsp + 0x38]
lea r14, [rbx - 0x14]
mov r11d, dword [rbx - 0xc]
lea r12, [rbx - 0x1c]
mov r9, rax
mov qword [rsp + 0x38], rax
mov eax, dword [rbx - 8]
mov r13, r14
sar eax, 1
cmp dword [rbx], eax
jl 0x1800b8d55
mov r8, qword [r12]
mov rdx, r14
mov qword [rsp + 0x38], r9
jmp 0x1800b8d5b
mov r8, qword [r14]
mov rdx, r12
mov r9d, dword [rbx - 4]
mov rdx, qword [rdx]
mov rcx, qword [rsi + 0x28]
mov dword [rsp + 0x20], r11d
call qword [rbx - 0x24]
mov qword [rsp + rbp*8 + 0x48], rax
mov eax, dword [rbx]
inc eax
mov dword [rbx], eax
cmp eax, dword [rbx - 8]
jl 0x1800b8da0
inc dword [rbx + 4]
mov eax, dword [rbx + 4]
mov rcx, qword [r13]
mov dword [rbx], 0
mov qword [r12], rcx
cmp eax, dword [rsi]
jge 0x1800b8da0
movsxd rax, dword [rsi + 4]
add rax, rcx
mov qword [r14], rax
inc rbp
add rbx, 0x30
add rsi, 0x60
cmp rbp, r15
jl 0x1800b8d22
mov rsi, qword [rsp + 0x58]
mov r14, qword [rsp + 0x50]
mov rbx, qword [rsp + 0x48]
mov r13, qword [rsp + 0x70]
mov qword [rsp + 0x40], rdi
mov r12, qword [rsp + 0x40]
mov rdi, qword [rsp + 0x68]
mov rax, qword [rdi]
mov ecx, dword [rax + 8]
cmp ecx, 3
jne 0x1800b8e58
cmp qword [rsp + 0x38], 0
je 0x1800b8e31
xor ebp, ebp
mov r8d, ebp
cmp dword [rax], ebp
jbe 0x1800b9003
lea rdx, [r13 + 2]
nop dword [rax + rax]
mov ecx, r8d
lea rdx, [rdx + 4]
inc r8d
movzx eax, byte [rcx + rbx]
mov byte [rdx - 6], al
movzx eax, byte [rcx + r14]
mov byte [rdx - 5], al
movzx eax, byte [rcx + rsi]
mov byte [rdx - 4], al
mov byte [rdx - 3], 0xff
mov rax, qword [rdi]
cmp r8d, dword [rax]
jb 0x1800b8e00
jmp 0x1800b9003
mov eax, dword [rax]
mov r9, rsi
mov dword [rsp + 0x28], 4
mov r8, r14
mov rdx, rbx
mov dword [rsp + 0x20], eax
mov rcx, r13
call qword [rdi + 0x4878]
xor ebp, ebp
jmp 0x1800b9003
cmp ecx, 4
jne 0x1800b8fcd
mov ecx, dword [rdi + 0x484c]
test ecx, ecx
jne 0x1800b8f02
xor ebp, ebp
mov r10d, ebp
cmp dword [rax], ebp
jbe 0x1800b9003
mov r12, qword [rsp + 0x60]
lea r9, [r13 + 2]
nop word [rax + rax]
mov edx, r10d
lea r9, [r9 + 4]
inc r10d
movzx r8d, byte [rdx + r12]
movzx ecx, byte [rdx + rbx]
imul ecx, r8d
sub ecx, 0xffffff80
mov eax, ecx
shr eax, 8
add eax, ecx
shr eax, 8
mov byte [r9 - 6], al
movzx ecx, byte [rdx + r14]
imul ecx, r8d
sub ecx, 0xffffff80
mov eax, ecx
shr eax, 8
add eax, ecx
shr eax, 8
mov byte [r9 - 5], al
movzx ecx, byte [rdx + rsi]
mov byte [r9 - 3], 0xff
imul ecx, r8d
sub ecx, 0xffffff80
mov eax, ecx
shr eax, 8
add eax, ecx
shr eax, 8
mov byte [r9 - 4], al
mov rax, qword [rdi]
cmp r10d, dword [rax]
jb 0x1800b8e90
mov r12, qword [rsp + 0x40]
jmp 0x1800b9003
mov edx, dword [rax]
cmp ecx, 2
mov rax, qword [rdi + 0x4878]
mov r9, rsi
mov dword [rsp + 0x28], 4
mov r8, r14
mov dword [rsp + 0x20], edx
mov rcx, r13
mov rdx, rbx
jne 0x1800b8fc7
call rax
mov rax, qword [rdi]
xor ebp, ebp
mov r9d, ebp
cmp dword [rax], ebp
jbe 0x1800b9003
mov rsi, qword [rsp + 0x60]
lea r8, [r13 + 2]
nop word [rax + rax]
mov eax, r9d
lea r8, [r8 + 4]
inc r9d
movzx edx, byte [rax + rsi]
movzx eax, byte [r8 - 6]
not al
movzx ecx, al
imul ecx, edx
sub ecx, 0xffffff80
mov eax, ecx
shr eax, 8
add eax, ecx
shr eax, 8
mov byte [r8 - 6], al
movzx eax, byte [r8 - 5]
not al
movzx ecx, al
imul ecx, edx
sub ecx, 0xffffff80
mov eax, ecx
shr eax, 8
add eax, ecx
shr eax, 8
mov byte [r8 - 5], al
movzx eax, byte [r8 - 4]
not al
movzx ecx, al
imul ecx, edx
sub ecx, 0xffffff80
mov eax, ecx
shr eax, 8
add eax, ecx
shr eax, 8
mov byte [r8 - 4], al
mov rax, qword [rdi]
cmp r9d, dword [rax]
jb 0x1800b8f50
mov rsi, qword [rsp + 0x58]
jmp 0x1800b9003
call rax
xor ebp, ebp
jmp 0x1800b9003
xor ebp, ebp
mov r8d, ebp
cmp dword [rax], ebp
jbe 0x1800b9003
lea rdx, [r13 + 1]
nop word [rax + rax]
mov eax, r8d
lea rdx, [rdx + 4]
inc r8d
movzx ecx, byte [rax + rbx]
mov byte [rdx - 3], cl
mov byte [rdx - 4], cl
mov byte [rdx - 5], cl
mov byte [rdx - 2], 0xff
mov rax, qword [rdi]
cmp r8d, dword [rax]
jb 0x1800b8fe0
mov eax, dword [rsp + 0x30]
mov rcx, qword [rdi]
inc eax
mov dword [rsp + 0x30], eax
cmp eax, dword [rcx + 4]
jb 0x1800b8cf4
mov r14, qword [rsp + 0x78]
mov r13, qword [rsp + 0x80]
movsxd rsi, dword [rcx + 8]
test rsi, rsi
jle 0x1800b907f
lea rbx, [rdi + 0x46d8]
mov rcx, qword [rbx]
test rcx, rcx
je 0x1800b904b
call qword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
mov qword [rbx], rbp
mov qword [rbx - 8], rbp
mov rcx, qword [rbx + 8]
test rcx, rcx
je 0x1800b9062
call qword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
mov qword [rbx + 8], rbp
mov qword [rbx + 0x18], rbp
mov rcx, qword [rbx + 0x10]
test rcx, rcx
je 0x1800b9075
call qword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
mov qword [rbx + 0x10], rbp
add rbx, 0x60
sub rsi, 1
jne 0x1800b9036
mov rcx, qword [rdi]
mov rax, r12
mov edx, dword [rcx]
mov dword [r14], edx
mov rcx, qword [rdi]
mov edx, dword [rcx + 4]
mov dword [r13], edx
jmp 0x1800b911e
mov rcx, qword [rdi]
movsxd rbx, dword [rcx + 8]
test rbx, rbx
jle 0x1800b90f9
add rdi, 0x46d8
nop dword [rax]
mov rcx, qword [rdi]
test rcx, rcx
je 0x1800b90c5
call qword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
mov qword [rdi], rbp
mov qword [rdi - 8], rbp
mov rcx, qword [rdi + 8]
test rcx, rcx
je 0x1800b90dc
call qword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
mov qword [rdi + 8], rbp
mov qword [rdi + 0x18], rbp
mov rcx, qword [rdi + 0x10]
test rcx, rcx
je 0x1800b90ef
call qword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
mov qword [rdi + 0x10], rbp
add rdi, 0x60
sub rbx, 1
jne 0x1800b90b0
mov edx, dword [0x180143964]
mov rax, qword gs:[0x58]
mov ecx, 0x28
mov rax, qword [rax + rdx*8]
lea rdx, str.outofmem
mov qword [rcx + rax], rdx
xor eax, eax
mov rsi, qword [rsp + 0x1b8]
mov r12, qword [rsp + 0x160]
mov rcx, qword [rsp + 0x150]
xor rcx, rsp
call fcn.1800906c0
add rsp, 0x168
pop r15
pop r14
pop r13
pop rdi
pop rbp
pop rbx
ret