Linux alternative to No Ban No Sky

Discussion in '3DS - Flashcards & Custom Firmwares' started by PHF, Aug 2, 2015.

  1. PHF
    OP

    PHF Member

    Newcomer
    11
    6
    Aug 21, 2007
    France
    Preamble
    I have written this tiny utility for myself, and I decided to share it for anyone interested in (if any). This thread is intended for experienced Linux users (or at least Unix users). I will not provide any kind of support on how to use Linux and/or a shell prompt. I have no plan for making an user friendly utility, so feel free to use this as a starting point if you ever want to build a GUI.

    The utility is based on sed (if your are not familiar with this awesome tool, you can learn more here). You can either invoke sed with a script file:
    Code:
    sed -r -f SCRIPT_FILE.txt < template.txt > template_private.txt
    or with an inline script:
    Code:
    sed -r 'INLINE_SCRIPT' < template.txt > template_private.txt
    In both invocations, the -r flag allows to use extended regular expressions.

    Replacing the unique ID
    The following script is 100% equivalent to the "Patch ALL Games" button in No Ban No Sky: the given UNIQUE_ID is applied to all games.

    Full script
    Inline script

    Note that UNIQUE_ID must be replaced by 16 pairs of hexadecimal digits (01 23 45 67 89 AB CD EF 01 23 45 67 89 AB CD EF), without altering the surrounding \1 and \3.

    Replacing the unique ID and the manufacturer
    From my own experience, it appeared that replacing the unique ID was no always enough to play online. However, replacing the manufacturer byte with the one of my private header was much better. I don't know if it works for all games, but it did for all my tests. The following script applies both the given UNIQUE_ID and the given MANUFACTURER to all games.
    Full script
    Inline script

    Note that MANUFACTURER must be replaced by a pair of hexadecimal digits, without altering the surrounding \1 and \3.

    All-in-one script
    If you are lazy like I am, and don't want to manually extract the UNIQUE_ID and the MANUFACTURER from you private header, you can use the following Bash script (ensure that hexdump is installed on your machine).
    apply_header.sh

    Save the script in a .sh file, and make it executable. Then run it like this:
    Code:
    ./apply_header.sh PRIVATE_HEADER.bin < template.txt > template_private.txt
    Other platforms
    I only tested this on Linux, but since sed is a standard Unix tool, you can probably run it also on Mac OS, or even on Windows (using Cygwin or sed for Windows).
     
  2. Skyline969

    Skyline969 MENUdo Afficionado

    Member
    2,207
    8
    Nov 18, 2008
    Canada
    Saskatchewan
    This looks incredibly useful, thanks for this. Now forgive me as I'm completely new to the Sky3DS scene, but from what I understand all I need to do is run this script to patch the template file (using a private header and all of that, yes), and then just use it in DiskWriter to write my backups to the MicroSD for the Sky3DS? That's it?
     
  3. PHF
    OP

    PHF Member

    Newcomer
    11
    6
    Aug 21, 2007
    France
    That's it, exactly :).
     
  4. Cerberus3

    Cerberus3 Member

    Newcomer
    16
    4
    Feb 27, 2015
    United States
    your function for writing in the manufacturer id is precisely what i need but i have no experience with programming or linux.