Function at 0x4ae420
Capabilities:
Encrypt data using rc4 prga

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x10
push ebx
push esi
mov esi, ecx
push edi
mov edi, dword [esi + 0x2c]
mov eax, edi
mov dword [ebp - 8], eax
mov eax, dword [esi + 0x3c]
mov edx, eax
sub edx, dword [esi + 0x74]
sub edx, dword [esi + 0x6c]
mov dword [ebp - 0xc], eax
mov eax, dword [ebp - 8]
add eax, 0xfffffefa
mov dword [ebp - 4], edx
add eax, edi
cmp dword [esi + 0x6c], eax
jb 0x4ae4e4
mov ecx, dword [esi + 0x38]
push edi
lea eax, [ecx + edi]
push eax
push ecx
call fcn.004d21c0
mov ebx, dword [esi + 0x4c]
add esp, 0xc
mov eax, dword [esi + 0x44]
sub dword [esi + 0x70], edi
sub dword [esi + 0x6c], edi
sub dword [esi + 0x5c], edi
lea edx, [eax + ebx*2]
nop word [eax + eax]
movzx ecx, word [edx - 2]
lea edx, [edx - 2]
mov eax, ecx
mov dword [ebp - 0xc], 0
sub eax, edi
cmp ecx, edi
movzx eax, ax
cmovb eax, dword [ebp - 0xc]
mov word [edx], ax
sub ebx, 1
jne 0x4ae480
mov eax, dword [esi + 0x40]
mov ebx, edi
lea edx, [eax + edi*2]
nop dword [eax + eax]
movzx ecx, word [edx - 2]
lea edx, [edx - 2]
mov eax, ecx
mov dword [ebp - 0xc], 0
sub eax, edi
cmp ecx, edi
movzx eax, ax
cmovb eax, dword [ebp - 0xc]
mov word [edx], ax
sub ebx, 1
jne 0x4ae4b0
mov eax, dword [esi + 0x3c]
mov edx, dword [ebp - 4]
mov dword [ebp - 0xc], eax
add edx, edi
mov eax, dword [esi + 0x2c]
mov dword [ebp - 8], eax
mov ebx, dword [esi]
mov eax, dword [ebx + 4]
test eax, eax
je 0x4ae62b
mov ecx, dword [esi + 0x74]
add ecx, dword [esi + 0x6c]
add ecx, dword [esi + 0x38]
cmp eax, edx
mov dword [ebp - 0x10], ecx
cmovbe edx, eax
mov dword [ebp - 4], edx
test edx, edx
jne 0x4ae510
mov ebx, dword [ebp - 0xc]
xor ecx, ecx
jmp 0x4ae56a
sub eax, edx
mov dword [ebx + 4], eax
mov eax, dword [ebx + 0x1c]
mov eax, dword [eax + 0x18]
cmp eax, 1
jne 0x4ae52d
mov ecx, dword [ebx + 0x30]
push edx
mov edx, dword [ebx]
call fcn.004b0d50
jmp 0x4ae543
cmp eax, 2
jne 0x4ae549
mov eax, dword [ebx]
test eax, eax
je 0x4ae546
mov ecx, dword [ebx + 0x30]
push edx
mov edx, eax
call fcn.004b0fd0
add esp, 4
mov dword [ebx + 0x30], eax
push dword [ebp - 4]
push dword [ebx]
push dword [ebp - 0x10]
call fcn.004d21c0
mov ecx, dword [ebp - 4]
add esp, 0xc
add dword [ebx], ecx
add dword [ebx + 8], ecx
mov eax, dword [esi + 0x2c]
mov ebx, dword [esi + 0x3c]
mov dword [ebp - 8], eax
mov eax, dword [esi + 0x74]
mov edx, dword [esi + 0x38]
add eax, ecx
mov dword [ebp - 0xc], eax
mov dword [esi + 0x74], eax
cmp eax, 3
jb 0x4ae5a2
mov eax, dword [esi + 0x6c]
mov ecx, dword [esi + 0x58]
movzx edx, byte [eax + edx]
mov eax, dword [esi + 0x38]
mov dword [esi + 0x48], edx
shl edx, cl
mov ecx, dword [esi + 0x6c]
movzx eax, byte [ecx + eax + 1]
xor edx, eax
mov eax, dword [ebp - 0xc]
and edx, dword [esi + 0x54]
mov dword [esi + 0x48], edx
cmp eax, 0x106
jae 0x4ae5bb
mov eax, dword [esi]
cmp dword [eax + 4], 0
mov eax, dword [ebp - 8]
jne 0x4ae430
mov eax, dword [ebp - 0xc]
mov ecx, dword [esi + 0x16c0]
cmp ecx, ebx
jae 0x4ae62b
mov edi, dword [esi + 0x6c]
add edi, eax
cmp ecx, edi
jae 0x4ae5fb
mov eax, 0x102
sub ebx, edi
cmp ebx, eax
cmova ebx, eax
mov eax, dword [esi + 0x38]
push ebx
add eax, edi
push 0
push eax
call fcn.004d0d20
add esp, 0xc
lea eax, [ebx + edi]
mov dword [esi + 0x16c0], eax
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
lea eax, [edi + 0x102]
cmp ecx, eax
jae 0x4ae62b
sub edi, ecx
sub ebx, ecx
lea eax, [edi + 0x102]
cmp eax, ebx
cmovbe ebx, eax
mov eax, dword [esi + 0x38]
push ebx
add eax, ecx
push 0
push eax
call fcn.004d0d20
add esp, 0xc
add dword [esi + 0x16c0], ebx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret