├── README.md ├── dumpsc.py ├── ktx.py └── requirements.txt /README.md: -------------------------------------------------------------------------------- 1 | # Dumpsc 2 | **Dumpsc** is an adapted version of [cr-sc-dump](https://github.com/123456abcdef/cr-sc-dump). This version aim to support all kind of **_tex.sc** files from different Supercell games. 3 | 4 | 5 | 6 | ## Usage 7 | 8 | If your file is compressed run the following command: 9 | 10 | > python dumpsc.py -d 11 | 12 | else simply use: 13 | 14 | > python dumpsc.py 15 | 16 | 17 | 18 | ## Dependencies 19 | 20 | To install **Dumpsc** dependencies run the following command: 21 | 22 | > python -m pip install -r requirements.txt 23 | -------------------------------------------------------------------------------- /dumpsc.py: -------------------------------------------------------------------------------- 1 | import os 2 | import lzma 3 | import lzham 4 | import struct 5 | import argparse 6 | import zstandard 7 | 8 | from PIL import Image 9 | from texture2ddecoder import decode_astc 10 | 11 | from ktx import load_ktx 12 | 13 | 14 | def convert_pixel(pixel, type): 15 | if type == 0 or type == 1: 16 | # RGB8888 17 | return struct.unpack('4B', pixel) 18 | elif type == 2: 19 | # RGB4444 20 | pixel, = struct.unpack('> 12) & 0xF) << 4, ((pixel >> 8) & 0xF) << 4, 22 | ((pixel >> 4) & 0xF) << 4, ((pixel >> 0) & 0xF) << 4) 23 | elif type == 3: 24 | # RBGA5551 25 | pixel, = struct.unpack('> 11) & 0x1F) << 3, ((pixel >> 6) & 0x1F) << 3, 27 | ((pixel >> 1) & 0x1F) << 3, ((pixel) & 0xFF) << 7) 28 | elif type == 4: 29 | # RGB565 30 | pixel, = struct.unpack("> 11) & 0x1F) << 3, ((pixel >> 5) & 0x3F) << 2, (pixel & 0x1F) << 3) 32 | elif type == 6: 33 | # LA88 = Luminance Alpha 88 34 | pixel, = struct.unpack("> 8), (pixel >> 8), (pixel >> 8), (pixel & 0xFF) 36 | elif type == 10: 37 | # L8 = Luminance8 38 | pixel, = struct.unpack(" 5: 149 | fileType, = struct.unpack('