Ejemplo n.º 1
0
        /// <summary>
        /// Find the game on the given UMD device.
        /// </summary>
        /// <param name="device">The UMD to search.</param>
        /// <returns>The game found on the device, or <c>null</c> if none was found.</returns>
        public static GameInformation FindGame(IUmdDevice device)
        {
            Debug.Assert(device != null);
            if (device == null)
            {
                return(null);
            }

            GameInformation info = GameLoader.GetUmdGameInformation(device);

            Debug.Assert(info != null);

            return(info);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Find all games on the current Memory Stick.
        /// </summary>
        /// <param name="device">The Memory Stick to search.</param>
        /// <returns>A list of games found.</returns>
        public static GameInformation[] FindGames(IMemoryStickDevice device)
        {
            List <GameInformation> infos = new List <GameInformation>();

            Debug.Assert(device != null);
            if ((device != null) &&
                (device.State == MediaState.Present))
            {
                // Eboots in PSP\GAME\*
                IMediaFolder rootFolder = device.Root.FindFolder(@"PSP\GAME\");
                foreach (IMediaFolder folder in rootFolder)
                {
                    // kxploit check
                    IMediaFolder realFolder   = folder;
                    bool         wasExploited = false;
                    if (folder.Name.StartsWith("__SCE__") == true)
                    {
                        // Find the %__SCE__... folder
                        realFolder = folder.Parent["%" + folder.Name] as IMediaFolder;
                        Debug.Assert(realFolder != null);
                        wasExploited = true;
                    }
                    else if (folder.Name[0] == '%')
                    {
                        continue;
                    }
                    GameInformation info = GameLoader.GetEbootGameInformation(realFolder);
                    if (wasExploited == true)
                    {
                        info.Folder = folder;
                    }
                    if (info != null)
                    {
                        infos.Add(info);
                    }
                }
            }

            return(infos.ToArray());
        }