Function at 0x140054e50
Capabilities:
Encrypt data using rc4 ksa

Disassembly:
mov qword [rsp + 0x18], rbx
mov dword [rsp + 0x20], r9d
push rbp
push rsi
push rdi
push r12
push r13
push r14
push r15
sub rsp, 0x90
movsxd r14, dword [rsp + 0xf0]
xor r13d, r13d
mov ebp, dword [rsp + 0x100]
mov rdi, rcx
mov eax, r9d
cmp ebp, 0x10
mov r9d, dword [rsp + 0xf8]
mov r10d, r13d
sete r10b
mov esi, r8d
inc r10d
mov r15, rdx
mov ecx, r10d
imul ecx, eax
mov rax, qword [rdi]
mov r12d, dword [rax + 8]
mov r11d, ecx
imul r11d, r14d
mov eax, r12d
imul eax, r10d
mov dword [rsp + 0x40], r12d
mov dword [rsp + 0x4c], r11d
mov dword [rsp + 0xd0], eax
test r14d, r14d
js 0x140055a20
test r9d, r9d
js 0x140055a20
mov ebx, 0x7fffffff
je 0x140054ef4
xor edx, edx
mov eax, ebx
div r9d
cmp r14d, eax
jg 0x140055a20
mov r8d, r14d
imul r8d, r9d
test r8d, r8d
js 0x140055a20
test ecx, ecx
js 0x140055a20
je 0x140054f1c
mov eax, ebx
cdq
idiv ecx
cmp r8d, eax
jg 0x140055a20
mov eax, r9d
imul eax, r11d
movsxd rcx, eax
call qword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_malloc]
mov qword [rdi + 0x18], rax
test rax, rax
je 0x140055a24
test r12d, r12d
js 0x140055a0b
test r14d, r14d
je 0x140054f57
xor edx, edx
mov eax, ebx
div r14d
cmp r12d, eax
jg 0x140055a0b
imul r12d, r14d
test r12d, r12d
js 0x140055a0b
test ebp, ebp
js 0x140055a0b
je 0x140054f7d
xor edx, edx
mov eax, ebx
div ebp
cmp r12d, eax
jg 0x140055a0b
mov eax, r12d
imul eax, ebp
cmp eax, 0x7ffffff8
jg 0x140055a0b
mov ecx, dword [rsp + 0xf8]
imul ebp, r12d
add ebp, 7
shr ebp, 3
mov dword [rsp + 0x48], ebp
test ecx, ecx
je 0x140054fb5
xor edx, edx
mov eax, ebx
div ecx
cmp ebp, eax
jg 0x140055a0b
mov eax, ebp
sub ebx, ebp
imul eax, ecx
cmp eax, ebx
jg 0x140055a0b
lea eax, [rbp + 1]
imul eax, ecx
cmp esi, eax
jae 0x140054fe6
mov rax, qword gs:[0x58]
mov rcx, qword [rax]
lea rax, str.not_enough_pixels
jmp 0x140055a37
lea ecx, [rbp*2]
call qword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_malloc]
mov qword [rsp + 0x28], rax
mov r9, rax
test rax, rax
je 0x140055a24
movsxd rsi, dword [rsp + 0x100]
mov ebx, 1
cmp esi, 8
jge 0x140055023
mov eax, ebx
mov dword [rsp + 0xd0], ebx
mov ecx, ebp
jmp 0x14005502d
mov eax, dword [rsp + 0xd0]
mov ecx, r14d
mov edx, r13d
mov dword [rsp + 0x44], edx
cmp dword [rsp + 0xf8], edx
jbe 0x1400559f8
mov r8, qword [rdi + 0x18]
mov qword [rsp + 0x60], r8
lea r8, [0x1400bddb0]
add r8, rsi
movsxd r10, eax
imul ecx, eax
mov qword [rsp + 0x58], r14
mov r14d, r12d
mov qword [rsp + 0x80], r8
mov qword [rsp + 0x38], r10
mov ebp, r12d
movsxd rax, ecx
mov dword [rsp + 0x50], ecx
mov rcx, rax
mov qword [rsp + 0x68], rax
mov eax, edx
mov qword [rsp + 0x20], rcx
and eax, 1
mov qword [rsp + 0x78], r15
imul eax, dword [rsp + 0x48]
mov r11d, edx
not r11d
mov edi, edx
imul edi, dword [rsp + 0x4c]
and r11d, 1
imul r11d, dword [rsp + 0x48]
mov r13, r15
mov ecx, eax
mov qword [rsp + 0x30], rcx
add rdi, qword [rsp + 0x60]
lea rbx, [rax + r9]
mov qword [rsp + 0x70], rdi
movzx eax, byte [r15]
add r11, r9
inc r15
cmp eax, 4
ja 0x1400559d1
lea r8, [0x140000000]
test edx, edx
jne 0x1400550f7
mov rdx, qword [rsp + 0x68]
movzx eax, byte [rax + r8 + 0xb9b48]
mov qword [rsp + 0x20], rdx
jmp 0x1400550fc
mov rdx, qword [rsp + 0x20]
cmp eax, 5
ja case.default.0x140055112
cdqe
mov ecx, dword [r8 + rax*4 + 0x55a60]
add rcx, r8
jmp rcx
mov r8, rdx
mov rcx, rbx
mov rdx, r15
call sub.VCRUNTIME140.dll_memcpy
jmp 0x140055619
mov r8, r10
mov rdx, r15
mov rcx, rbx
call sub.VCRUNTIME140.dll_memcpy
mov r10, qword [rsp + 0x38]
mov r11, qword [rsp + 0x20]
cmp r10, r11
jge 0x140055175
mov r8, rbx
lea rcx, [r10 + 1]
sub r8, r10
mov r9, rbx
sub r8, r15
add rcx, r13
sub r9, r15
mov rdx, r11
sub rdx, r10
movzx eax, byte [r8 + rcx]
add al, byte [rcx]
mov byte [r9 + rcx], al
lea rcx, [rcx + 1]
sub rdx, 1
jne 0x140055160
mov rcx, qword [rsp + 0x30]
jmp 0x140055623
mov r10d, dword [rsp + 0x50]
xor eax, eax
mov edx, eax
test r10d, r10d
jle 0x1400552c2
cmp r10d, 8
jb 0x1400552c2
lea eax, [r10 - 1]
movsxd rcx, eax
lea rax, [rcx + r15]
lea r8, [rcx + rbx]
cmp rbx, rax
ja 0x1400551b8
cmp r8, r15
jae 0x1400552c2
lea rax, [rcx + r11]
cmp rbx, rax
ja 0x1400551ca
cmp r8, r11
jae 0x1400552c2
cmp r10d, 0x40
jb 0x14005526f
mov ecx, r10d
and ecx, 0x8000003f
jge 0x1400551e6
dec ecx
or ecx, 0xffffffc0
inc ecx
mov eax, r10d
sub eax, ecx
mov rcx, r11
movsxd r9, eax
sub rcx, r15
lea rax, [r13 + 0x11]
mov r8, rbx
sub r8, r15
nop
movdqu xmm0, xmmword [rax - 0x10]
add rdx, 0x40
movdqu xmm1, xmmword [rcx + rax - 0x10]
movdqu xmm2, xmmword [rax + rcx]
lea rax, [rax + 0x40]
paddb xmm1, xmm0
movdqu xmm0, xmmword [rax - 0x40]
movdqu xmmword [r8 + rax - 0x50], xmm1
paddb xmm2, xmm0
movdqu xmm0, xmmword [rax - 0x30]
movdqu xmm1, xmmword [rcx + rax - 0x30]
movdqu xmmword [rax + r8 - 0x40], xmm2
paddb xmm1, xmm0
movdqu xmm0, xmmword [rax - 0x20]
movdqu xmm2, xmmword [rcx + rax - 0x20]
movdqu xmmword [r8 + rax - 0x30], xmm1
paddb xmm2, xmm0
movdqu xmmword [r8 + rax - 0x20], xmm2
cmp rdx, r9
jl 0x140055200
mov eax, r10d
and al, 0x3f
cmp al, 8
jb 0x1400552c2
jmp 0x140055275
mov rcx, r11
sub rcx, r15
mov r8d, r10d
and r8d, 0x80000007
jge 0x14005528b
dec r8d
or r8d, 0xfffffff8
inc r8d
mov eax, r10d
sub eax, r8d
movsxd r9, eax
mov r8, rbx
lea rax, [r13 + 1]
add rax, rdx
sub r8, r15
movq xmm1, qword [rax + rcx]
add rdx, 8
movq xmm0, qword [rax]
lea rax, [rax + 8]
paddb xmm1, xmm0
movq qword [rax + r8 - 8], xmm1
cmp rdx, r9
jl 0x1400552a1
cmp rdx, qword [rsp + 0x20]
jge 0x140055619
mov r8, qword [rsp + 0x20]
lea rcx, [r13 + 1]
mov r9, rbx
add rcx, rdx
sub r9, r15
sub r11, r15
sub r8, rdx
nop word [rax + rax]
movzx eax, byte [rcx + r11]
add al, byte [rcx]
mov byte [rcx + r9], al
lea rcx, [rcx + 1]
sub r8, 1
jne 0x1400552f0
jmp 0x140055619
test r10, r10
jle 0x14005533a
mov r8, r11
mov r9, rbx
sub r8, r15
mov rcx, r15
sub r9, r15
mov rdx, r10
movzx eax, byte [rcx + r8]
lea rcx, [rcx + 1]
shr al, 1
add al, byte [rcx - 1]
mov byte [rcx + r9 - 1], al
sub rdx, 1
jne 0x140055321
mov rcx, qword [rsp + 0x20]
cmp r10, rcx
jge 0x140055619
lea rdx, [r10 + r11]
mov r9, rbx
sub r9, r10
sub r15, r11
mov r10, rbx
sub r9, r11
sub r10, r11
mov r8, rcx
sub r8, qword [rsp + 0x38]
nop word [rax + rax]
movzx ecx, byte [r9 + rdx]
movzx eax, byte [rdx]
lea rdx, [rdx + 1]
add ecx, eax
shr ecx, 1
add cl, byte [r15 + rdx - 1]
mov byte [r10 + rdx - 1], cl
sub r8, 1
jne 0x140055370
jmp 0x140055619
mov r9d, dword [rsp + 0xd0]
xor eax, eax
mov edx, eax
test r9d, r9d
jle 0x1400554f1
cmp r9d, 8
jb 0x1400554f1
lea eax, [r9 - 1]
movsxd rcx, eax
lea rax, [rcx + r15]
lea r8, [rcx + rbx]
cmp rbx, rax
ja 0x1400553d1
cmp r8, r15
jae 0x1400554f1
lea rax, [rcx + r11]
cmp rbx, rax
ja 0x1400553e3
cmp r8, r11
jae 0x1400554f1
cmp r9d, 0x40
jb 0x140055497
mov ecx, r9d
and ecx, 0x8000003f
jge 0x1400553ff
dec ecx
or ecx, 0xffffffc0
inc ecx
mov eax, r9d
sub eax, ecx
mov rcx, r11
movsxd r9, eax
sub rcx, r15
lea rax, [r13 + 0x11]
mov r8, rbx
sub r8, r15
nop word [rax + rax]
movdqu xmm0, xmmword [rax - 0x10]
add rdx, 0x40
movdqu xmm1, xmmword [rcx + rax - 0x10]
movdqu xmm2, xmmword [rcx + rax]
lea rax, [rax + 0x40]
paddb xmm1, xmm0
movdqu xmm0, xmmword [rax - 0x40]
movdqu xmmword [r8 + rax - 0x50], xmm1
paddb xmm2, xmm0
movdqu xmm0, xmmword [rax - 0x30]
movdqu xmm1, xmmword [rcx + rax - 0x30]
movdqu xmmword [r8 + rax - 0x40], xmm2
paddb xmm1, xmm0
movdqu xmm0, xmmword [rax - 0x20]
movdqu xmm2, xmmword [rcx + rax - 0x20]
movdqu xmmword [r8 + rax - 0x30], xmm1
paddb xmm2, xmm0
movdqu xmmword [r8 + rax - 0x20], xmm2
cmp rdx, r9
jl 0x140055420
mov r9d, dword [rsp + 0xd0]
mov eax, r9d
and al, 0x3f
cmp al, 8
jb 0x1400554f1
jmp 0x14005549d
mov rcx, r11
sub rcx, r15
mov r8d, r9d
and r8d, 0x80000007
jge 0x1400554b3
dec r8d
or r8d, 0xfffffff8
inc r8d
mov eax, r9d
sub eax, r8d
movsxd r9, eax
mov r8, rbx
lea rax, [r13 + 1]
add rax, rdx
sub r8, r15
nop dword [rax]
movq xmm1, qword [rax + rcx]
add rdx, 8
movq xmm0, qword [rax]
lea rax, [rax + 8]
paddb xmm1, xmm0
movq qword [r8 + rax - 8], xmm1
cmp rdx, r9
jl 0x1400554d0
cmp rdx, r10
jge 0x14005552b
mov r8, qword [rsp + 0x38]
lea rcx, [r13 + 1]
mov r9, r11
mov r10, rbx
add rcx, rdx
sub r9, r15
sub r10, r15
sub r8, rdx
movzx eax, byte [r9 + rcx]
add al, byte [rcx]
mov byte [rcx + r10], al
lea rcx, [rcx + 1]
sub r8, 1
jne 0x140055511
mov r10, qword [rsp + 0x38]
cmp r10, qword [rsp + 0x20]
jge 0x140055619
mov rax, qword [rsp + 0x38]
mov rsi, r11
mov rdi, qword [rsp + 0x38]
sub rax, rbx
sub rsi, rbx
add r13, rax
mov r10, rbx
lea r15, [rax + r11]
mov r11, qword [rsp + 0x20]
sub r11, qword [rsp + 0x38]
nop dword [rax]
movzx eax, byte [r15 + r10]
movzx r9d, byte [r10]
mov edx, eax
movzx ecx, byte [rsi + r10]
lea r10, [r10 + 1]
lea r8d, [rcx + rcx*2]
sub r8d, r9d
sub r8d, eax
cmp r9d, eax
cmovb edx, r9d
cmovb r9d, eax
cmp r9d, r8d
movzx eax, dl
cmovle ecx, eax
cmp r8d, edx
movzx ecx, cl
movzx eax, r9b
cmovle ecx, eax
add cl, byte [r10 + r13]
mov byte [r10 + rdi - 1], cl
sub r11, 1
jne 0x140055560
mov rdi, qword [rsp + 0x70]
mov r13, qword [rsp + 0x78]
mov esi, dword [rsp + 0x100]
jmp 0x140055619
mov r8, r10
mov rdx, r15
mov rcx, rbx
call sub.VCRUNTIME140.dll_memcpy
mov r10, qword [rsp + 0x38]
cmp r10, qword [rsp + 0x20]
jge 0x140055619
mov rdx, qword [rsp + 0x20]
lea rcx, [r10 + 1]
mov r8, rbx
mov r9, rbx
sub r8, r10
add rcx, r13
sub r8, r15
sub r9, r15
sub rdx, r10
nop dword [rax]
movzx eax, byte [r8 + rcx]
lea rcx, [rcx + 1]
shr al, 1
add al, byte [rcx - 1]
mov byte [r9 + rcx - 1], al
sub rdx, 1
jne 0x140055600
mov rcx, qword [rsp + 0x30]
mov r11, qword [rsp + 0x20]
lea r15, [r13 + 1]
add r15, r11
mov qword [rsp + 0xd8], r15
cmp esi, 8
jge 0x14005581e
cmp dword [rsp + 0x108], 0
jne 0x140055653
mov rax, qword [rsp + 0x80]
movzx r15d, byte [rax]
jmp 0x140055656
mov r15b, 1
xor r8b, r8b
mov r9, rdi
cmp esi, 4
jne 0x1400556b2
xor esi, esi
test r14d, r14d
je 0x14005574c
nop dword [rax]
mov r11d, esi
and r11d, 1
jne 0x14005567d
movzx r8d, byte [rbx]
movzx eax, r8b
movzx ecx, r15b
shr al, 4
inc esi
movzx edx, al
lea rax, [rbx + 1]
imul edx, ecx
shl r8b, 4
mov byte [r9], dl
inc r9
test r11d, r11d
cmovne rax, rbx
mov rbx, rax
cmp esi, r14d
jb 0x140055670
jmp 0x14005574c
cmp esi, 2
jne 0x140055701
xor esi, esi
test r14d, r14d
je 0x14005574c
mov r11d, esi
and r11d, 3
jne 0x1400556cf
movzx r8d, byte [rbx]
movzx eax, r8b
movzx ecx, r15b
shr al, 6
inc esi
movzx edx, al
lea rax, [rbx + 1]
imul edx, ecx
shl r8b, 2
mov byte [r9], dl
inc r9
test r11d, r11d
cmovne rax, rbx
mov rbx, rax
cmp esi, r14d
jb 0x1400556c2
jmp 0x14005574c
xor esi, esi
test r14d, r14d
je 0x14005574c
nop dword [rax + rax]
mov r11d, esi
and r11d, 7
jne 0x14005571d
movzx r8d, byte [rbx]
movzx eax, r8b
movzx ecx, r15b
shr al, 7
add r8b, r8b
movzx edx, al
inc esi
imul edx, ecx
lea rax, [rbx + 1]
mov byte [r9], dl
inc r9
test r11d, r11d
cmovne rax, rbx
mov rbx, rax
cmp esi, r14d
jb 0x140055710
mov eax, dword [rsp + 0x40]
cmp eax, dword [rsp + 0xe8]
je 0x140055782
mov rcx, qword [rsp + 0x58]
dec rcx
cmp eax, 1
jne 0x1400557ca
test rcx, rcx
js 0x140055782
nop dword [rax + rax]
mov byte [rdi + rcx*2 + 1], 0xff
movzx eax, byte [rcx + rdi]
mov byte [rdi + rcx*2], al
sub rcx, 1
jns 0x140055770
mov r15, qword [rsp + 0xd8]
mov esi, dword [rsp + 0x100]
mov r9, qword [rsp + 0x28]
mov edx, dword [rsp + 0x44]
mov r10, qword [rsp + 0x38]
inc edx
mov rcx, qword [rsp + 0x20]
mov dword [rsp + 0x44], edx
cmp edx, dword [rsp + 0xf8]
jb 0x140055081
mov rcx, r9
call qword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
mov eax, 1
jmp 0x140055a42
test rcx, rcx
js 0x140055782
lea r8, [rcx*2 + 1]
add r8, rdi
lea rdx, [rcx*4 + 2]
add r8, rcx
add rdx, rdi
nop dword [rax + rax]
sub rcx, 1
mov byte [rdx + 1], 0xff
movzx eax, byte [r8 + 1]
lea r8, [r8 - 3]
mov byte [rdx], al
lea rdx, [rdx - 4]
movzx eax, byte [r8 + 3]
mov byte [rdx + 3], al
movzx eax, byte [r8 + 2]
mov byte [rdx + 2], al
jns 0x1400557f0
jmp 0x140055782
jne 0x1400558ce
mov eax, dword [rsp + 0x40]
cmp eax, dword [rsp + 0xe8]
jne 0x140055844
mov r8, rbp
mov rdx, rbx
mov rcx, rdi
call sub.VCRUNTIME140.dll_memcpy
jmp 0x140055791
mov rcx, qword [rsp + 0x58]
dec rcx
cmp eax, 1
jne 0x140055877
test rcx, rcx
js 0x140055791
nop word [rax + rax]
mov byte [rdi + rcx*2 + 1], 0xff
movzx eax, byte [rcx + rbx]
mov byte [rdi + rcx*2], al
sub rcx, 1
jns 0x140055860
jmp 0x140055791
test rcx, rcx
js 0x140055791
lea r8, [rcx*2 + 1]
add r8, rbx
lea rdx, [rcx*4 + 2]
add r8, rcx
add rdx, rdi
nop dword [rax]
sub rcx, 1
mov byte [rdx + 1], 0xff
movzx eax, byte [r8 + 1]
lea r8, [r8 - 3]
mov byte [rdx], al
lea rdx, [rdx - 4]
movzx eax, byte [r8 + 3]
mov byte [rdx + 3], al
movzx eax, byte [r8 + 2]
mov byte [rdx + 2], al
jns 0x1400558a0
jmp 0x140055791
cmp esi, 0x10
jne 0x140055791
mov eax, dword [rsp + 0x40]
cmp eax, dword [rsp + 0xe8]
jne 0x140055927
mov r9, qword [rsp + 0x28]
test r12d, r12d
je 0x140055796
sub rcx, rdi
mov edx, r12d
lea r8, [rcx + r9]
nop dword [rax]
movzx eax, byte [rbx]
lea rbx, [rbx + 2]
movzx ecx, byte [r8 + rdi + 1]
lea rdi, [rdi + 2]
shl ax, 8
or cx, ax
mov word [rdi - 2], cx
sub rdx, 1
jne 0x140055900
jmp 0x140055796
cmp eax, 1
mov eax, dword [rsp + 0xf0]
jne 0x14005596b
test eax, eax
je 0x140055791
mov edx, eax
nop dword [rax]
movzx ecx, byte [rbx]
lea rdi, [rdi + 4]
movzx eax, byte [rbx + 1]
lea rbx, [rbx + 2]
shl cx, 8
or cx, ax
mov word [rdi - 2], 0xffff
mov word [rdi - 4], cx
sub rdx, 1
jne 0x140055940
jmp 0x14005578a
test eax, eax
je 0x140055791
add rdi, 4
mov rdx, rax
nop word [rax + rax]
movzx ecx, byte [rbx]
lea rdi, [rdi + 8]
movzx eax, byte [rbx + 1]
lea rbx, [rbx + 6]
shl cx, 8
or cx, ax
mov word [rdi - 0xc], cx
movzx ecx, byte [rbx - 4]
movzx eax, byte [rbx - 3]
shl cx, 8
or cx, ax
mov word [rdi - 0xa], cx
movzx ecx, byte [rbx - 2]
movzx eax, byte [rbx - 1]
shl cx, 8
or cx, ax
mov word [rdi - 6], 0xffff
mov word [rdi - 8], cx
sub rdx, 1
jne 0x140055980
jmp 0x14005578a
mov rax, qword gs:[0x58]
mov edx, 0x28
mov rcx, qword [rax]
lea rax, str.invalid_filter
mov qword [rdx + rcx], rax
mov rcx, r9
call qword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
jmp 0x140055a40
mov rcx, r9
call qword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
test ebx, ebx
mov rax, r13
setne al
jmp 0x140055a42
mov rax, qword gs:[0x58]
mov rcx, qword [rax]
lea rax, str.too_large
jmp 0x140055a37
mov qword [rdi + 0x18], r13
mov rax, qword gs:[0x58]
mov rcx, qword [rax]
lea rax, str.outofmem
mov edx, 0x28
mov qword [rdx + rcx], rax
xor eax, eax
mov rbx, qword [rsp + 0xe0]
add rsp, 0x90
pop r15
pop r14
pop r13
pop r12
pop rdi
pop rsi
pop rbp
ret