suchmememanyskill / EmmcHaccGen

Supposed to be a replacement of ChoiDuJour
Other
102 stars 11 forks source link

CLI (and GUI) throw Exception ResultFsPreconditionViolation (2002-6000) #17

Closed Quas7 closed 9 months ago

Quas7 commented 10 months ago

Not sure, if it is an issue on my end. I tested with two prod.key sets against 17.0.0 and 17.0.1 firmware and got this error:

EmmcHaccGen.exe --keys prod.keys --fw 17.0.0 --verbose --no-autorcm --mariko --no-exfat
EmmcHaccGen started
Indexing NCA files...
Extracted firmware:
Version: 17.0.0
Save Version: v5
Exfat Support: Yes
NCA Count: 229

Generating BIS (boot0, boot1, BCPKG2 1-4)...
Wrote 0x00180000 bytes to .\a-17.0.0/BOOT0.bin
Wrote 0x00080000 bytes to .\a-17.0.0/BOOT1.bin
Wrote 0x00800000 bytes to .\a-17.0.0/BCPKG2-1-Normal-Main.bin
Wrote 0x00800000 bytes to .\a-17.0.0/BCPKG2-2-Normal-Sub.bin
Wrote 0x00800000 bytes to .\a-17.0.0/BCPKG2-3-SafeMode-Main.bin
Wrote 0x00800000 bytes to .\a-17.0.0/BCPKG2-4-SafeMode-Sub.bin
Wrote 0x01200025 bytes to .\a-17.0.0/boot.bis
Generating System...
Wrote 0x00002df4 bytes to .\a-17.0.0/data.arc
[Exception] ResultFsPreconditionViolation (2002-6000)
   at LibHac.Common.ThrowHelper.ThrowResult(Result result)
   at LibHac.Result.ThrowIfFailure()
   at EmmcHaccGen.LibEmmcHaccGen.WriteSystem(String path, Boolean exfat, Boolean useV5Save, Boolean dumpImkvdb) in D:\a\EmmcHaccGen\EmmcHaccGen\EmmcHaccGen\LibEmmcHaccGen.cs:line 163
   at EmmcHaccGen.Program.Start(String keys, String fwPath, Boolean noExfat, Boolean verbose, Boolean showNcaIndex, Boolean fixHashes, Boolean noAutoRcm, Boolean mariko) in D:\a\EmmcHaccGen\EmmcHaccGen\EmmcHaccGen\Program.cs:line 124
   at EmmcHaccGen.Program.Main(String keys, String fw, Boolean noExfat, Boolean verbose, Boolean showNcaIndex, Boolean fixHashes, Boolean noAutorcm, Boolean mariko) in D:\a\EmmcHaccGen\EmmcHaccGen\EmmcHaccGen\Program.cs:line 76
suchmememanyskill commented 10 months ago

Which version of emmchaccgen are you using?

There is a pre-release that tries to fix this issue: https://github.com/suchmememanyskill/EmmcHaccGen/releases/tag/3.1.0

If you're still getting it there, your prod.keys is probably missing keys

Quas7 commented 10 months ago

Ok, that was too late at night yesterady... facepalm... I only downloaded your early latest trial from the forum and posted here before looking into "releases". Will test now. ;D

Quas7 commented 10 months ago

With v3.1.0 I get no more failure messages with GUI and CLI. But my boot0 and boot1 are not 4mb in size as I expected - is this ok?

image

I tested with one "suspect" prod.key but also with two fine and complete prod.keys as well.

suchmememanyskill commented 10 months ago

Emmchaccgen's output doesn't contain the console unique data located at the end of boot0/1. You can either dump your boot01, apply the emmchaccgen output to the start of those files, then flash it back, or you can flash it directly in tegraexplorer with a warning, or you can use the system restore script

Quas7 commented 10 months ago

If I understood correctly, if I have a corrupted boot0 I am not able to generate a full boot0 with this tool, right?

suchmememanyskill commented 10 months ago

No, but no tool can. You can pad it out with 0's to 4mb but then you will destroy things like your keyblobs. If that's already gone, it does not matter

Quas7 commented 10 months ago

Ok, reading up on that matter I think, the keyblobs are just rebuild by the console itself at first boot, correct?

And really sorry for missusing this thread as kind of "customer support" - just looking for someone to confirm and maybe google will find this and help others later. ;)

my strongest link so far on that matter: https://gbatemp.net/threads/would-it-be-legal-for-me-to-post-blank-boot0-1-for-repair-purposes.533830/

suchmememanyskill commented 10 months ago

The console does not rebuild keyblobs. But keyblobs are unused since hos 7.0.0, so it does not matter

Quas7 commented 10 months ago

oh, that's great - NOW it makes all sense :) Hopefully last question: if I build an emummc, is the boot0/1 identical to the sysmmc boot0/1?

suchmememanyskill commented 10 months ago

Creating an emummc will copy all data from internal storage (sysmmc), yes