Function at 0x53a600
Capabilities:
Encrypt data using rc4 prga

Disassembly:
sub esp, 0x20
mov ecx, dword [esp + 0x30]
xor eax, eax
cmp dword [esp + 0x34], 4
push ebp
mov ebp, ecx
mov dword [esp + 4], eax
mov dword [esp + 0x18], eax
jb 0x53a8a7
mov edx, dword [ecx]
push edi
mov edi, edx
and edi, 0xf
add edi, 5
cmp edi, 0xf
jbe 0x53a63a
pop edi
mov eax, 0xffffffd4
pop ebp
add esp, 0x20
ret
mov eax, dword [esp + 0x34]
mov ecx, edi
push ebx
push esi
mov esi, 1
shr edx, 4
shl esi, cl
mov ebx, 4
mov dword [eax], edi
inc edi
mov dword [esp + 0x14], esi
mov dword [esp + 0x1c], edi
lea eax, [esi + 1]
mov dword [esp + 0x18], eax
cmp eax, 1
jle 0x53a87a
nop dword [eax]
mov esi, dword [esp + 0x38]
mov ecx, dword [esp + 0x10]
cmp ecx, dword [esi]
mov esi, dword [esp + 0x14]
ja 0x53a85d
cmp dword [esp + 0x24], 0
je 0x53a761
mov edi, ecx
cmp dx, 0xffff
jne 0x53a6cb
mov esi, dword [esp + 0x44]
add esi, 0xfffffffb
add esi, dword [esp + 0x40]
add edi, 0x18
cmp ebp, esi
jae 0x53a6b6
mov edx, dword [ebp + 2]
add ebp, 2
mov ecx, ebx
shr edx, cl
jmp 0x53a6bc
shr edx, 0x10
add ebx, 0x10
cmp dx, 0xffff
je 0x53a6a3
mov esi, dword [esp + 0x14]
mov ecx, dword [esp + 0x10]
mov eax, edx
and eax, 3
cmp al, 3
jne 0x53a6e6
shr edx, 2
add edi, 3
mov eax, edx
add ebx, 2
and eax, 3
cmp al, 3
je 0x53a6d4
mov eax, edx
add ebx, 2
and eax, 3
add edi, eax
mov eax, dword [esp + 0x38]
cmp edi, dword [eax]
ja 0x53a86d
cmp ecx, edi
jae 0x53a722
mov esi, ecx
xor eax, eax
mov ecx, edi
sub ecx, dword [esp + 0x10]
mov dword [esp + 0x10], edi
mov edi, dword [esp + 0x34]
shr ecx, 1
lea edi, [edi + esi*2]
mov esi, dword [esp + 0x14]
rep stosd dword es:[edi], eax
adc ecx, ecx
rep stosw word es:[edi], ax
mov eax, dword [esp + 0x44]
mov edi, dword [esp + 0x40]
add eax, 0xfffffff9
add eax, edi
cmp ebp, eax
jbe 0x53a74c
mov eax, dword [esp + 0x44]
mov ecx, ebx
sar ecx, 3
add eax, 0xfffffffc
add ecx, ebp
add eax, edi
cmp ecx, eax
jbe 0x53a74c
shr edx, 2
jmp 0x53a75d
mov eax, ebx
and ebx, 7
sar eax, 3
mov ecx, ebx
add ebp, eax
mov edx, dword [ebp]
shr edx, cl
mov edi, dword [esp + 0x1c]
movzx eax, si
lea ecx, [esi - 1]
mov dword [esp + 0x28], eax
and ecx, edx
add eax, eax
add ebx, edi
mov dword [esp + 0x2c], eax
sub eax, dword [esp + 0x18]
dec eax
movzx eax, ax
mov dword [esp + 0x24], eax
movzx eax, dx
mov dword [esp + 0x20], eax
mov eax, dword [esp + 0x24]
cwde
cmp ecx, eax
jae 0x53a7a0
mov eax, dword [esp + 0x28]
dec eax
and eax, dword [esp + 0x20]
dec ebx
movzx ecx, ax
jmp 0x53a7c3
mov esi, dword [esp + 0x2c]
dec esi
and esi, dword [esp + 0x20]
movzx eax, si
movsx edx, ax
sub eax, dword [esp + 0x24]
cmp edx, dword [esp + 0x14]
movzx ecx, ax
movzx eax, si
cmovl ecx, eax
movzx ecx, cx
mov esi, dword [esp + 0x34]
dec ecx
movsx eax, cx
cdq
xor eax, edx
sub eax, edx
mov edx, dword [esp + 0x18]
cwde
sub edx, eax
mov eax, dword [esp + 0x10]
mov dword [esp + 0x18], edx
mov word [esi + eax*2], cx
inc eax
mov esi, dword [esp + 0x14]
mov dword [esp + 0x10], eax
xor eax, eax
test cx, cx
sete al
mov dword [esp + 0x24], eax
cmp edx, esi
jge 0x53a80f
nop dword [eax]
sar esi, 1
dec edi
cmp edx, esi
jl 0x53a800
mov dword [esp + 0x1c], edi
mov dword [esp + 0x14], esi
mov edx, dword [esp + 0x40]
add edx, dword [esp + 0x44]
lea eax, [edx - 7]
cmp ebp, eax
jbe 0x53a838
mov eax, ebx
lea ecx, [edx - 4]
sar eax, 3
add eax, ebp
cmp eax, ecx
jbe 0x53a838
sub ebp, edx
lea ebx, [ebx + ebp*8]
mov ebp, ecx
add ebx, 0x20
jmp 0x53a842
mov eax, ebx
sar eax, 3
add ebp, eax
and ebx, 7
mov edx, dword [ebp]
mov ecx, ebx
mov eax, dword [esp + 0x18]
and ecx, 0x1f
shr edx, cl
cmp eax, 1
jg 0x53a670
mov ecx, dword [esp + 0x10]
cmp eax, 1
je 0x53a87e
pop esi
pop ebx
pop edi
or eax, 0xffffffff
pop ebp
add esp, 0x20
ret
pop esi
pop ebx
pop edi
mov eax, 0xffffffd0
pop ebp
add esp, 0x20
ret
xor ecx, ecx
jmp 0x53a85d
lea eax, [ecx - 1]
mov ecx, dword [esp + 0x38]
pop esi
mov dword [ecx], eax
lea eax, [ebx + 7]
sar eax, 3
mov ecx, 0xffffffb8
sub eax, dword [esp + 0x3c]
add eax, ebp
cmp eax, dword [esp + 0x40]
pop ebx
pop edi
cmova eax, ecx
pop ebp
add esp, 0x20
ret
mov eax, 0xffffffb8
pop ebp
add esp, 0x20
ret