Hacking RELEASE Firmware Version Inspector - get FW version from NAND dump

GothicIII

Well-Known Member
Member
Joined
Jan 4, 2015
Messages
829
Trophies
0
Age
36
XP
2,223
Country
Gambia, The
Can someone tell me what's wrong and what i'm missing? I've done all I can to try to figure Python on but, man i'm just lost :wacko: Trying to fix my switch but, don't remember what firmware version was on this when I backed it up.

How about installing the pycryptodome module like it is told on 1st page?
 

JungleJackNL

New Member
Newbie
Joined
Jun 6, 2019
Messages
2
Trophies
0
Age
53
XP
39
Country
Netherlands Antilles
Hi, i'm trying this here Python stuff and got pretty far, but cannot seem to fix this error below. Installed the 32-bit version, did the pip install and renamed the Crypto folder to crypto. But still not getting the results. Any idea? Also tried to rename all the subfolders to use lowercase letters at the beginning of the foldername.. no lucky. Also, don't know if there should be an XTSN subfolder in site-packaged\crypto, but there is not.

upload_2019-6-7_0-48-7.png
 
Last edited by JungleJackNL,

JungleJackNL

New Member
Newbie
Joined
Jun 6, 2019
Messages
2
Trophies
0
Age
53
XP
39
Country
Netherlands Antilles
I fixed my issue. Maybe i have overlooked this part, but if someone runs into this issue; on Github there is a file named crypto,py and the file needs to be placed in the root of Phyton. Maybe it was just dumb to not download it, but i didnt. Now it works.
 

FajitaJohn

Active Member
Newcomer
Joined
Nov 1, 2018
Messages
26
Trophies
0
Age
33
XP
156
Country
Austria
Hey guys, getting the "/Contents/ not found" error some users experienced before.
As far as I know, my Keys should be correct (copied them from the prod.keys file and split the 64-digit part up into two 32-digit parts, just like a user reported before)

Any ideas?

/Edit: Maybe related, but when I try dumping my keys with lockpick, I get an error that says I should reboot and try again (which I did and didn't work)

/EDIT2: My bad. Seems like my Keys were wrong... Dunno why. They were created by LockPick. biskeydump, however, provided the correct keys.
Looks like my Backup was made on 3.0.2 :)
 
Last edited by FajitaJohn,

profiden

Member
Newcomer
Joined
Jan 18, 2014
Messages
14
Trophies
0
Age
33
XP
152
Country
United States
I am getting this error:

> python FVI.py -b=device.keys .\full.00.bin
Firmware Version Inspector - by shchmue

Usage: FVI.py [-b=/path/to/biskeyfile] <dumpfile>
biskeyfile must contain the following lines:
BIS Key 2 (crypt): <32-digit hex key>
BIS Key 2 (tweak): <32-digit hex key>
or
bis_key_02 = <64-digit hex key>
omit -b if System partition already decrypted (eg. dumped with HacDiskMount)
dumpfile must be NAND dump (eg. Hekate rawnand.bin dump) or System partition


This is my format device.keys file:
secure_boot_key = asdf
tsec_key = asdf
device_key = asdf
bis_key_00 = asdf
bis_key_01 = asdf
bis_key_02 = asdf
bis_key_03 = asdf


I am using a splitted nand from SX OS and a device.keys (from biskeydump).
 
Last edited by profiden,

shchmue

Developer
OP
Developer
Joined
Dec 23, 2013
Messages
791
Trophies
1
XP
2,367
Country
United States
I am getting this error:

> python FVI.py -b=device.keys .\full.00.bin
Firmware Version Inspector - by shchmue

Usage: FVI.py [-b=/path/to/biskeyfile] <dumpfile>
biskeyfile must contain the following lines:
BIS Key 2 (crypt): <32-digit hex key>
BIS Key 2 (tweak): <32-digit hex key>
or
bis_key_02 = <64-digit hex key>
omit -b if System partition already decrypted (eg. dumped with HacDiskMount)
dumpfile must be NAND dump (eg. Hekate rawnand.bin dump) or System partition


This is my format device.keys file:
secure_boot_key = asdf
tsec_key = asdf
device_key = asdf
bis_key_00 = asdf
bis_key_01 = asdf
bis_key_02 = asdf
bis_key_03 = asdf


I am using a splitted nand from SX OS and a device.keys (from biskeydump).
i think the error is due to the `.\` syntax but also this tool unfortunately does not support split dumps. good idea for a feature, since many people use them

edit: that syntax is fine, maybe it's the relative path to the bis key file? either way it's not going to work on a split dump right now
 
Last edited by shchmue,

aos10

Yuuki chan
Member
Joined
Apr 10, 2012
Messages
4,756
Trophies
2
Age
38
XP
4,029
Country
Saudi Arabia
i am getting this error

H:\My Switch Backup\Backup 4.1>python FVI.py -b=keys.txt rawnand.bin
python: can't open file 'FVI.py': [Errno 2] No such file or directory
 

DarthFern

Member
Newcomer
Joined
Nov 22, 2018
Messages
8
Trophies
0
Age
34
XP
58
Country
United States

C:\Users\mrc48>AppData\Local\Programs\Python\Python37-32>python FVI.py D:\switch games\nand\biskeydump.txt D:\switch games\nand\rawnand.bin
'AppData\Local\Programs\Python\Python37-32' is not recognized as an internal or external command,
operable program or batch file.


Honestly have no idea what I'm doing. this is where I am so far.
 
Last edited by DarthFern,

Garou

Well-Known Member
Member
Joined
Jan 13, 2015
Messages
1,213
Trophies
0
XP
1,667
Country

C:\Users\mrc48>AppData\Local\Programs\Python\Python37-32>python FVI.py D:\switch games\nand\biskeydump.txt D:\switch games\nand\rawnand.bin
'AppData\Local\Programs\Python\Python37-32' is not recognized as an internal or external command,
operable program or batch file.


Honestly have no idea what I'm doing. this is where I am so far.
where did you install python?
and did you select add python to PATH while installing?

win_installer.png


although I think I have an idea on where you install it so try this
Code:
%HOMEPATH%\AppData\Local\Programs\Python\Python37-32\python.exe FVI.py -b="D:\switch games\nand\biskeydump.txt" "D:\switch games\nand\rawnand.bin"
 

Saebas

Member
Newcomer
Joined
Jul 13, 2019
Messages
6
Trophies
0
Age
38
XP
71
Country
Chile
Hi guys. I'm trying to check the firmware of my first backup.

I tried using Python 3.7 64bit on windows 10, but I got the same error again and again saying it didn't found the BIS keys.

So I tried with Python 32bit, but now it says this:

E:\test>python FVI.py [-b=biskeydump64.txt] rawnand.bin
Traceback (most recent call last):
File "FVI.py", line 9, in <module>
from Crypto import XTSN
File "E:\test\Crypto.py", line 2, in <module>
from Crypto.Cipher import AES
ModuleNotFoundError: No module named 'Crypto.Cipher'; 'Crypto' is not a package
 

DarthFern

Member
Newcomer
Joined
Nov 22, 2018
Messages
8
Trophies
0
Age
34
XP
58
Country
United States
where did you install python?
and did you select add python to PATH while installing?

although I think I have an idea on where you install it so try this
Code:
%HOMEPATH%\AppData\Local\Programs\Python\Python37-32\python.exe FVI.py -b="D:\switch games\nand\biskeydump.txt" "D:\switch games\nand\rawnand.bin"


C:\Users\mrc48>C:\Users\mrc48\AppData\Local\Programs\Python\Python37\FVI.py -b="D:\switch games\nand\biskeydump 2.txt" "D:\switch games\nand\rawnand.bin"
Firmware Version Inspector - by shchmue

Dump is full EMMC raw NAND.
Traceback (most recent call last):
File "C:\Users\mrc48\AppData\Local\Programs\Python\Python37\FVI.py", line 187, in <module>
crypt = bytes.fromhex(line[key_index:key_index+0x20])
ValueError: non-hexadecimal number found in fromhex() arg at position 0


I reinstalled everything and tried again. Closer but not sure what this error means.
 

shchmue

Developer
OP
Developer
Joined
Dec 23, 2013
Messages
791
Trophies
1
XP
2,367
Country
United States

C:\Users\mrc48>C:\Users\mrc48\AppData\Local\Programs\Python\Python37\FVI.py -b="D:\switch games\nand\biskeydump 2.txt" "D:\switch games\nand\rawnand.bin"
Firmware Version Inspector - by shchmue

Dump is full EMMC raw NAND.
Traceback (most recent call last):
File "C:\Users\mrc48\AppData\Local\Programs\Python\Python37\FVI.py", line 187, in <module>
crypt = bytes.fromhex(line[key_index:key_index+0x20])
ValueError: non-hexadecimal number found in fromhex() arg at position 0


I reinstalled everything and tried again. Closer but not sure what this error means.
that's to do with the format of your bis key file. what's it look like?
 

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
    The Real Jdbye @ The Real Jdbye: it won't make it better or worse