Function at 0x297730
Capabilities:
Encrypt data using rc4 prga

Disassembly:
push ecx
mov ecx, dword [esp + 8]
push ebx
push ebp
mov ebp, dword [ecx + 0x1e0]
push esi
push edi
xor esi, esi
xor edi, edi
test byte [ebp + 0xad], 2
mov dword [esp + 0x10], esi
mov ebx, 0xe4
je 0x297871
cmp dword [ebp + 0xa8], esi
jbe 0x297871
mov eax, dword [ecx + 0x5c]
push 0xd4
push eax
call dword [ecx + 0x54]
test eax, eax
je 0x297a00
call fcn.00215a40
cmp dword [esp + 0x10], 0
jne 0x297789
mov dword [esp + 0x10], eax
test edi, edi
je 0x297799
mov dword [eax + 0xc8], edi
mov dword [edi + 0xc4], eax
and dword [eax + 0x1c], 0xfe9fffff
mov byte [eax + 0x20], 2
mov ecx, dword [eax + 0x20]
and ecx, 0xff
or ch, 0x20
mov byte [eax + 0x30], 4
mov edi, dword [eax + 0x30]
lea edx, [esi + 0x20]
shl edx, 8
and edi, 0xff
mov word [eax + 0x2c], bx
mov dword [eax + 0x20], ecx
mov ecx, 0xf1ffffff
and dword [eax + 0x2c], ecx
xor edx, edi
mov word [eax + 0x3c], bx
and dword [eax + 0x3c], ecx
cmp esi, 5
mov byte [eax + 0xe], 7
mov dword [eax + 0xc0], 0xffffffff
mov word [eax + 4], 6
mov dword [eax + 0x30], edx
mov byte [eax + 0x10], 1
ja case.0x2977fb.0
jmp dword [esi*4 + 0x297a0c]
mov byte [eax + 0x1c], 8
jmp 0x297854
mov byte [eax + 0x1c], 1
mov ecx, dword [ebp + 0xac]
and ecx, 0x800
neg ecx
sbb ecx, ecx
and ecx, 0xd
add ecx, 2
mov edx, dword [eax + 0x10]
shl ecx, 8
and edx, 0xff
or ecx, edx
mov dword [eax + 0x10], ecx
mov ecx, dword [esp + 0x18]
add esi, 1
cmp esi, dword [ebp + 0xa8]
mov edi, eax
jb 0x297765
jmp 0x297875
mov byte [eax + 0x1c], 2
jmp 0x29780c
mov byte [eax + 0x1c], 4
cmp esi, 2
jae 0x29780c
mov ecx, dword [ebp + 0xac]
and ecx, 0x800
neg ecx
sbb ecx, ecx
and ecx, 0xd
add ecx, 1
jmp 0x297822
mov eax, dword [esp + 0x18]
test byte [ebp + 0xad], 0x80
je 0x297921
mov eax, dword [ecx + 0x5c]
push 0xd4
push eax
call dword [ecx + 0x54]
test eax, eax
je 0x297a00
call fcn.00215a40
cmp dword [esp + 0x10], 0
jne 0x2978a6
mov dword [esp + 0x10], eax
test edi, edi
je 0x2978b6
mov dword [eax + 0xc8], edi
mov dword [edi + 0xc4], eax
mov byte [eax + 0x20], 2
mov ecx, dword [eax + 0x20]
and ecx, 0xff
mov byte [eax + 0x30], 4
mov edx, dword [eax + 0x30]
and edx, 0xff
or ch, 0x20
or dh, 0x20
mov esi, 0xf1ffffff
mov word [eax + 0x2c], bx
and dword [eax + 0x2c], esi
mov word [eax + 0x3c], bx
and dword [eax + 0x3c], esi
mov byte [eax + 0x10], 1
and dword [eax + 0x10], 0xff
and dword [eax + 0x1c], 0xfe9fffff
mov dword [eax + 0x20], ecx
mov ecx, dword [esp + 0x18]
mov byte [eax + 0xe], 7
mov dword [eax + 0xc0], 0xffffffff
mov word [eax + 4], 6
mov dword [eax + 0x30], edx
mov byte [eax + 0x1c], 4
mov edi, eax
jmp 0x297926
mov esi, 0xf1ffffff
test byte [ebp + 0xad], 0x30
je 0x2979c6
mov eax, dword [ecx + 0x5c]
push 0xd4
push eax
call dword [ecx + 0x54]
test eax, eax
je 0x297a00
call fcn.00215a40
cmp dword [esp + 0x10], 0
jne 0x297957
mov dword [esp + 0x10], eax
test edi, edi
je 0x297967
mov dword [eax + 0xc8], edi
mov dword [edi + 0xc4], eax
mov byte [eax + 0x20], 2
mov ecx, dword [eax + 0x20]
and ecx, 0xff
or ch, 0x20
mov byte [eax + 0xe], 7
mov dword [eax + 0xc0], 0xffffffff
mov word [eax + 4], 1
mov dword [eax + 0x20], ecx
test byte [ebp + 0xad], 0x10
je 0x29799f
mov word [eax + 0x2c], 0xaa
jmp 0x2979a5
mov word [eax + 0x2c], 0xff
and dword [eax + 0x2c], esi
mov byte [eax + 0x10], 1
mov edx, dword [eax + 0x10]
and edx, 0xff
or dh, 5
and dword [eax + 0x1c], 0xfe9fffff
mov byte [eax + 0x1c], 0xf
mov dword [eax + 0x10], edx
cmp dword [esp + 0x10], 0
je 0x297a00
mov edx, dword [esp + 0x1c]
mov ecx, dword [edx + 0xc8]
mov esi, dword [esp + 0x10]
mov dword [ecx + 0xc4], esi
pop edi
mov dword [esi + 0xc8], ecx
pop esi
mov dword [eax + 0xc4], edx
pop ebp
mov dword [edx + 0xc8], eax
mov eax, 1
pop ebx
pop ecx
ret 8
pop edi
pop esi
pop ebp
xor eax, eax
pop ebx
pop ecx
ret 8