shijimasoft / cia-unix

Decrypt CIA/3DS roms in UNIX environments (Linux and macOS)
Apache License 2.0
111 stars 14 forks source link

[NCCH ERROR] #2

Closed Ecorous closed 2 years ago

Ecorous commented 2 years ago

[NCCH ERROR] CXI's ID cannot be modified without the ability to resign the AccessDesc I am attempting to decrypt Mario Kart 7 from many different sources (none work)

Ecorous commented 2 years ago

It seems my cia-unix is borked

shijimasoft commented 2 years ago

Note: decrypt.py is not able to decrypt all types of cia.

Try compiling latest cia-unix source to be sure it doesn’t depend on that. (I just updated dltools with newer dependencies. Please remove older ones and try to download them again)

alilahriaz commented 2 years ago

Just flagging that I hit this too

[NCCH ERROR] CXI's ID cannot be modified without the ability to resign the AccessDesc
[RESULT] Failed to build CCI (ret = -3)
Decryption failed

My env is

Crystal 1.5.0 [994c70b10] (2022-07-06)
Python 2.7.16 (default, Aug 30 2021, 14:43:11) 

This is using master branch, can try v0.1.1 too

shijimasoft commented 2 years ago

That NCCH ERROR is caused by a non-implemented makerom feature

Code reference

if(/*keys->rsa.requiresPresignedDesc && */!IsCfa(hdr)){
    fprintf(stderr,"[NCCH ERROR] CXI's ID cannot be modified without the ability to resign the AccessDesc\n"); // Not yet yet, requires AccessDesc Privk, may implement anyway later
    return -1;
}

https://github.com/3DSGuy/Project_CTR/blob/319c4c6a24747a6def3c012312ed13a2f76bb369/makerom/ncch.c#L939-L942