(WIP) - BNTX Extractor

Discussion in 'Switch - Hacking & Homebrew' started by AboodXD, Jul 26, 2017.

  1. AboodXD
    OP

    AboodXD I hack NSMB games, and other shiz.

    Member
    2,682
    1,404
    Oct 11, 2014
    United Arab Emirates
    Not under a rock.
    BNTX Extractor v0.4

    BNTX Extractor is a tool which extracts textures from the Binary NX Texture ('BNTX' / .bntx file extension) format used in Switch games, and saves them as DDS (or ASTC files).

    Supported texture formats:
    • R8_G8_B8_A8_UNORM
    • R8_G8_B8_A8_SRGB
    • R5_G6_B5_UNORM
    • R8_UNORM
    • R8_G8_UNORM
    • BC1_UNORM
    • BC1_SRGB
    • BC2_UNORM
    • BC2_SRGB
    • BC3_UNORM
    • BC3_SRGB
    • BC4_UNORM
    • BC4_SNORM
    • BC5_UNORM
    • BC5_SNORM
    • BC6H_UF16
    • BC6H_SF16
    • BC7_UNORM
    • BC7_SRGB
    • ASTC4x4
    • ASTC4x4 SRGB
    • ASTC5x4
    • ASTC5x4 SRGB
    • ASTC5x5
    • ASTC5x5 SRGB
    • ASTC6x5
    • ASTC6x5 SRGB
    • ASTC6x6
    • ASTC6x6 SRGB
    • ASTC8x5
    • ASTC8x5 SRGB
    • ASTC8x6
    • ASTC8x6 SRGB
    • ASTC8x8
    • ASTC8x8 SRGB
    • ASTC10x5
    • ASTC10x5 SRGB
    • ASTC10x6
    • ASTC10x6 SRGB
    • ASTC10x8
    • ASTC10x8 SRGB
    • ASTC10x10
    • ASTC10x10 SRGB
    • ASTC12x10
    • ASTC12x10 SRGB
    • ASTC12x12
    • ASTC12x12 SRGB

    Known bugs:
    • The swizzling isn't completely perfect yet.

    Notes:
    • A lot of tools don't support BC6 and BC7 DDS files, so I recommend using CompressonatorCLI to convert those DDS files to PNG files.
    • For ASTC textures, you need to use the ASTC Evaluation Codec to convert those textures to TGA. Use the following command:
      Code:
      astcenc -d input.astc output.tga

    Here's a test:
    Warning: Spoilers inside!

    Special thanks to:
    • gdkchan: Original swizzling algorithm

    Download.
    Source code / Github.
     
    Last edited by AboodXD, Aug 13, 2017
  2. the_randomizer

    the_randomizer The Temp's official fox whisperer

    Member
    22,067
    10,390
    Apr 29, 2011
    United States
    Dr. Wahwee's castle
    That was fast XD


    But the image is broken
     
  3. AboodXD
    OP

    AboodXD I hack NSMB games, and other shiz.

    Member
    2,682
    1,404
    Oct 11, 2014
    United Arab Emirates
    Not under a rock.
    Fixed.
     
    Trumpasaurus and the_randomizer like this.
  4. AboodXD
    OP

    AboodXD I hack NSMB games, and other shiz.

    Member
    2,682
    1,404
    Oct 11, 2014
    United Arab Emirates
    Not under a rock.
    Just released v0.2!

    Changelog:
    • Fixed swizzling for BCn textures.
    • Fixed a bug where the type of the texture is unknown.

    Download.
     
  5. AboodXD
    OP

    AboodXD I hack NSMB games, and other shiz.

    Member
    2,682
    1,404
    Oct 11, 2014
    United Arab Emirates
    Not under a rock.
    Just released v0.3!

    Changelog:
    • Added support for BC6H and BC7 textures.

    Here's a BC7 texture from MK8D:
    Warning: Spoilers inside!

    Download.
     
  6. PewnyPL

    PewnyPL GBAtemp Advanced Fan

    Member
    587
    250
    Feb 2, 2014
    Poland
    Whoa, wait, I knew we had cart dumps already, but we have decrypted ones as well to extract files from games?
     
  7. AboodXD
    OP

    AboodXD I hack NSMB games, and other shiz.

    Member
    2,682
    1,404
    Oct 11, 2014
    United Arab Emirates
    Not under a rock.
    Yes.
     
  8. Domineu

    Domineu Advanced Member

    Newcomer
    51
    6
    May 3, 2016
    Germany
    How did you convert the BC7 to PNG? All of the converters I used failed to convert it.
     
  9. Noctosphere

    Noctosphere Moon furries | Official follower of Skiddon't-ism

    Member
    2,063
    1,987
    Dec 30, 2013
    Canada
    Between three furries women
    Its cool to see tools like this popping up there and there
     
    dsionr4 likes this.
  10. AboodXD
    OP

    AboodXD I hack NSMB games, and other shiz.

    Member
    2,682
    1,404
    Oct 11, 2014
    United Arab Emirates
    Not under a rock.
    Compressonator.
     
  11. Domineu

    Domineu Advanced Member

    Newcomer
    51
    6
    May 3, 2016
    Germany
    Thank you
     
  12. Domineu

    Domineu Advanced Member

    Newcomer
    51
    6
    May 3, 2016
    Germany
    Will you also add support for Format: 11526 (.astc)? (The files usually have ^w in their name)
     
  13. AboodXD
    OP

    AboodXD I hack NSMB games, and other shiz.

    Member
    2,682
    1,404
    Oct 11, 2014
    United Arab Emirates
    Not under a rock.
    Maybe. Even though MK8 DX uses ASTC, I won't add it until I'm in dire need for it or it's highly requested.
     
  14. Domineu

    Domineu Advanced Member

    Newcomer
    51
    6
    May 3, 2016
    Germany
    Splatoon 2 actually uses ASTC in many textures.
     
  15. AboodXD
    OP

    AboodXD I hack NSMB games, and other shiz.

    Member
    2,682
    1,404
    Oct 11, 2014
    United Arab Emirates
    Not under a rock.
    Just released v0.4!

    Changelog:
    • Improved the swizzling.
    • Added support for ASTC formats.

    For ASTC textures, you need to use the ASTC Evaluation Codec to convert those textures to TGA. Use the following command:
    Code:
    astcenc -d input.astc output.tga
    Download.