示例#1
0
 public static byte[] GetFile(Stream stream, PspIsoInfo info, PspIso.Sectors sector, int start, int length)
 {
     byte[] result = new byte[length];
     stream.Seek(info[sector] * 2048 + start, SeekOrigin.Begin);
     stream.Read(result, 0, length);
     return(result);
 }
示例#2
0
        public static string GetModifiedSectorName(PspIso.Sectors sector)
        {
            if (sector == Sectors.PSP_GAME_SYSDIR_BOOT_BIN)
            {
                return("BOOT.BIN");
            }

            return(ISOHelper.GetModifiedPathName(GetSectorName(sector)));
        }
示例#3
0
 public void RemoveFile(PspIso.Sectors file)
 {
     if (fileToSectorMap.ContainsKey(file))
     {
         fileToSectorMap.Remove(file);
     }
     if (fileToSizeMap.ContainsKey(file))
     {
         fileToSizeMap.Remove(file);
     }
 }
示例#4
0
        public static int GetRamOffset(PspIso.Sectors sector)
        {
            int fileToRamOffset = 0;

            if (!FileToRamOffsets.TryGetValue(sector, out fileToRamOffset))
            {
                fileToRamOffset = -1;
            }

            return(fileToRamOffset);
        }
 public PatchedByteArray(PspIso.Sectors sector, long offset, byte[] bytes)
     : this((int)sector, offset, bytes)
 {
     SectorEnum = sector;
 }
 public LazyLoadedPatchedByteArray(PspIso.Sectors sector, long offset)
     : this((int)sector, offset)
 {
     SectorEnum = sector;
 }
示例#7
0
 public PatchRange(PspIso.Sectors sector, uint startOffset, uint endOffset) : this((int)sector, startOffset, endOffset)
 {
 }
示例#8
0
 public void AddFile(PspIso.Sectors file, int sector, int size)
 {
     fileToSectorMap[file] = sector;
     fileToSizeMap[file]   = size;
 }
示例#9
0
 public long this[PspIso.Sectors file] {
     get { return(fileToSectorMap[file]); }
 }
示例#10
0
 public long GetFileSize(PspIso.Sectors file)
 {
     return(fileToSizeMap[file]);
 }
示例#11
0
        public static IList <DirectoryEntry> GetPspDirectoryEntries(Stream iso, PatcherLib.Iso.PspIso.PspIsoInfo info, PspIso.Sectors sectorOfParentEntry, int numSectors)
        {
            int length = numSectors;
            List <DirectoryEntry> result = new List <DirectoryEntry>();
            var bytes = PspIso.GetBlock(iso, info,
                                        new PspIso.KnownPosition(sectorOfParentEntry, 0, numSectors * 2048));

            return(BuildDirectoryEntriesFromBytes(bytes));
        }
示例#12
0
        public static string GetSectorName(PspIso.Sectors sector)
        {
            string name = Enum.GetName(typeof(PspIso.Sectors), sector);

            return(name ?? ((int)sector).ToString());
        }
示例#13
0
        public static uint GetRamOffsetUnsigned(PspIso.Sectors sector)
        {
            int fileToRamOffset = GetRamOffset(sector);

            return((fileToRamOffset == -1) ? 0U : (uint)fileToRamOffset);
        }