Function at 0x180067900
Capabilities:
Encrypt data using rc4 ksa

Disassembly:
push rbx
push rbp
push rdi
push r12
push r13
push r15
sub rsp, 0xb8
mov rax, qword [0x180089050]
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 + 0x70], r8
mov qword [rsp + 0x48], rdx
cmp rax, rcx
jb 0x1800679a0
cmp dword [rbx + 0x30], ebp
je 0x1800679c1
mov r8d, dword [rbx + 0x34]
lea rdi, [rbx + 0x38]
mov rcx, qword [rbx + 0x28]
mov rdx, rdi
call qword [rbx + 0x10]
mov qword [rbx + 0xb8], rdi
test eax, eax
jne 0x180067989
lea rax, [rbx + 0x39]
mov dword [rbx + 0x30], ebp
mov qword [rbx + 0xc0], rax
mov byte [rdi], bpl
mov rcx, qword [rbx + 0xc0]
jmp 0x180067999
cdqe
lea rcx, [rbx + 0x38]
add rcx, rax
mov qword [rbx + 0xc0], rcx
mov rax, qword [rbx + 0xb8]
movzx edx, byte [rax]
inc rax
movzx r8d, dl
mov dword [rsp + 0x60], r8d
mov qword [rbx + 0xb8], rax
mov byte [rsp + 0x30], dl
cmp rax, rcx
jae 0x1800679ca
jmp 0x180067a1e
mov byte [rsp + 0x30], bpl
mov dword [rsp + 0x60], ebp
cmp dword [rbx + 0x30], 0
je 0x180067a48
mov r8d, dword [rbx + 0x34]
lea rdi, [rbx + 0x38]
mov rcx, qword [rbx + 0x28]
mov rdx, rdi
call qword [rbx + 0x10]
mov qword [rbx + 0xb8], rdi
test eax, eax
jne 0x180067a07
lea rax, [rbx + 0x39]
mov dword [rbx + 0x30], ebp
mov qword [rbx + 0xc0], rax
mov byte [rdi], 0
mov rcx, qword [rbx + 0xc0]
jmp 0x180067a17
cdqe
lea rcx, [rbx + 0x38]
add rcx, rax
mov qword [rbx + 0xc0], rcx
mov rax, qword [rbx + 0xb8]
movzx r15d, byte [rax]
inc rax
movzx edx, r15b
mov dword [rsp + 0x3c], edx
mov qword [rbx + 0xb8], rax
cmp rax, rcx
jae 0x180067a4f
movzx ecx, byte [rax]
inc rax
mov qword [rbx + 0xb8], rax
jmp 0x180067aad
xor r15b, r15b
mov dword [rsp + 0x3c], ebp
cmp dword [rbx + 0x30], 0
je 0x180067aab
mov r8d, dword [rbx + 0x34]
lea rdi, [rbx + 0x38]
mov rcx, qword [rbx + 0x28]
mov rdx, rdi
call qword [rbx + 0x10]
mov qword [rbx + 0xb8], rdi
test eax, eax
jne 0x180067a85
lea rax, [rbx + 0x39]
mov dword [rbx + 0x30], ebp
mov qword [rbx + 0xc0], rax
mov byte [rdi], 0
jmp 0x180067a95
cdqe
lea rcx, [rbx + 0x38]
add rcx, rax
mov qword [rbx + 0xc0], rcx
mov rax, qword [rbx + 0xb8]
movzx ecx, byte [rax]
inc rax
mov qword [rbx + 0xb8], rax
jmp 0x180067aad
xor cl, cl
movzx eax, cl
mov rcx, rbx
mov dword [rsp + 0x40], eax
call fcn.18005ce80
mov rcx, rbx
movsxd r13, eax
call fcn.18005ce80
mov rcx, qword [rbx + 0xb8]
mov dword [rsp + 0x5c], eax
cmp rcx, qword [rbx + 0xc0]
jae 0x180067aea
movzx edx, byte [rcx]
inc rcx
mov qword [rbx + 0xb8], rcx
jmp 0x180067b48
cmp dword [rbx + 0x30], 0
je 0x180067b46
mov r8d, dword [rbx + 0x34]
lea rdi, [rbx + 0x38]
mov rcx, qword [rbx + 0x28]
mov rdx, rdi
call qword [rbx + 0x10]
mov qword [rbx + 0xb8], rdi
test eax, eax
jne 0x180067b20
lea rax, [rbx + 0x39]
mov dword [rbx + 0x30], ebp
mov qword [rbx + 0xc0], rax
mov byte [rdi], 0
jmp 0x180067b30
cdqe
lea rcx, [rbx + 0x38]
add rcx, rax
mov qword [rbx + 0xc0], rcx
mov rax, qword [rbx + 0xb8]
movzx edx, byte [rax]
inc rax
mov qword [rbx + 0xb8], rax
jmp 0x180067b48
xor dl, dl
movzx edx, dl
mov rcx, rbx
mov qword [rsp + 0xb0], rsi
mov dword [rsp + 0x34], edx
mov qword [rsp + 0xa8], r14
call fcn.18005ce80
mov rcx, rbx
call fcn.18005ce80
mov rcx, rbx
call fcn.18005ce80
mov rcx, rbx
mov dword [rsp + 0x44], eax
call fcn.18005ce80
mov rcx, qword [rbx + 0xc0]
mov dword [rsp + 0x54], eax
mov rax, qword [rbx + 0xb8]
cmp rax, rcx
jb 0x180067bee
cmp dword [rbx + 0x30], 0
je 0x180067c16
mov r8d, dword [rbx + 0x34]
lea rdi, [rbx + 0x38]
mov rcx, qword [rbx + 0x28]
mov rdx, rdi
call qword [rbx + 0x10]
mov qword [rbx + 0xb8], rdi
test eax, eax
jne 0x180067bd7
lea rax, [rbx + 0x39]
mov dword [rbx + 0x30], ebp
mov qword [rbx + 0xc0], rax
mov byte [rdi], 0
mov rcx, qword [rbx + 0xc0]
jmp 0x180067be7
cdqe
lea rcx, [rbx + 0x38]
add rcx, rax
mov qword [rbx + 0xc0], rcx
mov rax, qword [rbx + 0xb8]
movzx edx, byte [rax]
inc rax
movzx r14d, dl
mov qword [rbx + 0xb8], rax
mov esi, r14d
cmp rax, rcx
jae 0x180067c1b
movzx ecx, byte [rax]
inc rax
mov qword [rbx + 0xb8], rax
jmp 0x180067c79
mov r14d, ebp
mov esi, ebp
cmp dword [rbx + 0x30], 0
je 0x180067c77
mov r8d, dword [rbx + 0x34]
lea rdi, [rbx + 0x38]
mov rcx, qword [rbx + 0x28]
mov rdx, rdi
call qword [rbx + 0x10]
mov qword [rbx + 0xb8], rdi
test eax, eax
jne 0x180067c51
lea rax, [rbx + 0x39]
mov dword [rbx + 0x30], ebp
mov qword [rbx + 0xc0], rax
mov byte [rdi], 0
jmp 0x180067c61
cdqe
lea rcx, [rbx + 0x38]
add rcx, rax
mov qword [rbx + 0xc0], rcx
mov rax, qword [rbx + 0xb8]
movzx ecx, byte [rax]
inc rax
mov qword [rbx + 0xb8], rax
jmp 0x180067c79
xor cl, cl
mov edx, dword [rsp + 0x40]
mov r12d, 1
cmp edx, 8
movzx eax, cl
mov qword [rsp + 0x78], rbp
mov dword [rsp + 0x88], ebp
lea ecx, [rdx - 8]
mov dword [rsp + 0x50], ebp
cmovb ecx, edx
mov dword [rsp + 0x38], ebp
shr eax, 5
mov edx, r12d
and eax, r12d
sub edx, eax
cmp dword [rsp + 0x3c], 0
mov dword [rsp + 0x68], edx
je 0x180067cde
mov esi, dword [rsp + 0x34]
mov ecx, esi
sub ecx, 8
je 0x180067d32
sub ecx, 7
je 0x180067d22
sub ecx, r12d
je 0x180067d22
sub ecx, 8
je 0x180067cfe
cmp ecx, 8
jne 0x180068496
jmp 0x180067cfe
sub esi, 8
je 0x180067d32
sub esi, 7
je 0x180067d22
sub esi, r12d
je 0x180067d12
sub esi, 8
je 0x180067cfb
cmp esi, 8
jne 0x180068496
mov esi, r14d
shr esi, 3
mov dword [rsp + 0x34], esi
mov dword [rsp + 0x38], ebp
test esi, esi
jne 0x180067d3a
jmp 0x180068496
cmp ecx, 3
jne 0x180067d22
mov esi, 2
mov dword [rsp + 0x34], esi
jmp 0x180067d3a
mov esi, 3
mov dword [rsp + 0x38], r12d
mov dword [rsp + 0x34], esi
jmp 0x180067d3a
mov dword [rsp + 0x34], r12d
mov esi, r12d
mov rax, qword [rsp + 0x48]
mov r9d, dword [rsp + 0x44]
mov r8d, dword [rsp + 0x54]
mov dword [rax], r9d
mov rax, qword [rsp + 0x70]
mov dword [rax], r8d
mov rax, qword [rsp + 0x80]
test rax, rax
je 0x180067d63
mov dword [rax], esi
test r9d, r9d
js 0x180068496
test r8d, r8d
js 0x180068496
je 0x180067d90
mov eax, 0x7fffffff
mov ecx, ebp
cdq
idiv r8d
cmp r9d, eax
setle cl
test ecx, ecx
je 0x180068496
mov ecx, r8d
imul ecx, r9d
mov dword [rsp + 0x70], ecx
test ecx, ecx
js 0x180068496
xor edx, edx
mov eax, 0x7fffffff
div esi
mov edi, eax
cmp ecx, eax
jg 0x180068496
test r8d, r8d
je 0x180067dcd
mov eax, 0x7fffffff
cdq
idiv r8d
cmp r9d, eax
jg 0x180068496
mov eax, esi
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 0x180068496
cmp qword [rbx + 0x10], 0
je 0x180067e2a
mov ecx, dword [rbx + 0xc0]
sub ecx, dword [rbx + 0xb8]
mov edx, dword [rsp + 0x60]
cmp ecx, edx
jge 0x180067e2a
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 0x180067e36
movzx eax, byte [rsp + 0x30]
add qword [rbx + 0xb8], rax
cmp dword [rsp + 0x3c], 0
jne 0x180067eee
mov ecx, dword [rsp + 0x40]
mov dword [rsp + 0x3c], r14d
mov byte [rsp + 0x30], r15b
cmp ecx, 8
jae 0x180068036
mov eax, dword [rsp + 0x38]
mov dword [rsp + 0x3c], r14d
mov byte [rsp + 0x30], r15b
test eax, eax
jne 0x180068036
mov r15d, dword [rsp + 0x54]
mov r12d, dword [rsp + 0x44]
test r15d, r15d
jle 0x18006842f
mov ebp, r12d
mov edi, r15d
imul ebp, esi
cmp dword [rsp + 0x68], eax
je 0x180067ecc
mov eax, ebp
neg eax
movsxd r14, eax
lea eax, [r15 - 1]
imul eax, esi
imul eax, r12d
movsxd rsi, eax
add rsi, r8
nop dword [rax + rax]
mov r8d, ebp
mov rdx, rsi
mov rcx, rbx
call fcn.18005cc90
add rsi, r14
sub rdi, 1
jne 0x180067eb0
jmp 0x18006842b
movsxd r14, ebp
mov rsi, r8
mov r8d, ebp
mov rdx, rsi
mov rcx, rbx
call fcn.18005cc90
add rsi, r14
sub rdi, 1
jne 0x180067ed2
jmp 0x18006842b
test r13d, r13d
jns 0x180067f03
mov rax, qword [rbx + 0xc0]
mov qword [rbx + 0xb8], rax
jmp 0x180067f3f
cmp qword [rbx + 0x10], 0
je 0x180067f38
mov ecx, dword [rbx + 0xc0]
sub ecx, dword [rbx + 0xb8]
cmp ecx, r13d
jge 0x180067f38
mov rax, qword [rbx + 0xc0]
sub r13d, ecx
mov rcx, qword [rbx + 0x28]
mov edx, r13d
mov qword [rbx + 0xb8], rax
call qword [rbx + 0x18]
jmp 0x180067f3f
add qword [rbx + 0xb8], r13
mov ecx, dword [rsp + 0x5c]
test ecx, ecx
js 0x18006848b
cmp ecx, edi
mov eax, ebp
setle al
test eax, eax
je 0x18006848b
mov edi, esi
imul edi, ecx
movsxd rcx, edi
call qword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_malloc]
mov qword [rsp + 0x78], rax
mov r13, rax
test rax, rax
je 0x18006848b
cmp dword [rsp + 0x38], 0
mov dword [rsp + 0x3c], r14d
mov byte [rsp + 0x30], r15b
je 0x18006809a
mov rdi, rax
mov eax, dword [rsp + 0x5c]
test eax, eax
jle 0x180068032
mov r13d, esi
mov esi, eax
mov dword [rsp + 0x3c], r14d
mov byte [rsp + 0x30], r15b
nop dword [rax]
mov rcx, rbx
call fcn.18005ce80
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, r13
sub rsi, r12
jne 0x180067fb0
mov esi, dword [rsp + 0x34]
mov ecx, dword [rsp + 0x40]
mov eax, dword [rsp + 0x70]
mov r14d, esi
test eax, eax
jle 0x1800683a8
mov r15, qword [rsp + 0x48]
lea rdx, [rsp + 0x88]
sub r15, rdx
mov r10d, esi
mov r9d, eax
mov qword [rsp + 0x60], rax
mov r8d, ebp
mov r13d, ebp
cmp ecx, 8
jb 0x180068145
test r8d, r8d
jne 0x180068137
mov rax, qword [rbx + 0xb8]
cmp rax, qword [rbx + 0xc0]
jae 0x1800680bf
movzx ecx, byte [rax]
inc rax
mov qword [rbx + 0xb8], rax
jmp 0x18006811d
mov r8d, edi
mov rdx, r13
mov rcx, rbx
call fcn.18005cc90
test eax, eax
jne 0x180068032
mov rcx, qword [rsp + 0x48]
call qword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
mov rcx, r13
jmp 0x180068490
cmp dword [rbx + 0x30], 0
je 0x18006811b
mov r8d, dword [rbx + 0x34]
lea rdi, [rbx + 0x38]
mov rcx, qword [rbx + 0x28]
mov rdx, rdi
call qword [rbx + 0x10]
mov qword [rbx + 0xb8], rdi
test eax, eax
jne 0x1800680f5
lea rax, [rbx + 0x39]
mov dword [rbx + 0x30], ebp
mov qword [rbx + 0xc0], rax
mov byte [rdi], 0
jmp 0x180068105
cdqe
lea rcx, [rbx + 0x38]
add rcx, rax
mov qword [rbx + 0xc0], rcx
mov rax, qword [rbx + 0xb8]
movzx ecx, byte [rax]
inc rax
mov qword [rbx + 0xb8], rax
jmp 0x18006811d
xor cl, cl
movzx eax, cl
mov r8d, eax
and r8d, 0x7f
inc r8d
shr eax, 7
mov r13d, eax
mov dword [rsp + 0x50], r8d
jmp 0x180068145
test r13d, r13d
je 0x180068145
test r12d, r12d
je 0x180068364
cmp byte [rsp + 0x30], 0
je 0x18006821b
cmp dword [rsp + 0x3c], 8
jne 0x1800681e3
mov rax, qword [rbx + 0xb8]
cmp rax, qword [rbx + 0xc0]
jae 0x18006817d
movzx ecx, byte [rax]
inc rax
mov qword [rbx + 0xb8], rax
movzx eax, cl
jmp 0x1800681eb
cmp dword [rbx + 0x30], 0
je 0x1800681dc
mov r8d, dword [rbx + 0x34]
lea rdi, [rbx + 0x38]
mov rcx, qword [rbx + 0x28]
mov rdx, rdi
call qword [rbx + 0x10]
mov qword [rbx + 0xb8], rdi
test eax, eax
jne 0x1800681b3
lea rax, [rbx + 0x39]
mov dword [rbx + 0x30], ebp
mov qword [rbx + 0xc0], rax
mov byte [rdi], 0
jmp 0x1800681c3
cdqe
lea rcx, [rbx + 0x38]
add rcx, rax
mov qword [rbx + 0xc0], rcx
mov rax, qword [rbx + 0xb8]
movzx ecx, byte [rax]
inc rax
mov qword [rbx + 0xb8], rax
movzx eax, cl
jmp 0x1800681eb
xor cl, cl
movzx eax, cl
jmp 0x1800681eb
mov rcx, rbx
call fcn.18005ce80
cmp eax, dword [rsp + 0x5c]
cmovge eax, ebp
test r14, r14
je 0x180068354
imul eax, esi
lea rcx, [rsp + 0x88]
mov r8, r14
movsxd rdx, eax
add rdx, qword [rsp + 0x78]
call sub.VCRUNTIME140.dll_memcpy
jmp 0x180068354
cmp dword [rsp + 0x38], 0
je 0x1800682ae
mov rcx, rbx
call fcn.18005ce80
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 0x180068354
mov rsi, rbp
test r14, r14
je 0x180068350
nop word [rax + rax]
mov rax, qword [rbx + 0xb8]
cmp rax, qword [rbx + 0xc0]
jae 0x1800682df
movzx ecx, byte [rax]
inc rax
mov qword [rbx + 0xb8], rax
jmp 0x18006833d
cmp dword [rbx + 0x30], 0
je 0x18006833b
mov r8d, dword [rbx + 0x34]
lea rdi, [rbx + 0x38]
mov rcx, qword [rbx + 0x28]
mov rdx, rdi
call qword [rbx + 0x10]
mov qword [rbx + 0xb8], rdi
test eax, eax
jne 0x180068315
lea rax, [rbx + 0x39]
mov dword [rbx + 0x30], ebp
mov qword [rbx + 0xc0], rax
mov byte [rdi], 0
jmp 0x180068325
cdqe
lea rcx, [rbx + 0x38]
add rcx, rax
mov qword [rbx + 0xc0], rcx
mov rax, qword [rbx + 0xb8]
movzx ecx, byte [rax]
inc rax
mov qword [rbx + 0xb8], rax
jmp 0x18006833d
xor cl, cl
mov byte [rsp + rsi + 0x88], cl
inc rsi
cmp rsi, r14
jl 0x1800682c0
mov esi, dword [rsp + 0x34]
mov r8d, dword [rsp + 0x50]
mov r12d, ebp
mov r9, qword [rsp + 0x60]
mov r10d, esi
mov rdx, rbp
test r14, r14
je 0x18006838a
nop dword [rax]
lea rcx, [rsp + 0x88]
add rcx, rdx
inc rdx
movzx eax, byte [rcx]
mov byte [r15 + rcx], al
cmp rdx, r14
jl 0x180068370
mov ecx, dword [rsp + 0x40]
dec r8d
add r15, r10
mov dword [rsp + 0x50], r8d
sub r9, 1
mov qword [rsp + 0x60], r9
jne 0x180068066
cmp dword [rsp + 0x68], 0
mov r15d, dword [rsp + 0x54]
mov r12d, dword [rsp + 0x44]
je 0x180068418
test r15d, r15d
jle 0x180068418
mov rdi, qword [rsp + 0x48]
lea r10d, [r15 - 1]
imul r10d, esi
mov r11d, esi
imul r11d, r12d
mov ebx, ebp
imul r10d, r12d
mov r8d, r11d
test r11d, r11d
jle 0x18006840a
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 0x1800683f0
add ebx, r11d
sub r10d, r11d
add ebp, 2
cmp ebp, r15d
jl 0x1800683d8
mov rax, qword [rsp + 0x78]
test rax, rax
je 0x18006842b
mov rcx, rax
call qword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
mov eax, dword [rsp + 0x38]
mov edx, dword [rsp + 0x34]
cmp edx, 3
jb 0x180068469
test eax, eax
mov rax, qword [rsp + 0x48]
jne 0x18006846e
mov ecx, dword [rsp + 0x70]
mov r8, rax
test ecx, ecx
jle 0x18006846e
mov r10d, ecx
nop
movzx ecx, byte [r8]
movzx eax, byte [r8 + 2]
mov byte [r8], al
mov byte [r8 + 2], cl
add r8, rdx
sub r10, 1
jne 0x180068450
mov rax, qword [rsp + 0x48]
cmp edx, 4
je 0x180068498
mov r9d, r12d
mov dword [rsp + 0x20], r15d
mov r8d, 4
mov rcx, rax
call fcn.18005cfa0
jmp 0x180068498
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 rsi, qword [rsp + 0xb0]
mov rcx, qword [rsp + 0x90]
xor rcx, rsp
call fcn.1800722b0
add rsp, 0xb8
pop r15
pop r13
pop r12
pop rdi
pop rbp
pop rbx
ret