Skip to content

Instantly share code, notes, and snippets.

@garoxas
garoxas / extractnsp.py
Last active December 30, 2023 15:51
Extract XML from NSP
#!/usr/bin/env python
import argparse
import os
import struct
import sys
import xml.etree.ElementTree as etree
parser = argparse.ArgumentParser()
parser.add_argument('file', help='NSP file')
@garoxas
garoxas / CDNSP-GUI-Bob.py
Last active October 22, 2020 09:31
add Required FW Version check
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Credit:
# Thanks to Zotan (DB and script), Big Poppa Panda, AnalogMan, F!rsT-S0uL
# Design inspiration: Lucas Rey's GUI (https://darkumbra.net/forums/topic/174470-app-cdnsp-gui-v105-download-nsp-gamez-using-a-gui/)
# Thanks to the developer(s) that worked on CDNSP_Next for the cert fix!
# Thanks to the help of devloper NighTime, kvn1351, gizmomelb, theLorknessMonster
# CDNSP - GUI - Bob - v4
import sys
import time
#!/usr/bin/env bash
HACTOOL=./hactool.exe
UPDATES=`find . ! -name . -type d`
for updates in $UPDATES; do
updates=`basename $updates`
NCA=`find $updates -name '*.cnmt.nca'`
for nca in $NCA; do
TITLEID=`$HACTOOL -k keys.txt -t nca --listromfs $nca | grep "Title ID:" | grep 0100000000000809 | tr -s ' ' | cut -d' ' -f3`
#!/usr/bin/env python3
import os
import struct
import sys
from datetime import datetime
# https://github.com/switchbrew/libnx/blob/master/nx/include/switch/services/pdm.h#L78
with open('PlayEvent.dat', 'rb') as fin:
magic = struct.unpack('i', fin.read(4))[0]