SciresM / hactool

hactool is a tool to view information about, decrypt, and extract common file formats for the Nintendo Switch, especially Nintendo Content Archives.
ISC License
982 stars 151 forks source link

NCA with SparseInfo field #108

Open proconsule opened 2 years ago

proconsule commented 2 years ago

Hi , i found out that some recent NCA (Base Game Program NCA) have SparseInfo field set, they failed to get parsed by hactool, giving Section read error.

Looking at that i found out that on Fs Header it gives "wrong offset" far beyond the file size (the PFS0 section) and also the roms gives wrong size on Level 5 IVFC. I suspect that SparseInfo (that contain a BKTR magic) at offset 0x148 of fs Header for each section would inform of some math to get right offset for PFS0 and also for RomFS size.

Have you some info on this undocumented Sparse Info field? Thanks

R-YaTian commented 2 years ago

SparseInfo should already documented on Atmosphere - fssystem_nca_header.hpp And I found that Base NSP of 'last stop' don't have PFS0 section actually.

proconsule commented 2 years ago

thanks for the info on that, i will check it

At offset 0x3D418F23 of program nca(decrypted) there is a PFS0 magic maybe isn't a real one, i'll have to check.