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: fix parsing CNMT NCA0s #106

Closed substanc3-dev closed 3 years ago

substanc3-dev commented 3 years ago

NCA0s of CNMTs seem to be 0xA00, which is under the 0xC00 minimal threshold of the other versions of the format. This PR fixes this by just allowing it to decrypt, and only bailing after, in case the header turns out to not be NCA0.

SciresM commented 3 years ago

The PR linked looks like a huge hack to me.

If the smaller NCAs are 0xA00, require them to be 0xA00 (check the read size was that).

Also, avoid use of the word "bailing" in an error message; print instead "Error: ".

substanc3-dev commented 3 years ago

Should be resolved.