3DSGuy / Project_CTR

428 stars 66 forks source link

Feature Request: Verify all hashes in a cart dump #133

Open mariomadproductions opened 1 year ago

mariomadproductions commented 1 year ago

Currently, some hashes are not verified in a cart dump (CCI/3DS) file. It would be useful for detecting bad dumps (e.g. bad reads due to dirty contacts) if all the different hashes were verified.

profi200 commented 1 year ago

Did you try the -y option? As far as i know it verifies everything already.

mariomadproductions commented 1 year ago

It seems to calculate the hash of the RomFS without actually comparing it with the hash in the header. It didn't notice that the hash in the header is corrupted in the ROM I have.

jakcron commented 1 year ago

You previous issue created on this topic references data being different between the romfs superblock hash in the duplicate header 0x1100-0x11FF. That data isn’t hashed. Infact nothing between 0x200-0x3FFF is hashed(with the exception of initial data) is hashed. It’s not the source of truth regarding the ncch header.

mariomadproductions commented 1 year ago

Ah, so you mean that on a real 3DS, the RomFS is not checked against the hash in this duplicate header, and the duplicate header itself is not check against any hash?

I guess then this issue is a feature request for the actual header and duplicate header to be compared. Although I suppose if the 3DS itself doesn't check for this, then theoretically a good cart dump could have this difference, so this should probably just output a warning rather than an error.