Function at 0x2f0840
Capabilities:
Encrypt data using rc4 prga

Disassembly:
push ebp
push ebx
push edi
push esi
sub esp, 0x3c
mov dword [esp + 0xc], edx
mov dword [esp], ecx
mov ebp, dword [esp + 0x5c]
mov ebx, dword [esp + 0x58]
mov eax, dword [esp + 0x68]
xor edi, edi
test eax, eax
cmovle eax, edi
mov dword [esp + 0x14], eax
mov edx, dword [esp + 0x6c]
mov al, 1
mov dword [esp + 4], eax
test dl, 0x40
jne 0x2f0892
test ebp, ebp
js 0x2f089c
test dl, 2
jne 0x2f08b9
mov ecx, edx
and ecx, 4
sete al
mov dword [esp + 4], eax
shl ecx, 3
mov dword [esp + 8], ecx
jmp 0x2f08c9
mov dword [esp + 8], 0
jmp 0x2f08c9
mov dword [esp + 4], 0
neg ebx
mov eax, 0
sbb eax, ebp
mov dword [esp + 8], 0x2d
mov ebp, eax
jmp 0x2f08c9
mov dword [esp + 8], 0x2b
mov dword [esp + 4], 0
mov esi, dword [esp + 0x60]
cmp esi, 8
mov eax, 0x7ac3b0
mov ecx, 0x7ac3af
cmove ecx, eax
cmp esi, 0x10
mov eax, 0x7ac3b2
cmovne eax, ecx
mov dword [esp + 0x10], eax
test dl, 0x20
mov eax, 0x7ac3c6
mov ecx, 0x7ac3b5
cmove ecx, eax
mov dword [esp + 0x18], ecx
mov edx, ebp
nop word cs:[eax + eax]
mov dword [esp + 0x1c], edi
push 0
mov ebp, dword [esp + 0x64]
push ebp
push edx
push ebx
mov edi, edx
call fcn.004fa290
add esp, 0x10
mov ecx, eax
imul ecx, ebp
mov esi, ebx
sub esi, ecx
cmp ebx, ebp
mov ebp, dword [esp + 0x1c]
mov ecx, dword [esp + 0x18]
movzx ecx, byte [ecx + esi]
mov byte [esp + ebp + 0x22], cl
sbb edi, 0
lea ecx, [ebp + 1]
jb 0x2f0953
mov ebx, eax
cmp ebp, 0x19
mov edi, ecx
jb 0x2f0910
mov eax, dword [esp + 0x6c]
test al, 8
mov eax, 0x7ac3af
mov edx, dword [esp + 0x10]
cmove edx, eax
lea ebp, [ecx - 1]
cmp ecx, 0x1a
cmovne ebp, ecx
mov byte [esp + ebp + 0x22], 0
mov edi, dword [esp + 0x14]
mov esi, edi
sub esi, ebp
cmovle edi, ebp
mov eax, dword [esp + 4]
mov ebx, eax
xor bl, 1
mov dword [esp + 0x10], edx
push edx
call fcn.004f8b98
add esp, 4
movzx ecx, bl
mov edx, dword [esp + 0x64]
sub edx, ecx
add eax, edi
sub edx, eax
xor eax, eax
test esi, esi
cmovle esi, eax
test edx, edx
cmovle edx, eax
cmp esi, edx
mov edi, edx
cmova edi, esi
mov ecx, dword [esp + 0x6c]
test cl, 0x10
cmovne edx, eax
cmove edi, esi
mov esi, edx
neg esi
test cl, 1
cmove esi, edx
test esi, esi
jle 0x2f0a10
inc esi
mov ebx, dword [esp + 0xc]
nop word cs:[eax + eax]
mov ecx, dword [esp]
mov edx, ebx
push 0x20
push dword [esp + 0x58]
push dword [esp + 0x58]
call fcn.002f0740
add esp, 0xc
test eax, eax
je 0x2f0b0e
dec esi
cmp esi, 1
jg 0x2f09e0
xor esi, esi
cmp byte [esp + 4], 0
je 0x2f0a1b
jmp 0x2f0a3c
mov ebx, dword [esp + 0xc]
cmp byte [esp + 4], 0
jne 0x2f0a3c
mov ecx, dword [esp]
mov edx, ebx
push dword [esp + 8]
push dword [esp + 0x58]
push dword [esp + 0x58]
call fcn.002f0740
add esp, 0xc
test eax, eax
je 0x2f0b0e
mov ebx, dword [esp + 0x10]
movzx eax, byte [ebx]
test al, al
je 0x2f0a7b
inc ebx
nop dword [eax + eax]
movsx eax, al
mov ecx, dword [esp]
mov edx, dword [esp + 0xc]
push eax
push dword [esp + 0x58]
push dword [esp + 0x58]
call fcn.002f0740
add esp, 0xc
test eax, eax
je 0x2f0b0e
movzx eax, byte [ebx]
inc ebx
test al, al
jne 0x2f0a50
test edi, edi
mov ebx, dword [esp + 0xc]
je 0x2f0ae0
inc edi
nop word cs:[eax + eax]
mov ecx, dword [esp]
mov edx, ebx
push 0x30
push dword [esp + 0x58]
push dword [esp + 0x58]
call fcn.002f0740
add esp, 0xc
test eax, eax
je 0x2f0b0e
dec edi
cmp edi, 1
jg 0x2f0a90
jmp 0x2f0ae0
movsx eax, byte [esp + ebp + 0x21]
dec ebp
mov ecx, dword [esp]
mov edx, ebx
push eax
push dword [esp + 0x58]
push dword [esp + 0x58]
call fcn.002f0740
add esp, 0xc
test eax, eax
je 0x2f0b0e
test ebp, ebp
jg 0x2f0ac0
mov eax, 1
test esi, esi
jns 0x2f0b10
jmp 0x2f0af3
inc esi
je 0x2f0b18
mov ecx, dword [esp]
mov edx, ebx
push 0x20
push dword [esp + 0x58]
push dword [esp + 0x58]
call fcn.002f0740
add esp, 0xc
test eax, eax
jne 0x2f0af0
xor eax, eax
add esp, 0x3c
pop esi
pop edi
pop ebx
pop ebp
ret
mov eax, 1
jmp 0x2f0b10