예제 #1
0
파일: PspIso.cs 프로젝트: xjamxx/FFTPatcher
 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
파일: PspIso.cs 프로젝트: xjamxx/FFTPatcher
 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);
        }
예제 #5
0
 public PatchedByteArray(PspIso.Sectors sector, long offset, byte[] bytes)
     : this((int)sector, offset, bytes)
 {
     SectorEnum = sector;
 }
예제 #6
0
 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
파일: PspIso.cs 프로젝트: xjamxx/FFTPatcher
 public void AddFile(PspIso.Sectors file, int sector, int size)
 {
     fileToSectorMap[file] = sector;
     fileToSizeMap[file]   = size;
 }
예제 #9
0
파일: PspIso.cs 프로젝트: xjamxx/FFTPatcher
 public long this[PspIso.Sectors file] {
     get { return(fileToSectorMap[file]); }
 }
예제 #10
0
파일: PspIso.cs 프로젝트: xjamxx/FFTPatcher
 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);
        }