Function at 0x300ac390
Capabilities:
Encrypt data using rc4 prga

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff0
sub esp, 0x34
mov eax, dword [ebp + 0xc]
push ebx
push esi
mov esi, dword [ebp + 8]
mov edx, dword [esi + 0x4c]
push edi
mov edi, dword [ebp + 0x10]
sub edi, eax
shl eax, 8
mov dword [esp + 0x38], eax
mov eax, dword [esi + 0x10]
mov ecx, dword [eax + 0x34]
mov al, byte [0x30336629]
shl ecx, 8
add edx, 0x20
test al, al
mov dword [esp + 0x3c], ecx
lea ecx, [esp + 0x38]
je 0x300ac3db
push edx
mov edx, ecx
call fcn.300a1740
add esp, 4
jmp 0x300ac3ea
lea eax, [esp + 0x38]
push eax
push ecx
push edx
call fcn.30077890
add esp, 0xc
mov ebx, dword [esi + 0x4c]
mov eax, dword [ebx + 0x90]
test eax, eax
mov dword [esp + 0x10], eax
je 0x300ac763
mov ecx, ebx
mov edx, dword [ecx + 0x20]
mov ecx, dword [ecx + 0x24]
sar ecx, 8
mov dword [esp + 0x20], ecx
mov cl, byte [0x30336628]
sar edx, 8
test cl, cl
mov dword [esp + 0x18], edx
je 0x300ac67c
fild dword [esp + 0x38]
mov esi, ebx
mov dword [esp + 0xc], 0x43800000
movss xmm2, dword [esp + 0xc]
fmul qword [0x3029a9d0]
lea ecx, [esp + 0xc]
fild dword [esp + 0x3c]
lea edx, [esp + 0xc]
fmul qword [0x3029a9d0]
fstp qword [esp + 0x20]
fild dword [esi + 0x20]
fmul qword [0x3029a9e8]
fst qword [esp + 0x10]
fild dword [esi + 0x24]
fmul qword [0x3029a9e8]
fst qword [esp + 0x18]
fld st(0)
fmul st(1)
fld st(2)
fmul st(3)
faddp st(1)
fadd st(0), st(0)
fstp st(2)
fstp st(0)
fld qword [esp + 0x20]
fmul qword [esp + 0x20]
fld st(2)
fmul st(3)
faddp st(1)
fstp dword [esp + 0xc]
fld qword [esp + 0x18]
movss xmm0, dword [ecx]
fmul qword [esp + 0x20]
lea ecx, [esp + 0xc]
fld qword [esp + 0x10]
fmul st(3)
faddp st(1)
fadd st(0), st(0)
fld st(1)
fmul qword [0x302964a8]
faddp st(1)
fstp dword [esp + 0xc]
movss xmm1, dword [edx]
fstp dword [esp + 0xc]
movss xmm3, dword [ecx]
xor ecx, ecx
mov cl, byte [ebx + 0x94]
fstp st(0)
and ecx, 0xc
je 0x300ac5f5
cmp ecx, 4
je 0x300ac559
test edi, edi
mov dword [esp + 0x20], 0xff
mov dword [esp + 0x24], 0
pxor mm0, mm0
movq mm1, qword [esp + 0x20]
je 0x300ac673
mov ecx, dword [ebp + 0x14]
mov edi, edi
movaps xmmword [esp + 0x20], xmm0
rsqrtss xmm4, xmm0
movss dword [esp + 0x20], xmm4
movaps xmm4, xmmword [esp + 0x20]
movaps xmmword [esp + 0x20], xmm4
rcpss xmm4, xmm4
movss dword [esp + 0x20], xmm4
movaps xmm4, xmmword [esp + 0x20]
mulss xmm4, xmm2
cvtps2pi mm2, xmm4
pand mm2, mm1
pextrw edx, mm2, 0
mov edx, dword [eax + edx*4]
movd mm2, edx
punpcklbw mm2, mm0
movq qword [ecx], mm2
add ecx, 8
dec edi
addss xmm0, xmm1
addss xmm1, xmm3
jne 0x300ac500
emms
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
xor ecx, ecx
cmp edi, ecx
mov dword [esp + 0x20], 0xff
mov dword [esp + 0x24], ecx
pxor mm2, mm2
movq mm3, qword [esp + 0x20]
mov dword [esp + 0x20], 0x100
mov dword [esp + 0x24], ecx
movq mm1, qword [esp + 0x20]
je 0x300ac673
mov ecx, dword [ebp + 0x14]
jmp 0x300ac590
movaps xmmword [esp + 0x20], xmm0
rsqrtss xmm4, xmm0
movss dword [esp + 0x20], xmm4
movaps xmm4, xmmword [esp + 0x20]
movaps xmmword [esp + 0x20], xmm4
rcpss xmm4, xmm4
movss dword [esp + 0x20], xmm4
movaps xmm4, xmmword [esp + 0x20]
mulss xmm4, xmm2
cvtps2pi mm0, xmm4
movq mm4, mm0
pand mm4, mm1
pcmpeqd mm4, mm1
pxor mm0, mm4
pand mm0, mm3
pextrw edx, mm0, 0
mov edx, dword [eax + edx*4]
movd mm0, edx
punpcklbw mm0, mm2
movq qword [ecx], mm0
add ecx, 8
dec edi
addss xmm0, xmm1
addss xmm1, xmm3
jne 0x300ac590
emms
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
test edi, edi
mov dword [esp + 0x20], 0x100
mov dword [esp + 0x24], 0
pxor mm0, mm0
movq mm1, qword [esp + 0x20]
je 0x300ac673
mov ecx, dword [ebp + 0x14]
jmp 0x300ac620
movaps xmmword [esp + 0x20], xmm0
rsqrtss xmm4, xmm0
movss dword [esp + 0x20], xmm4
movaps xmm4, xmmword [esp + 0x20]
movaps xmmword [esp + 0x20], xmm4
rcpss xmm4, xmm4
movss dword [esp + 0x20], xmm4
movaps xmm4, xmmword [esp + 0x20]
mulss xmm4, xmm2
cvtps2pi mm2, xmm4
pminsw mm2, mm1
pmaxsw mm2, mm0
pextrw edx, mm2, 0
mov edx, dword [eax + edx*4]
movd mm2, edx
punpcklbw mm2, mm0
movq qword [ecx], mm2
add ecx, 8
dec edi
addss xmm0, xmm1
addss xmm1, xmm3
jne 0x300ac620
emms
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
lea eax, [esp + 0x38]
push eax
xor esi, esi
call fcn.30076dd0
sar eax, 0xe
add esp, 4
cmp eax, 0x100
jle 0x300ac69a
mov eax, 0x100
test edi, edi
je 0x300ac763
mov edx, dword [esp + 0x3c]
mov ecx, dword [esp + 0x38]
mov dword [esp + 0xc], edi
mov edi, dword [ebp + 0x14]
sar ecx, 0xe
sar edx, 0xe
mov ebx, ecx
imul edx, edx
imul ebx, ecx
add edx, ebx
mov ebx, eax
add eax, esi
jns 0x300ac6cb
xor eax, eax
jmp 0x300ac6d7
cmp eax, 0x100
jle 0x300ac6d7
mov eax, 0x100
mov ecx, dword [ebp + 8]
mov ecx, dword [ecx + 0x10]
mov ecx, dword [ecx + 0xb0]
lea ecx, [ecx + eax*2 + 0x24]
movzx esi, word [ecx]
cmp edx, esi
jae 0x300ac6f4
dec eax
sub ecx, 2
jmp 0x300ac6e7
movzx esi, word [ecx + 2]
cmp edx, esi
jbe 0x300ac709
cmp eax, 0x100
jge 0x300ac709
inc eax
add ecx, 2
jmp 0x300ac6e7
mov ecx, dword [esp + 0x10]
movzx dx, byte [ecx + eax*4 + 3]
mov word [edi + 6], dx
movzx dx, byte [ecx + eax*4 + 2]
mov word [edi + 4], dx
movzx dx, byte [ecx + eax*4 + 1]
mov word [edi + 2], dx
movzx cx, byte [ecx + eax*4]
mov edx, dword [esp + 0x18]
mov word [edi], cx
mov ecx, dword [esp + 0x38]
add ecx, edx
mov edx, dword [esp + 0x3c]
mov esi, eax
sub esi, ebx
add edx, dword [esp + 0x20]
mov ebx, dword [esp + 0xc]
add edi, 8
dec ebx
mov dword [esp + 0x38], ecx
mov dword [esp + 0x3c], edx
mov dword [esp + 0xc], ebx
jne 0x300ac6b1
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret