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); }
public static string GetModifiedSectorName(PspIso.Sectors sector) { if (sector == Sectors.PSP_GAME_SYSDIR_BOOT_BIN) { return("BOOT.BIN"); } return(ISOHelper.GetModifiedPathName(GetSectorName(sector))); }
public void RemoveFile(PspIso.Sectors file) { if (fileToSectorMap.ContainsKey(file)) { fileToSectorMap.Remove(file); } if (fileToSizeMap.ContainsKey(file)) { fileToSizeMap.Remove(file); } }
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; }
public PatchRange(PspIso.Sectors sector, uint startOffset, uint endOffset) : this((int)sector, startOffset, endOffset) { }
public void AddFile(PspIso.Sectors file, int sector, int size) { fileToSectorMap[file] = sector; fileToSizeMap[file] = size; }
public long this[PspIso.Sectors file] { get { return(fileToSectorMap[file]); } }
public long GetFileSize(PspIso.Sectors file) { return(fileToSizeMap[file]); }
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)); }
public static string GetSectorName(PspIso.Sectors sector) { string name = Enum.GetName(typeof(PspIso.Sectors), sector); return(name ?? ((int)sector).ToString()); }
public static uint GetRamOffsetUnsigned(PspIso.Sectors sector) { int fileToRamOffset = GetRamOffset(sector); return((fileToRamOffset == -1) ? 0U : (uint)fileToRamOffset); }