Hacking Check nand integrity on pc using the .SHA files?

Altairseven

Well-Known Member
OP
Member
Joined
Jan 21, 2016
Messages
125
Trophies
0
Age
33
XP
113
Country
Argentina
hi, after reading a post about someone that had a bad emunand backup to restore after a9lh installation, and something similar happening to me due to a bad sd, but thankfully with a good copy on my pc, i got a little worried, and started thinking.

what is the best way, if any, to check in my computer the integrity of the backup file using the .sha generated by the latest versions of otphelper, decrypt9 emunand9 and hourglass9?
 

The Real Jdbye

*is birb*
Member
Joined
Mar 17, 2010
Messages
23,421
Trophies
4
Location
Space
XP
14,085
Country
Norway
hi, after reading a post about someone that had a bad emunand backup to restore after a9lh installation, and something similar happening to me due to a bad sd, but thankfully with a good copy on my pc, i got a little worried, and started thinking.

what is the best way, if any, to check in my computer the integrity of the backup file using the .sha generated by the latest versions of otphelper, decrypt9 emunand9 and hourglass9?
Just compare the hash (open the .sha file in a hex editor) with one generated by a hash tool, on Windows I like to use HashTab since it integrates into the Explorer properties window and is very simple to use: http://implbits.com/products/hashtab/
For HashTab you may need to edit to the settings to enable the hash type that the 3DS tools are using, I'm not sure if it's SHA-1 or SHA-2 256/384/512, but HashTab supports them all.
 
Last edited by The Real Jdbye,

gnmmarechal

Well-Known Member
Member
GBAtemp Patron
Joined
Jul 13, 2014
Messages
6,049
Trophies
2
Age
25
Location
https://gs2012.xyz
Website
gs2012.xyz
XP
6,045
Country
Portugal
Just compare the hash (open the .sha file in a hex editor) with one generated by a hash tool, on Windows I like to use HashTab since it integrates into the Explorer properties window and is very simple to use: http://implbits.com/products/hashtab/
For HashTab you may need to edit to the settings to enable the hash type that the 3DS tools are using, I'm not sure if it's SHA-1 or SHA-2 256/384/512, but HashTab supports them all.
It's SHA-256 iirc

Sent from my Nokia 3310 using Tapatalk
 

HyperT

Well-Known Member
Member
Joined
Jun 4, 2016
Messages
674
Trophies
0
XP
232
Country
Just compare the hash (open the .sha file in a hex editor) with one generated by a hash tool, on Windows I like to use HashTab since it integrates into the Explorer properties window and is very simple to use: http://implbits.com/products/hashtab/
For HashTab you may need to edit to the settings to enable the hash type that the 3DS tools are using, I'm not sure if it's SHA-1 or SHA-2 256/384/512, but HashTab supports them all.
All that will do is check that the nand.bin's sha matches the bin.sha file; this doesn't really ensure that the bin isn't bad [i.e. a corrupted dump] as the sha's would still match; and besides hourglass9 checks the shas before flashing anyway.

What you'd need to do is dump nand twice and check they're identical - via the sha's.

Checking the sha's on PC I guess would be useful if you are using a version on decrypt9/hourglass9 that doesn't have sha checks.
 

gnmmarechal

Well-Known Member
Member
GBAtemp Patron
Joined
Jul 13, 2014
Messages
6,049
Trophies
2
Age
25
Location
https://gs2012.xyz
Website
gs2012.xyz
XP
6,045
Country
Portugal
All that will do is check that the nand.bin's sha matches the bin.sha file; this doesn't really ensure that the bin isn't bad [i.e. a corrupted dump] as the sha's would still match; and besides hourglass9 checks the shas before flashing anyway.

What you'd need to do is dump nand twice and check they're identical - via the sha's.

Checking the sha's on PC I guess would be useful if you are using a version on decrypt9/hourglass9 that doesn't have sha checks.
Twice in a row, as well. The NAND changes between boots, doesn't it?
 

HyperT

Well-Known Member
Member
Joined
Jun 4, 2016
Messages
674
Trophies
0
XP
232
Country
Twice in a row, as well. The NAND changes between boots, doesn't it?
Yea, you're probably right.

I know that every time a nand is mounted rw; the sha of that nand changes. So if the 3ds nand is mounted rw on boot [at least on cfw] then yea the sha's will be different.

Does anyone know if the file-size check is fool-proof or could a corrupted backup still spit out the correct number of bytes [I'm guessing not]
 

The Real Jdbye

*is birb*
Member
Joined
Mar 17, 2010
Messages
23,421
Trophies
4
Location
Space
XP
14,085
Country
Norway
All that will do is check that the nand.bin's sha matches the bin.sha file; this doesn't really ensure that the bin isn't bad [i.e. a corrupted dump] as the sha's would still match; and besides hourglass9 checks the shas before flashing anyway.

What you'd need to do is dump nand twice and check they're identical - via the sha's.

Checking the sha's on PC I guess would be useful if you are using a version on decrypt9/hourglass9 that doesn't have sha checks.
Hourglass9/Decrypt9 probably generate the hash while reading the NAND, so if any corruption occurred on the SD card even if it was during writing, the hashes wouldn't match. The chances of reads failing without an error, leading to corruption, are infinitesimally small, it's much more likely to corrupt during writing.

You are right though, if someone is paranoid and wants to be 100% sure then making multiple NAND backups is the only way.
But something would have to be wrong with the NAND itself for the reads to fail (unless there is a serious bug in the homebrew apps) and at that point you are pretty much screwed anyway.

Anyway, in OP's scenario (bad SD card), the SHA checksums wouldn't match and a checksum tool would tell him that, so I think it answers his question.

Verifying the checksum on a PC wouldn't be necessary in most cases, except if someone forgot to copy over the .sha file they wouldn't be able to tell if a backup was corrupted.
 
Last edited by The Real Jdbye,

gnmmarechal

Well-Known Member
Member
GBAtemp Patron
Joined
Jul 13, 2014
Messages
6,049
Trophies
2
Age
25
Location
https://gs2012.xyz
Website
gs2012.xyz
XP
6,045
Country
Portugal
Yea, you're probably right.

I know that every time a nand is mounted rw; the sha of that nand changes. So if the 3ds nand is mounted rw on boot [at least on cfw] then yea the sha's will be different.

Does anyone know if the file-size check is fool-proof or could a corrupted backup still spit out the correct number of bytes [I'm guessing not]
It *could* have the same number of bytes, and still be corrupt.
 

The Real Jdbye

*is birb*
Member
Joined
Mar 17, 2010
Messages
23,421
Trophies
4
Location
Space
XP
14,085
Country
Norway
It *could* have the same number of bytes, and still be corrupt.
This is true. Checking the size is only a way to make sure you didn't get an incomplete dump. A dump can be complete and still be corrupted.
Decrypt9 and Hourglass9 have been perfected to such a degree that it should never happen, though a faulty or fake SD card can cause it.
Personally, I'm more worried about the restore process failing/glitching up than the dump itself being corrupted. But I always overthink things and worry a lot.
 

HyperT

Well-Known Member
Member
Joined
Jun 4, 2016
Messages
674
Trophies
0
XP
232
Country
It *could* have the same number of bytes, and still be corrupt.
Yea didn't want to post too much possibly stuff in 1 go; but I had figured if hourglass reads/writes in batches then if the last batch writing fritzes out it could write garbage/00s/FFs and still give the right number of total bytes.

@The Real Jdbye I think the OPs question was more theoretical; as they have a backup on PC prior to the sd corruption.
 
Last edited by HyperT,

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
  • K3Nv2 @ K3Nv2:
    Shove a gerbil up your hamster
  • BigOnYa @ BigOnYa:
    Funny that's wut I'm doing on the grille tonight, hamster stuffed with a gerbil stuffed with a mouse.
  • K3Nv2 @ K3Nv2:
    What's that
  • BigOnYa @ BigOnYa:
    Ham-bil-ouse. Its hard to find a butcher to supply me with fresh rodent meat tho.
    +1
  • Xdqwerty @ Xdqwerty:
    @BigOnYa, try getting that meat yourself
  • K3Nv2 @ K3Nv2:
    His wife does the hunting for meat
    +1
  • BigOnYa @ BigOnYa:
    We can't leave our house here in North Korea. We to have order in everything, like Dominoes pizza everyday.
  • Xdqwerty @ Xdqwerty:
    @K3Nv2, ancientboi does too
  • K3Nv2 @ K3Nv2:
    95 out 😭
  • a_username_that_is_cool @ a_username_that_is_cool:
    @BigOnYa i dont think you can get on gbatemp in north korea
  • a_username_that_is_cool @ a_username_that_is_cool:
    what about the fact that redstarOS
  • a_username_that_is_cool @ a_username_that_is_cool:
    or however it's stylized
  • K3Nv2 @ K3Nv2:
    Bigonya is born and raised north Korea what he says goes
    +1
  • BigOnYa @ BigOnYa:
    I travel to the USA for work everyday, then go back to N Korea in evenings to be with my 17 kids and wife. Its a rough ride on a bicycle each way uphill and barefoot.
    +1
  • K3Nv2 @ K3Nv2:
    You mean 12 wives you're not sure if the 5 are yours
    +1
  • BigOnYa @ BigOnYa:
    True, they are government issued.
    +1
  • K3Nv2 @ K3Nv2:
    Bigonya real name is kim
  • BigOnYa @ BigOnYa:
    Nuh that's all the kids names tho, Kim 1, Kim 2, etc
  • K3Nv2 @ K3Nv2:
    @Xdqwerty could be yours
    +1
  • BigOnYa @ BigOnYa:
    Nuh he is Putin's
    +1
  • K3Nv2 @ K3Nv2:
    He isn't nuke hungry
  • BigOnYa @ BigOnYa:
    This game "The Quarry" is nuts, I thought the hillbillies were the killers, plot twist
  • K3Nv2 @ K3Nv2:
    Hillbillies are peaceful it's fox news that makes them look bad
    +1
  • K3Nv2 @ K3Nv2:
    Heard an old coworker passed away sad guy worked there like 30 years
    K3Nv2 @ K3Nv2: Heard an old coworker passed away sad guy worked there like 30 years