Homebrew Could Someone Make This Script..?

mondul

Well-Known Member
Member
Joined
Aug 8, 2018
Messages
126
Trophies
0
Age
40
Location
Barranquilla
XP
897
Country
Colombia
Here you have a short python3 (3.5 onwards) script for finding the eMMC CID and the console ID:
Code:
#!/usr/local/bin/python3

import sys
from os import path

# Initialize NAND filename, path and the default exit code
nand_file = 'nand.bin'
nand_path = ''
exit_code = 0

# Try to get the NAND file from the command line
if len(sys.argv) > 1:
    nand_path, nand_file = path.split(sys.argv[1])

# Read the NAND file
try:
    with open(path.join(nand_path, nand_file), 'rb') as f:
        # Go to the No$GBA footer offset
        f.seek(0xF000000)
        # Read the footer's header :-)
        bstr = f.read(0x10)

        if bstr == b'DSi eMMC CID/CPU':
            # Read the CID
            bstr = f.read(0x10)
            cid =  bytearray(bstr).hex().upper()
            print('eMMC CID  : ' + cid)
            # Save it to a text file at the same NAND location
            with open(path.join(nand_path, 'CID.txt'), 'w') as ftxt:
                ftxt.write(cid)

            # Read the console ID
            bstr = f.read(8)
            console_id = bytearray(reversed(bstr)).hex().upper()
            print('Console ID: ' + console_id)
            # Save it to a text file at the same NAND location
            with open(path.join(nand_path, 'ConsoleID.txt'), 'w') as ftxt:
                ftxt.write(console_id)

        else:
            print('ERROR: No$GBA footer not found')
            exit_code = 1

except FileNotFoundError:
    print('ERROR: Could not open the file ' + nand_file)
    exit_code = 1

sys.exit(exit_code)

EDiT: Updated code
 
Last edited by mondul,
  • Like
Reactions: Sha8q

mondul

Well-Known Member
Member
Joined
Aug 8, 2018
Messages
126
Trophies
0
Age
40
Location
Barranquilla
XP
897
Country
Colombia
could you somehow make it save the consoleid and CID directly to a file?
Updated the script with the following features:
  • The NAND file can now be specified from the command line. If not, nand.bin will be used.
  • It will save CID.txt and ConsoleID.txt at the same location as the NAND file.
  • Added an exit code in case of errors.
  • Added comments.
 
  • Like
Reactions: Sha8q

mondul

Well-Known Member
Member
Joined
Aug 8, 2018
Messages
126
Trophies
0
Age
40
Location
Barranquilla
XP
897
Country
Colombia
Anyone able to make a script that can remove the NO$ fooster from a NAND image? Also is there one that can download the 00000002.app launcher from the CDN and decrypt it?
First one already coded and working, tested withNo$GBA, but on Mac it is not removing the read-only flag, that's why I haven't included it yet in my helper script.

I'm working on the second one on my free time, will let you know when it's done EDiT: @Sha8q Here it is: https://gist.github.com/mondul/a4705c32de1687a7756173596372345c
 
Last edited by mondul,
  • Like
Reactions: Sha8q

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
  • No one is chatting at the moment.
    K3Nv2 @ K3Nv2: Nut on the hill