Function at 0x4a56e0
Capabilities:
Encrypt data using rc4 prga

Disassembly:
mov ecx, dword fs:[0x14]
mov ecx, dword [ecx]
cmp esp, dword [ecx + 8]
jbe 0x4a59de
sub esp, 0x34
mov edx, dword [esp + 0x38]
mov ebx, dword [esp + 0x3c]
xor eax, eax
xor ecx, ecx
xor ebp, ebp
xor esi, esi
xor edi, edi
jmp 0x4a572a
dec ebx
mov dword [esp + 0x3c], ebx
neg ebx
sar ebx, 0x1f
and ebx, 1
add eax, ebx
mov ebx, dword [esp + 0x3c]
mov dword [esp + 0x2c], eax
mov eax, edx
mov edx, dword [esp + 0x2c]
test ebx, ebx
jle 0x4a5991
mov dword [esp + 0x3c], ebx
mov dword [esp + 0x38], edx
xchg edi, eax
mov byte [esp + 0x22], al
xchg edi, eax
movzx edx, byte [edx]
mov byte [esp + 0x23], dl
cmp dl, 0x20
jbe 0x4a592b
cmp dl, 0x22
je 0x4a57ee
cmp dl, 0x5c
jne 0x4a576f
lea edx, [eax + 1]
mov eax, dword [esp + 0x38]
cmp ebx, 1
jae 0x4a570d
jmp 0x4a59d1
mov dword [esp], esi
mov dword [esp + 4], ebp
mov dword [esp + 8], ecx
mov dword [esp + 0xc], eax
call fcn.004a5640
mov eax, dword [esp + 0x14]
mov ecx, dword [esp + 0x18]
mov edx, dword [esp + 0x10]
lea ebx, [eax + 1]
cmp ebx, ecx
ja 0x4a57b7
movzx ebp, byte [esp + 0x23]
xchg ebp, ebx
mov byte [edx + eax], bl
xchg ebp, ebx
mov eax, dword [esp + 0x38]
mov ebp, ebx
mov esi, edx
movzx edi, byte [esp + 0x22]
mov ebx, dword [esp + 0x3c]
xor edx, edx
jmp 0x4a5765
mov dword [esp + 0x28], eax
lea ebp, [0x51e700]
mov dword [esp], ebp
mov dword [esp + 4], edx
mov dword [esp + 8], eax
mov dword [esp + 0xc], ecx
mov dword [esp + 0x10], ebx
call fcn.004419d0
mov edx, dword [esp + 0x14]
mov eax, dword [esp + 0x18]
mov ecx, dword [esp + 0x1c]
lea ebx, [eax + 1]
mov eax, dword [esp + 0x28]
jmp 0x4a5796
mov dword [esp + 0x24], eax
mov dword [esp], esi
mov dword [esp + 4], ebp
mov dword [esp + 8], ecx
mov ecx, eax
shr eax, 0x1f
add eax, ecx
sar eax, 1
mov dword [esp + 0xc], eax
call fcn.004a5640
mov eax, dword [esp + 0x14]
mov dword [esp + 0x28], eax
mov ecx, dword [esp + 0x18]
mov edx, dword [esp + 0x10]
mov ebx, dword [esp + 0x24]
test ebx, 1
jne 0x4a58d1
movzx ebx, byte [esp + 0x22]
test bl, bl
je 0x4a58c7
mov ebp, dword [esp + 0x3c]
cmp ebp, 1
jle 0x4a58c1
mov esi, dword [esp + 0x38]
cmp byte [esi + 1], 0x22
jne 0x4a58bb
lea edi, [eax + 1]
cmp edi, ecx
ja 0x4a587b
movzx ebx, byte [esp + 0x23]
mov byte [edx + eax], bl
lea ebx, [esi + 1]
dec ebp
movzx esi, byte [esp + 0x22]
xor esi, 1
mov eax, ebx
mov ebx, ebp
mov ebp, edi
mov edi, esi
mov esi, edx
xor edx, edx
jmp 0x4a5765
lea ebx, [0x51e700]
mov dword [esp], ebx
mov dword [esp + 4], edx
mov dword [esp + 8], eax
mov dword [esp + 0xc], ecx
mov dword [esp + 0x10], edi
call fcn.004419d0
mov edx, dword [esp + 0x14]
mov eax, dword [esp + 0x18]
mov ecx, dword [esp + 0x1c]
lea edi, [eax + 1]
mov eax, dword [esp + 0x28]
movzx ebx, byte [esp + 0x22]
mov ebp, dword [esp + 0x3c]
mov esi, dword [esp + 0x38]
jmp 0x4a5856
mov ebx, esi
mov edi, eax
jmp 0x4a5862
mov esi, dword [esp + 0x38]
jmp 0x4a58bb
mov ebp, dword [esp + 0x3c]
mov esi, dword [esp + 0x38]
jmp 0x4a58bb
lea ebx, [eax + 1]
cmp ebx, ecx
ja 0x4a58f8
movzx ebp, byte [esp + 0x23]
xchg ebp, ebx
mov byte [edx + eax], bl
xchg ebp, ebx
mov ebp, dword [esp + 0x3c]
mov edi, ebx
movzx esi, byte [esp + 0x22]
mov ebx, dword [esp + 0x38]
jmp 0x4a586a
lea ebp, [0x51e700]
mov dword [esp], ebp
mov dword [esp + 4], edx
mov dword [esp + 8], eax
mov dword [esp + 0xc], ecx
mov dword [esp + 0x10], ebx
call fcn.004419d0
mov edx, dword [esp + 0x14]
mov eax, dword [esp + 0x18]
mov ecx, dword [esp + 0x1c]
lea ebx, [eax + 1]
mov eax, dword [esp + 0x28]
jmp 0x4a58d8
cmp dl, 9
jne 0x4a5987
xchg edi, eax
test al, al
xchg edi, eax
jne 0x4a576f
mov dword [esp], esi
mov dword [esp + 4], ebp
mov dword [esp + 8], ecx
mov dword [esp + 0xc], eax
call fcn.004a5640
mov eax, dword [esp + 0x10]
mov ecx, dword [esp + 0x14]
mov edx, dword [esp + 0x18]
mov dword [esp + 0x40], eax
mov dword [esp + 0x44], ecx
mov dword [esp + 0x48], edx
mov eax, dword [esp + 0x3c]
dec eax
mov ecx, eax
neg eax
sar eax, 0x1f
and eax, 1
mov edx, dword [esp + 0x38]
add eax, edx
mov dword [esp + 0x4c], eax
mov dword [esp + 0x50], ecx
add esp, 0x34
ret
cmp dl, 0x20
je 0x4a5930
jmp 0x4a576f
mov dword [esp], esi
mov dword [esp + 4], ebp
mov dword [esp + 8], ecx
mov dword [esp + 0xc], eax
call fcn.004a5640
mov eax, dword [esp + 0x10]
mov ecx, dword [esp + 0x14]
mov edx, dword [esp + 0x18]
mov dword [esp + 0x40], eax
mov dword [esp + 0x44], ecx
mov dword [esp + 0x48], edx
mov dword [esp + 0x4c], 0
mov dword [esp + 0x50], 0
add esp, 0x34
ret
mov eax, 1
mov ecx, ebx
call fcn.00459930
nop
call fcn.00458300
jmp fcn.004a56e0