Function at 0x564320
Capabilities:
Encrypt data using rc4 ksa

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x9e4
push ebx
push esi
lea esi, [ebp - 0x9e4]
call fcn.004c5c33
mov ecx, dword [edi]
mov eax, ecx
sar eax, 2
lea edx, [eax + eax]
sub ecx, edx
mov edx, dword [ebp + 0xc]
imul ecx, dword [ebp + 0x10]
sub edx, 0xffffff80
and edx, 0x1ff
mov ebx, dword [edx*4 + 0x69d030]
mov edx, dword [ebp + 0x14]
imul ebx, eax
and dword [ebp + 0x10], 0
sar ebx, 0x10
add ebx, eax
mov eax, dword [edi + 4]
sar ecx, 7
dec eax
dec eax
imul eax, edx
add eax, dword [ebp + 8]
cmp dword [edi], 0
mov dword [ebp - 8], ecx
jle 0x564460
lea esi, [eax + 1]
mov eax, dword [ebp + 0x18]
sub eax, 0
je 0x564408
dec eax
je 0x5643da
dec eax
jne 0x56444f
cmp ebx, dword [ebp + 0x10]
jg 0x5643b1
lea eax, [ebx + ecx]
cmp dword [ebp + 0x10], eax
jge 0x5643b1
mov byte [esi + 1], 0
mov byte [esi], 0x80
mov byte [esi - 1], 0x80
jmp 0x564420
lea edx, [ebp - 0x9e4]
call fcn.004c5c6d
xor edx, edx
push 3
pop ecx
div ecx
mov ecx, dword [ebp - 8]
test edx, edx
mov edx, dword [ebp + 0x14]
jne 0x56444b
mov byte [esi], 0xff
mov byte [esi + 1], 0
mov byte [esi - 1], 0xff
jmp 0x564420
cmp ebx, dword [ebp + 0x10]
jg 0x5643e7
lea eax, [ebx + ecx]
cmp dword [ebp + 0x10], eax
jl 0x5643a4
lea edx, [ebp - 0x9e4]
call fcn.004c5c6d
xor edx, edx
push 3
pop ecx
div ecx
mov ecx, dword [ebp - 8]
test edx, edx
mov edx, dword [ebp + 0x14]
jne 0x56444b
mov byte [esi], 0x80
jmp 0x5643d0
cmp ebx, dword [ebp + 0x10]
jg 0x564426
lea eax, [ebx + ecx]
cmp dword [ebp + 0x10], eax
jge 0x564426
mov byte [esi + 1], 0x80
mov byte [esi], 0x80
mov byte [esi - 1], 0
mov byte [esi + 2], 0xff
jmp 0x56444f
lea edx, [ebp - 0x9e4]
call fcn.004c5c6d
xor edx, edx
push 3
pop ecx
div ecx
mov ecx, dword [ebp - 8]
test edx, edx
mov edx, dword [ebp + 0x14]
jne 0x56444b
mov byte [esi + 1], 0xff
mov byte [esi], 0xff
jmp 0x56441c
and dword [esi - 1], 0
inc dword [ebp + 0x10]
mov eax, dword [ebp + 0x10]
add esi, 4
cmp eax, dword [edi]
jl 0x564385
mov eax, dword [ebp + 0x18]
sub eax, 0
je 0x564660
dec eax
je 0x564561
dec eax
jne 0x564745
mov eax, dword [ebp + 8]
mov esi, dword [edi + 4]
lea ecx, [eax + edx]
xor eax, eax
inc eax
dec esi
cmp esi, eax
mov dword [ebp - 8], ecx
mov dword [ebp - 0xc], eax
jle 0x564745
mov esi, dword [edi]
mov dword [ebp + 8], 2
sub dword [ebp + 8], edx
mov dword [ebp + 0x10], 0xfffffffb
dec esi
sub dword [ebp + 0x10], edx
jmp 0x5644b1
xor eax, eax
inc eax
cmp esi, eax
mov dword [ebp + 0x14], eax
jle 0x564547
mov eax, dword [ebp + 8]
lea eax, [eax + ecx + 5]
lea esi, [edx + ecx]
mov dword [ebp + 0x18], esi
sub dword [ebp + 0x18], ecx
mov dword [ebp + 0xc], eax
lea eax, [ecx + 5]
mov esi, dword [ebp + 0x18]
movzx ebx, byte [eax + esi]
movzx esi, byte [eax - 4]
add ebx, esi
movzx esi, byte [eax + 4]
add ebx, esi
movzx esi, byte [eax]
add ebx, esi
mov esi, dword [ebp + 0x14]
add ecx, edx
movzx ecx, byte [ecx + esi*4]
movzx esi, byte [eax - 1]
and esi, 0xf9
and ecx, 0xf2
add ecx, esi
movzx esi, byte [eax - 5]
add ecx, esi
movzx esi, byte [eax + 3]
add ecx, esi
mov esi, dword [ebp + 0xc]
mov byte [esi - 1], 0
mov esi, dword [ebp + 0x10]
sar ebx, 2
mov byte [eax + esi + 5], bl
mov esi, dword [ebp + 0xc]
sar ecx, 2
inc dword [ebp + 0x14]
mov byte [esi - 3], cl
mov byte [esi], 0xff
mov ecx, dword [edi]
add esi, 4
mov dword [ebp + 0xc], esi
lea esi, [ecx - 1]
mov ecx, dword [ebp - 8]
add eax, 4
cmp dword [ebp + 0x14], esi
jl 0x5644d2
mov eax, dword [edi + 4]
add ecx, edx
inc dword [ebp - 0xc]
dec eax
cmp dword [ebp - 0xc], eax
mov dword [ebp - 8], ecx
jl 0x5644ae
jmp 0x564745
mov eax, dword [ebp + 8]
mov ecx, dword [edi + 4]
lea esi, [eax + edx]
xor eax, eax
inc eax
dec ecx
cmp ecx, eax
mov dword [ebp - 8], esi
mov dword [ebp - 0x10], eax
jle 0x564745
mov ebx, dword [edi]
mov ecx, esi
sub ecx, edx
add esi, edx
mov dword [ebp + 0x10], eax
sub dword [ebp + 0x10], edx
mov dword [ebp + 0x18], 4
dec ebx
sub dword [ebp + 0x18], edx
mov dword [ebp - 0x14], ecx
mov dword [ebp + 8], esi
jmp 0x5645a0
xor eax, eax
inc eax
cmp ebx, eax
mov dword [ebp - 0xc], eax
jle 0x564640
mov edx, dword [ebp + 8]
mov eax, dword [ebp + 0x18]
mov ebx, dword [ebp - 8]
add eax, edx
mov edx, dword [ebp + 0x10]
lea esi, [eax + edx]
mov edx, dword [ebp + 8]
sub edx, ebx
mov dword [ebp - 0x18], edx
mov edx, dword [ebp + 8]
mov dword [ebp + 0xc], ecx
sub dword [ebp + 0xc], ebx
sub edx, ecx
mov dword [ebp - 0x1c], edx
jmp 0x5645d7
mov edx, dword [ebp - 0x1c]
mov ecx, dword [ebp - 0x18]
movzx ebx, byte [eax + ecx]
movzx ecx, byte [eax - 4]
add ebx, ecx
movzx ecx, byte [eax + 4]
add ebx, ecx
movzx ecx, byte [eax]
add ebx, ecx
movzx ecx, byte [esi + edx]
movzx edx, byte [eax + 1]
and ecx, 0xf2
and edx, 0xf9
add ecx, edx
movzx edx, byte [eax + 5]
add ecx, edx
movzx edx, byte [eax - 3]
add ecx, edx
sar ecx, 2
sar ebx, 2
inc dword [ebp - 0xc]
mov byte [esi], cl
mov ecx, dword [ebp + 0xc]
mov byte [eax + ecx], bl
mov byte [esi + 1], 0
mov byte [esi + 2], 0xff
mov ecx, dword [edi]
lea ebx, [ecx - 1]
add eax, 4
add esi, 4
cmp dword [ebp - 0xc], ebx
jl 0x5645d4
mov edx, dword [ebp + 0x14]
mov ecx, dword [ebp - 0x14]
add dword [ebp - 8], edx
add dword [ebp + 8], edx
mov eax, dword [edi + 4]
add ecx, edx
inc dword [ebp - 0x10]
dec eax
cmp dword [ebp - 0x10], eax
mov dword [ebp - 0x14], ecx
jl 0x56459d
jmp 0x564745
mov ecx, dword [edi + 4]
mov eax, dword [ebp + 8]
xor esi, esi
inc esi
dec ecx
cmp ecx, esi
lea eax, [eax + edx*2]
mov dword [ebp + 0xc], eax
mov dword [ebp - 0x10], esi
jle 0x564745
mov ecx, dword [edi]
sub eax, edx
add eax, 9
mov dword [ebp + 8], 0xfffffffe
sub dword [ebp + 8], edx
mov dword [ebp + 0x18], 0xfffffff7
dec ecx
sub dword [ebp + 0x18], edx
mov dword [ebp - 0xc], eax
jmp 0x56469f
xor esi, esi
inc esi
cmp ecx, esi
mov dword [ebp + 0x10], esi
jle 0x56472d
mov ecx, dword [ebp + 8]
add ecx, eax
mov dword [ebp - 0x14], ecx
mov ecx, dword [ebp + 0x18]
sub ecx, dword [ebp + 0xc]
lea esi, [edx + eax - 3]
add ecx, eax
mov dword [ebp - 0x18], ecx
movzx ecx, byte [eax - 4]
movzx edx, byte [esi - 1]
movzx ebx, byte [eax - 3]
and edx, 0xf2
and ecx, 0xf9
add ecx, edx
movzx edx, byte [eax - 8]
add ecx, edx
movzx edx, byte [eax]
add ecx, edx
movzx edx, byte [eax - 7]
add edx, ebx
movzx ebx, byte [eax + 1]
add edx, ebx
movzx ebx, byte [esi]
add edx, ebx
mov ebx, dword [ebp - 0x18]
sar edx, 2
sar ecx, 2
inc dword [ebp + 0x10]
mov byte [esi + ebx], dl
mov edx, dword [ebp - 0x14]
mov byte [edx - 2], cl
mov byte [edx - 3], 0
mov byte [edx], 0xff
mov ecx, dword [edi]
add edx, 4
add eax, 4
add esi, 4
dec ecx
cmp dword [ebp + 0x10], ecx
mov dword [ebp - 0x14], edx
jl 0x5646c1
mov eax, dword [ebp - 0xc]
mov edx, dword [ebp + 0x14]
add dword [ebp + 0xc], edx
mov esi, dword [edi + 4]
add eax, edx
inc dword [ebp - 0x10]
dec esi
cmp dword [ebp - 0x10], esi
mov dword [ebp - 0xc], eax
jl 0x56469c
pop esi
pop ebx
leave
ret