You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Basically, the --onlyupdated flag from hactool and a way to access this information programatically through IFile. I have gotten this working, but unfortunately all the necessary information is private, so an "official" way would be nice.
// Get the fileIFilefile= romfs.OpenFile("/file.txt", OpenMode.Read);// Get the offsetlongfileOffset= nca.Sections[1].Header.IvfcInfo.LevelHeaders[5].Offset +(long)file.GetType().GetProperty("Offset", BindingFlags.NonPublic | BindingFlags.Instance).GetValue(file);// Get the first RelocationEntry from the IndirectStorageRelocationEntryrelocationEntry=(RelocationEntry)indirectStorage.GetType().GetMethod("GetRelocationEntry", BindingFlags.NonPublic | BindingFlags.Instance).Invoke(indirectStorage,newobject[]{ fileOffset });longremaining= file.GetSize();longinPos= fileOffset;// "Read" the whole file and check every entry's source, kinda copied from IndirectStorage b/c lazinesswhile(remaining>0){if(relocationEntry.SourceIndex !=0){// This file has been updated, do whateverbreak;}intbytesToRead=(int)Math.Min(relocationEntry.OffsetEnd -inPos, remaining);remaining-=bytesToRead;inPos+=bytesToRead;if(inPos >= relocationEntry.OffsetEnd){relocationEntry= relocationEntry.Next;}}
The text was updated successfully, but these errors were encountered:
This sort of thing is planned, but I'm not sure how I'm going to do it yet.
Exposing the relocation table and the rom file table and letting the application figure it out is an option, although the bucket tree APIs will change in the near future.
Another option would be to have the library parse that stuff itself and return a list of offsets and sources for each file.
Basically, the
--onlyupdated
flag from hactool and a way to access this information programatically through IFile. I have gotten this working, but unfortunately all the necessary information is private, so an "official" way would be nice.The text was updated successfully, but these errors were encountered: