Skip to content

Instantly share code, notes, and snippets.

View rvtr's full-sized avatar
🤫
I zerofilled your DSi NAND

Lillian Skinner rvtr

🤫
I zerofilled your DSi NAND
View GitHub Profile
@Metalcape
Metalcape / 0-twl-crypto.md
Last active September 27, 2025 02:16
DSi-enhanced cryptography & signatures

DSi-enhanced games make use of an extended header together with other data structures which implement additional integrity and obfuscation measures over those already present in NDS games. These measures make it currently impossible to produce a ROM image that will run on unmodded retail hardware, however due to the existence of leaked debug keys, it is possible to resign retail ROMs to make them bootable on dev hardware such as the IS-TWL-DEBUGGER.

Header

A very good description of the TWL header format can be found on GBATEK. It is expanded from the 512 bytes of the DS to 4KiB, and it contains many additional entries, but I will be mainly referring to the following:

  • The flags field (0x1BF)
  • Digest sector entries (0x1E0 - 0x208)]
  • Modcrypt entries (0x220 - 0x230)
  • HMAC array (0x300 - 0x3B4)
  • RSA signature (0xF80 - 0x1000)
@AntonioND
AntonioND / nds_ram_expansion_cartridges.rst
Last active April 25, 2025 18:30
NDS RAM expansion cartridges
@Epicpkmn11
Epicpkmn11 / ntrbootbanner.py
Last active April 22, 2025 06:20
ntrbootbanner.py - Extracts/Injects a banner from/to an ntrboot backup
#!/usr/bin/env python3
"""
This is free and unencumbered software released into the public domain.
Anyone is free to copy, modify, publish, use, compile, sell, or
distribute this software, either in source code form or as a compiled
binary, for any purpose, commercial or non-commercial, and by any
means.
In jurisdictions that recognize copyright laws, the author or authors
of this software dedicate any and all copyright interest in the
@Epicpkmn11
Epicpkmn11 / dsibanner.py
Last active April 22, 2025 06:20
dsibanner.py - Creates a DS(i) banner file
#!/usr/bin/env python3
# Requirements:
# pip3 install libscrc pillow
# For example files, see Wordle DS:
# https://github.com/Epicpkmn11/WordleDS/tree/main/resources/icon
# python3 dsibanner.py -i icon.*.png -d icon.0.png -t Wordle DS;Pk11 -a icon.json -o banner.bin
"""
@Epicpkmn11
Epicpkmn11 / eulasetter.py
Last active April 22, 2025 06:20
eulasetter.py - Sets the EULA status of a DSi config file
#!/usr/bin/env python3
"""
This is free and unencumbered software released into the public domain.
Anyone is free to copy, modify, publish, use, compile, sell, or
distribute this software, either in source code form or as a compiled
binary, for any purpose, commercial or non-commercial, and by any
means.
@Epicpkmn11
Epicpkmn11 / gif-input-flag.py
Last active April 22, 2025 06:20
gif-input-flag.py - Sets the user input flag on specified frames of a GIF
#!/usr/bin/env python3
"""
This is free and unencumbered software released into the public domain.
Anyone is free to copy, modify, publish, use, compile, sell, or
distribute this software, either in source code form or as a compiled
binary, for any purpose, commercial or non-commercial, and by any
means.
@Epicpkmn11
Epicpkmn11 / bannerpng.c
Last active April 22, 2025 06:20
bannerpng.c - Extracts the icon from a DS(i) ROM to a PNG, see bannergif.py for a better extractor capable of extracting animated icons but in Python
/* This is free and unencumbered software released into the public domain.
*
* Anyone is free to copy, modify, publish, use, compile, sell, or
* distribute this software, either in source code form or as a compiled
* binary, for any purpose, commercial or non-commercial, and by any
* means.
*
* In jurisdictions that recognize copyright laws, the author or authors
* of this software dedicate any and all copyright interest in the
* software to the public domain. We make this dedication for the benefit
@Epicpkmn11
Epicpkmn11 / pkg2png.py
Last active April 22, 2025 06:20
Cut the Rope DSiWare image conversion scripts
#!/usr/bin/env python3
# Requirements:
# pip3 install pillow
"""
This is free and unencumbered software released into the public domain.
Anyone is free to copy, modify, publish, use, compile, sell, or
distribute this software, either in source code form or as a compiled
@Epicpkmn11
Epicpkmn11 / title-copier.py
Last active April 22, 2025 06:20
Copies a title into any blank titles in a DS ROM
#!/usr/bin/env python3
# Requirements:
# pip3 install libscrc
"""
title copier © 2022 Pk11
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the “Software”), to deal
@Epicpkmn11
Epicpkmn11 / gettmd.py
Last active November 7, 2025 12:56
gettmd.py - Downloads a TMD for a DSiWare from NUS
#!/usr/bin/env python3
# Requirements:
# pip3 install requests
"""
This is free and unencumbered software released into the public domain.
Anyone is free to copy, modify, publish, use, compile, sell, or
distribute this software, either in source code form or as a compiled