ReverseBox


NameReverseBox JSON
Version 0.48.0 PyPI version JSON
download
home_pagehttps://github.com/bartlomiejduda/ReverseBox
SummaryA set of functions useful in reverse engineering.
upload_time2025-07-09 15:24:03
maintainerNone
docs_urlNone
authorBartlomiej Duda
requires_python>=3.6
licenseNone
keywords reversebox reverse engineering re crc hash encryption compression checksum python image decode decoding rgb swizzle swizzling morton twiddle twiddling texture uyvy yuy2 nv21 nv12 rgba rgba8888 rgb565 rgba8 bgr grayscale graphics color pixel convert converting yuv raw psp ps1 ps2 ps3 ps4 xbox x360 gamecube dreamcast bc bc1 bc2 bc3 bc4 bc5 bc6 bc7 dxt1 dxt2 dxt3 packbits rle macintosh jenkins murmur murmur3 one-at-a-time additive astc etc1 etc2 dxt2 dxt4 eac basisu pvrtci uastc rgbm rgbd
VCS
bugtrack_url
requirements crc faker hashbase lzokay matplotlib mmh3 numpy Pillow polib pre-commit pytest pytest-cov setuptools twine types-setuptools
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Info

**ReverseBox** is a Python package with a set of functions
useful in software reverse engineering.

**Why ReverseBox?** <br>
It's designed to help with:
1. Decompressing / compressing data
2. Decrypting / encrypting data
3. Tedious reverse engineering tasks
e.g. testing different checksum algorithms to find the one that was
used in the software or file format
4. Figuring out file formats
5. Parsing data structures
6. Wrapping functions for input/output operations
7. Searching for raw images

**Who should use ReverseBox?** <br>
Mostly developers and reverse engineers (e.g. file format researchers
or software researchers).

# List of functionalities

* Checksum
  - Adler32 ✔️
  - Cocos2d PVR ✔️
  - Fletcher16 ✔️
  - Fletcher32 ✔️
  - Internet Checksum / IPv4 header checksum ✔️
  - Sum8 ✔️
  - Sum8 2s Complement ✔️
  - Unix Sum BSD16 ✔️
  - Unix Sum SYSV ✔️
  - Xor8 ✔️

* CRC
  - CRC-8 ✔️
  - CRC-8/CDMA2000 ✔️
  - CRC-8/DARC ✔️ <span style="color:yellow">(wrapper only)</span>
  - CRC-16 (ARC) ✔️
  - CRC-16 (Modbus) ✔️
  - CRC-16 (Sick) ✔️
  - CRC-16 (DNP) ✔️
  - CRC-16 (EA CRCF) ✔️
  - CRC-16-CCITT (XModem) ✔️
  - CRC-16-CCITT (0xFFFF) ✔️
  - CRC-16-CCITT (0x1D0F) ✔️
  - CRC-16-CCITT (Kermit) ✔️
  - CRC-32/CKSUM (Unix cksum) ✔️
  - CRC-32 (ISO/HDLC) ✔️
  - CRC-32 (Asobo) ✔️
  - CRC-64 (Asobo) ✔️
  - CRC-64/GO-ISO ✔️ <span style="color:yellow">(wrapper only)</span>

* Compression
  - Asobo (TODO) ❌
  - BZE/BZZ (TODO) ❌
  - BZIP2 (TODO) ❌
  - GZIP (TODO) ❌
  - JCALG1 (TODO) ❌
  - LZMA (TODO) ❌
  - LZO / LZO1X ✔️ <span style="color:yellow">(wrapper only)</span>
  - LZSS (TODO) ❌
  - MIO0 ✔️
  - NitroSDK (TODO) ❌
  - Oodle (TODO) ❌
  - Refpack (EA Games) ✔️ <span style="color:yellow">(wrapper only)</span>
  - RNC (TODO) ❌
  - ZLIB ✔️ <span style="color:yellow">(wrapper only)</span>
  - (game-specific) Re:Tiyoruga DAT compression ✔️

* Encryption
  - AES (TODO) ❌
  - DES (TODO) ❌
  - Lucifer / DTD-1 (TODO) ❌
  - ROT13 ✔️
  - XOR Cipher (Basic) ✔️
  - XOR Cipher (Basic) Guesser ✔️
  - Hatch Engine Encryption ✔️
  - (game-specific) XOR Cipher (Retro64 ECO) ✔️
  - (game-specific) XOR Cipher (Giana’s Return ZDA) ✔️

* Hash
  - Additive Hash ✔️
  - AP ✔️
  - DJB2 ✔️
  - FNV0-32 ✔️
  - FNV0-64 ✔️
  - FNV1-32 ✔️
  - FNV1-64 ✔️
  - FNV1A-32 ✔️
  - FNV1A-64 ✔️
  - Jenkins one-at-a-time ✔️
  - SDBM ✔️
  - SHA-1 ✔️ <span style="color:yellow">(wrapper only)</span>
  - SHA-2 (256 bits) ✔️ <span style="color:yellow">(wrapper only)</span>
  - MD2 ✔️ <span style="color:yellow">(wrapper only)</span>
  - MD5 ✔️ <span style="color:yellow">(wrapper only)</span>
  - Murmur3 ✔️ <span style="color:yellow">(wrapper only)</span>
  - (game-specific) Hercules (TODO) ❌
  - (game-specific) E-racer (TODO) ❌
  - (game-specific) Pivotal Games DAT Hash ✔️

* Image
  - Decode RGB121 ✔️
  - Decode RGB121_BYTE ✔️
  - Decode RGBA2222 ✔️
  - Decode RGBX2222 ✔️
  - Decode GRAY8 ✔️
  - Decode ALPHA8 ✔️
  - Decode LA44 ✔️
  - Decode RGBX332 (RGB8) ✔️
  - Decode BGRX332 (BGR8) ✔️
  - Decode/Encode RGB565 ✔️
  - Decode/Encode BGR565 ✔️
  - Decode/Encode RGBX5551 ✔️
  - Decode/Encode RGBT5551 ✔️
  - Decode/Encode RGBA5551 ✔️
  - Decode/Encode BGRA5551 ✔️
  - Decode BGRX5551 ✔️
  - Decode RGBX6666 ✔️
  - Decode RGBA6666 ✔️
  - Decode RGB888 (RGB24) ✔️
  - Decode BGR888 (BGR24) ✔️
  - Decode ARGB4444 ✔️
  - Decode RGBA4444 ✔️
  - Decode ABGR4444 ✔️
  - Decode XBGR4444 ✔️
  - Decode/Encode RGBX4444 ✔️
  - Decode BGRA4444 ✔️
  - Decode BGRX4444 ✔️
  - Decode XRGB1555 ✔️
  - Decode ARGB1555 ✔️
  - Decode ABGR1555 ✔️
  - Decode XBGR1555 ✔️
  - Decode/Encode ARGB8888 ✔️
  - Decode ABGR8888 ✔️
  - Decode/Encode RGBA8888 ✔️
  - Decode/Encode BGRA8888 ✔️
  - Decode RGB48 ✔️
  - Decode BGR48 ✔️
  - Decode/Encode PAL4 ✔️
  - Decode/Encode PAL8 ✔️
  - Decode PAL16 ✔️
  - Decode PAL32 ✔️
  - Decode PAL_I8A8 ✔️
  - Decode N64_RGB5A3 ✔️
  - Decode N64_I4 ✔️
  - Decode N64_I8 ✔️
  - Decode N64_IA4 ✔️
  - Decode N64_IA8 ✔️
  - Decode N64_RGBA32 ✔️
  - Decode N64_CMPR ✔️
  - Decode/Encode BC1/DXT1 ✔️
  - Decode/Encode DXT2 ✔️
  - Decode/Encode BC2/DXT3 ✔️
  - Decode/Encode DXT4 ✔️
  - Decode/Encode BC3/DXT5 ✔️
  - Decode/Encode BC4 ✔️
  - Decode/Encode BC5 ✔️
  - Decode/Encode BC6 ✔️
  - Decode/Encode BC7 ✔️
  - Decode/Encode PVRTCI_2bpp_RGB ✔️
  - Decode/Encode PVRTCI_2bpp_RGBA ✔️
  - Decode/Encode PVRTCI_4bpp_RGB ✔️
  - Decode/Encode PVRTCI_4bpp_RGBA ✔️
  - Decode/Encode PVRTCII_2bpp ✔️
  - Decode/Encode PVRTCII_4bpp ✔️
  - Decode/Encode ETC1 ✔️
  - Decode/Encode BW1bpp ✔️
  - Decode/Encode SharedExponentR9G9B9E5 ✔️
  - Decode/Encode RGBG8888 ✔️
  - Decode/Encode GRGB8888 ✔️
  - Decode/Encode ETC2_RGB ✔️
  - Decode/Encode ETC2_RGBA ✔️
  - Decode/Encode ETC2_RGB_A1 ✔️
  - Decode/Encode EAC_R11 ✔️
  - Decode/Encode EAC_RG11 ✔️
  - Decode/Encode ASTC_4x4 ✔️
  - Decode/Encode ASTC_5x4 ✔️
  - Decode/Encode ASTC_5x5 ✔️
  - Decode/Encode ASTC_6x5 ✔️
  - Decode/Encode ASTC_6x6 ✔️
  - Decode/Encode ASTC_8x5 ✔️
  - Decode/Encode ASTC_8x6 ✔️
  - Decode/Encode ASTC_8x8 ✔️
  - Decode/Encode ASTC_10x5 ✔️
  - Decode/Encode ASTC_10x6 ✔️
  - Decode/Encode ASTC_10x8 ✔️
  - Decode/Encode ASTC_10x10 ✔️
  - Decode/Encode ASTC_12x10 ✔️
  - Decode/Encode ASTC_12x12 ✔️
  - Decode/Encode ASTC_3x3x3 ✔️
  - Decode/Encode ASTC_4x3x3 ✔️
  - Decode/Encode ASTC_4x4x3 ✔️
  - Decode/Encode ASTC_4x4x4 ✔️
  - Decode/Encode ASTC_5x4x4 ✔️
  - Decode/Encode ASTC_5x5x4 ✔️
  - Decode/Encode ASTC_5x5x5 ✔️
  - Decode/Encode ASTC_6x5x5 ✔️
  - Decode/Encode ASTC_6x6x5 ✔️
  - Decode/Encode ASTC_6x6x6 ✔️
  - Decode/Encode BASISU_ETC1S ✔️
  - Decode/Encode BASISU_UASTC ✔️
  - Decode/Encode RGBM ✔️
  - Decode/Encode RGBD ✔️
  - Decode GST121 ✔️
  - Decode GST221 ✔️
  - Decode GST421 ✔️
  - Decode GST821 ✔️
  - Decode GST122 ✔️
  - Decode GST222 ✔️
  - Decode GST422 ✔️
  - Decode GST822 ✔️
  - Decode YUY2 ✔️
  - Decode NV12 ✔️
  - Decode NV21 ✔️
  - Decode UYVY ✔️
  - Decode YUV444P ✔️
  - Decode YUV410P ✔️
  - Decode YUV420P ✔️
  - Decode YUV422P ✔️
  - Decode YUV411P ✔️
  - Decode UYYVYY411 ✔️
  - Decode YUV440P ✔️
  - Decode YUVA420P ✔️
  - Decode AYUV ✔️
  - Decode GRAY8A (LA88) ✔️
  - Decode GRAY16 ✔️
  - Decode RG88 ✔️
  - Decode XRGB8888 ✔️
  - Decode RGBX8888 ✔️
  - Decode XBGR8888 ✔️
  - Decode BGRX8888 ✔️
  - Decode R8 ✔️
  - Decode G8 ✔️
  - Decode B8 ✔️
  - Decode R16 ✔️
  - Decode G16 ✔️
  - Decode B16 ✔️
  - Decode R32 ✔️
  - Decode G32 ✔️
  - Decode B32 ✔️
  - Decode BUMPMAP_SR ✔️
  - 3DS Swizzling/Twiddling ✔️
  - CMPR Swizzling/Twiddling ✔️
  - PS2 Swizzling/Twiddling ✔️
  - PS2 Palette Swizzling/Twiddling ✔️
  - PS4 Swizzling/Twiddling ✔️
  - PSP Swizzling/Twiddling ✔️
  - PS Vita Swizzling/Twiddling ✔️
  - XBOX 360 Swizzling/Twiddling ✔️
  - GameCube/WII Swizzling/Twiddling ✔️
  - Switch Swizzling/Twiddling ✔️
  - WII U Swizzling/Twiddling ✔️
  - XBOX/PS3 Swizzling/Twiddling (Morton Order) ✔️
  - Dreamcast Swizzling/Twiddling (Morton Order) ✔️
  - BC Swizzling/Twiddling ✔️
  - PS2 GS Texture Swizzling/Twiddling ✔️
  - PS2 GS Texture Compression ✔️
  - RLE TGA compression ✔️
  - PackBits (Macintosh RLE) compression ✔️
  - Executioners RLE compression ✔️
  - Generating mipmaps ✔️

* IO
  - File Reader ✔️
  - File Writer ✔️
  - Bytes Handler ✔️
  - Translation Text Handler ✔️
  - Mod Handler ✔️
  - File extension checking ✔️
  - Padding calculation ✔️
  - File size checking ✔️

# Checksum calculation - example

// CRC32 calculation
```
from reversebox.crc import crc32_iso_hdlc
from reversebox.common import common

test_data = b'123456789'
crc32_handler = crc32_iso_hdlc.CRC32Handler()
crc32 = crc32_handler.calculate_crc32(test_data)
print("CRC32_INT: ", crc32)
print("CRC32_STR: ", common.convert_int_to_hex_string(crc32))
```
// CRC32 output
```
CRC32_INT:  3421780262
CRC32_STR:  0xCBF43926
```


# XOR encryption - example

// XOR Cipher (Basic)
```
from reversebox.encryption.encryption_xor_basic import xor_cipher_basic


test_data = b'abcd'
test_key = b'\x3D'
xor_result = xor_cipher_basic(test_data, test_key)
print(xor_result)
```

// XOR Cipher output
```
b'\\_^Y'
```


# File Handler - example

// File reading
```
import os
from reversebox.io_files.file_handler import FileHandler


file_path = os.path.join(os.path.dirname(__file__), "file.bin")
file_reader = FileHandler(file_path, "rb")
file_reader.open()
value = file_reader.read_str(4, "utf8")
print(value)
```

// File Reader Output
```
ABCD
```


# Hash calculation - example

// SHA-1 calculation
```
from reversebox.hash.hash_sha1 import SHA1Handler

test_data = b'abcd'
sha1_handler = SHA1Handler()
sha1 = sha1_handler.calculate_sha1_hash(test_data)
print("SHA-1 hash: ", sha1)
```

// SHA-1 Output
```
SHA-1 hash:  b'\x81\xfe\x8b\xfe\x87Wl>\xcb"Bo\x8eW\x84s\x82\x91z\xcf'
```

# Image decoding - example

// DXT1 compressed image decoding

```
from reversebox.image.image_decoder import ImageDecoder
from reversebox.image.image_formats import ImageFormats
from reversebox.image.pillow_wrapper import PillowWrapper


def show_img():
    with open("image_data_dxt1_64x64.bin", "rb") as f:
        image_data = f.read()

    img_width: int = 64
    img_height: int = 64
    decoder = ImageDecoder()
    wrapper = PillowWrapper()
    converted_data: bytes = decoder.decode_compressed_image(image_data, img_width, img_height, ImageFormats.BC1_DXT1)
    pil_image = wrapper.get_pillow_image_from_rgba8888_data(converted_data, img_width, img_height)
    pil_image.show()


if __name__ == '__main__':
    show_img()
```


# More Examples

Need more examples? <br>
Check out list of tools written using ReverseBox:
- [Giana's Return ZDA Tool](https://github.com/bartlomiejduda/Tools/blob/master/NEW%20Tools/Gianas%20Return/Gianas_Return_ZDA_Tool.py)
- [ObsCure 2 HVP Extractor](https://github.com/bartlomiejduda/Tools/blob/master/NEW%20Tools/ObsCure%202/ObsCure%202%20HVP%20Tools/Obscure_2_hvp_extractor.py)
- [Tail Concerto Translation Tools](https://github.com/bartlomiejduda/Tools/tree/master/NEW%20Tools/Tail%20Concerto/Tail%20Concerto%20Tools)
- [EA Graphics Manager](https://github.com/bartlomiejduda/EA-Graphics-Manager)
- [Acclaim TRE Tool](https://github.com/bartlomiejduda/Tools/tree/master/NEW%20Tools/Acclaim/Acclaim_TRE_Tool)
- [F-Zero X TEX Tool](https://github.com/bartlomiejduda/Tools/tree/master/NEW%20Tools/F-Zero%20X/TEX%20Tool)
- [ImageHeat](https://github.com/bartlomiejduda/ImageHeat)
- [Hatch Engine Archive Tool](https://github.com/bartlomiejduda/Tools/tree/master/NEW%20Tools/Hatch%20Engine/Hatch%20Engine%20Archive%20Tool)
- [ReverseBox Demo](https://github.com/bartlomiejduda/Tools/tree/master/ReverseBox_Demo)
- [Super Galdelic Hour .egg texture extractor/converter](https://gist.github.com/boringhexi/e3f2e5ad98c39cdafa4913d7db23f81d)
- and more...

# Badges
![PyPI Downloads](https://static.pepy.tech/badge/reversebox)
![PyPI - Downloads](https://img.shields.io/pypi/dm/ReverseBox)
![GitHub License](https://img.shields.io/github/license/bartlomiejduda/ReverseBox)
![GitHub commit activity](https://img.shields.io/github/commit-activity/y/bartlomiejduda/ReverseBox)
![GitHub repo size](https://img.shields.io/github/repo-size/bartlomiejduda/ReverseBox)
![PyPI - Version](https://img.shields.io/pypi/v/ReverseBox)

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/bartlomiejduda/ReverseBox",
    "name": "ReverseBox",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.6",
    "maintainer_email": null,
    "keywords": "ReverseBox, reverse engineering, RE, CRC, Hash, Encryption, Compression, Checksum, Python, image, decode, decoding, RGB, swizzle, swizzling, morton, twiddle, twiddling, texture, UYVY, YUY2, NV21, NV12, RGBA, RGBA8888, RGB565, RGBA8, BGR, grayscale, graphics, color, pixel, convert, converting, YUV, RAW, PSP, PS1, PS2, PS3, PS4, XBOX, X360, gamecube, dreamcast, BC, BC1, BC2, BC3, BC4, BC5, BC6, BC7, DXT1, DXT2, DXT3, PackBits, RLE, Macintosh, Jenkins, murmur, murmur3, one-at-a-time, additive, ASTC, ETC1, ETC2, DXT2, DXT4, EAC, BASISU, PVRTCI, UASTC, RGBM, RGBD",
    "author": "Bartlomiej Duda",
    "author_email": "ikskoks@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/83/e8/e34941b3240589454a2133a36d95a76578c3e103e1298f0dad0a92219b8c/reversebox-0.48.0.tar.gz",
    "platform": null,
    "description": "# Info\r\n\r\n**ReverseBox** is a Python package with a set of functions\r\nuseful in software reverse engineering.\r\n\r\n**Why ReverseBox?** <br>\r\nIt's designed to help with:\r\n1. Decompressing / compressing data\r\n2. Decrypting / encrypting data\r\n3. Tedious reverse engineering tasks\r\ne.g. testing different checksum algorithms to find the one that was\r\nused in the software or file format\r\n4. Figuring out file formats\r\n5. Parsing data structures\r\n6. Wrapping functions for input/output operations\r\n7. Searching for raw images\r\n\r\n**Who should use ReverseBox?** <br>\r\nMostly developers and reverse engineers (e.g. file format researchers\r\nor software researchers).\r\n\r\n# List of functionalities\r\n\r\n* Checksum\r\n  - Adler32 \u2714\ufe0f\r\n  - Cocos2d PVR \u2714\ufe0f\r\n  - Fletcher16 \u2714\ufe0f\r\n  - Fletcher32 \u2714\ufe0f\r\n  - Internet Checksum / IPv4 header checksum \u2714\ufe0f\r\n  - Sum8 \u2714\ufe0f\r\n  - Sum8 2s Complement \u2714\ufe0f\r\n  - Unix Sum BSD16 \u2714\ufe0f\r\n  - Unix Sum SYSV \u2714\ufe0f\r\n  - Xor8 \u2714\ufe0f\r\n\r\n* CRC\r\n  - CRC-8 \u2714\ufe0f\r\n  - CRC-8/CDMA2000 \u2714\ufe0f\r\n  - CRC-8/DARC \u2714\ufe0f <span style=\"color:yellow\">(wrapper only)</span>\r\n  - CRC-16 (ARC) \u2714\ufe0f\r\n  - CRC-16 (Modbus) \u2714\ufe0f\r\n  - CRC-16 (Sick) \u2714\ufe0f\r\n  - CRC-16 (DNP) \u2714\ufe0f\r\n  - CRC-16 (EA CRCF) \u2714\ufe0f\r\n  - CRC-16-CCITT (XModem) \u2714\ufe0f\r\n  - CRC-16-CCITT (0xFFFF) \u2714\ufe0f\r\n  - CRC-16-CCITT (0x1D0F) \u2714\ufe0f\r\n  - CRC-16-CCITT (Kermit) \u2714\ufe0f\r\n  - CRC-32/CKSUM (Unix cksum) \u2714\ufe0f\r\n  - CRC-32 (ISO/HDLC) \u2714\ufe0f\r\n  - CRC-32 (Asobo) \u2714\ufe0f\r\n  - CRC-64 (Asobo) \u2714\ufe0f\r\n  - CRC-64/GO-ISO \u2714\ufe0f <span style=\"color:yellow\">(wrapper only)</span>\r\n\r\n* Compression\r\n  - Asobo (TODO) \u274c\r\n  - BZE/BZZ (TODO) \u274c\r\n  - BZIP2 (TODO) \u274c\r\n  - GZIP (TODO) \u274c\r\n  - JCALG1 (TODO) \u274c\r\n  - LZMA (TODO) \u274c\r\n  - LZO / LZO1X \u2714\ufe0f <span style=\"color:yellow\">(wrapper only)</span>\r\n  - LZSS (TODO) \u274c\r\n  - MIO0 \u2714\ufe0f\r\n  - NitroSDK (TODO) \u274c\r\n  - Oodle (TODO) \u274c\r\n  - Refpack (EA Games) \u2714\ufe0f <span style=\"color:yellow\">(wrapper only)</span>\r\n  - RNC (TODO) \u274c\r\n  - ZLIB \u2714\ufe0f <span style=\"color:yellow\">(wrapper only)</span>\r\n  - (game-specific) Re:Tiyoruga DAT compression \u2714\ufe0f\r\n\r\n* Encryption\r\n  - AES (TODO) \u274c\r\n  - DES (TODO) \u274c\r\n  - Lucifer / DTD-1 (TODO) \u274c\r\n  - ROT13 \u2714\ufe0f\r\n  - XOR Cipher (Basic) \u2714\ufe0f\r\n  - XOR Cipher (Basic) Guesser \u2714\ufe0f\r\n  - Hatch Engine Encryption \u2714\ufe0f\r\n  - (game-specific) XOR Cipher (Retro64 ECO) \u2714\ufe0f\r\n  - (game-specific) XOR Cipher (Giana\u2019s Return ZDA) \u2714\ufe0f\r\n\r\n* Hash\r\n  - Additive Hash \u2714\ufe0f\r\n  - AP \u2714\ufe0f\r\n  - DJB2 \u2714\ufe0f\r\n  - FNV0-32 \u2714\ufe0f\r\n  - FNV0-64 \u2714\ufe0f\r\n  - FNV1-32 \u2714\ufe0f\r\n  - FNV1-64 \u2714\ufe0f\r\n  - FNV1A-32 \u2714\ufe0f\r\n  - FNV1A-64 \u2714\ufe0f\r\n  - Jenkins one-at-a-time \u2714\ufe0f\r\n  - SDBM \u2714\ufe0f\r\n  - SHA-1 \u2714\ufe0f <span style=\"color:yellow\">(wrapper only)</span>\r\n  - SHA-2 (256 bits) \u2714\ufe0f <span style=\"color:yellow\">(wrapper only)</span>\r\n  - MD2 \u2714\ufe0f <span style=\"color:yellow\">(wrapper only)</span>\r\n  - MD5 \u2714\ufe0f <span style=\"color:yellow\">(wrapper only)</span>\r\n  - Murmur3 \u2714\ufe0f <span style=\"color:yellow\">(wrapper only)</span>\r\n  - (game-specific) Hercules (TODO) \u274c\r\n  - (game-specific) E-racer (TODO) \u274c\r\n  - (game-specific) Pivotal Games DAT Hash \u2714\ufe0f\r\n\r\n* Image\r\n  - Decode RGB121 \u2714\ufe0f\r\n  - Decode RGB121_BYTE \u2714\ufe0f\r\n  - Decode RGBA2222 \u2714\ufe0f\r\n  - Decode RGBX2222 \u2714\ufe0f\r\n  - Decode GRAY8 \u2714\ufe0f\r\n  - Decode ALPHA8 \u2714\ufe0f\r\n  - Decode LA44 \u2714\ufe0f\r\n  - Decode RGBX332 (RGB8) \u2714\ufe0f\r\n  - Decode BGRX332 (BGR8) \u2714\ufe0f\r\n  - Decode/Encode RGB565 \u2714\ufe0f\r\n  - Decode/Encode BGR565 \u2714\ufe0f\r\n  - Decode/Encode RGBX5551 \u2714\ufe0f\r\n  - Decode/Encode RGBT5551 \u2714\ufe0f\r\n  - Decode/Encode RGBA5551 \u2714\ufe0f\r\n  - Decode/Encode BGRA5551 \u2714\ufe0f\r\n  - Decode BGRX5551 \u2714\ufe0f\r\n  - Decode RGBX6666 \u2714\ufe0f\r\n  - Decode RGBA6666 \u2714\ufe0f\r\n  - Decode RGB888 (RGB24) \u2714\ufe0f\r\n  - Decode BGR888 (BGR24) \u2714\ufe0f\r\n  - Decode ARGB4444 \u2714\ufe0f\r\n  - Decode RGBA4444 \u2714\ufe0f\r\n  - Decode ABGR4444 \u2714\ufe0f\r\n  - Decode XBGR4444 \u2714\ufe0f\r\n  - Decode/Encode RGBX4444 \u2714\ufe0f\r\n  - Decode BGRA4444 \u2714\ufe0f\r\n  - Decode BGRX4444 \u2714\ufe0f\r\n  - Decode XRGB1555 \u2714\ufe0f\r\n  - Decode ARGB1555 \u2714\ufe0f\r\n  - Decode ABGR1555 \u2714\ufe0f\r\n  - Decode XBGR1555 \u2714\ufe0f\r\n  - Decode/Encode ARGB8888 \u2714\ufe0f\r\n  - Decode ABGR8888 \u2714\ufe0f\r\n  - Decode/Encode RGBA8888 \u2714\ufe0f\r\n  - Decode/Encode BGRA8888 \u2714\ufe0f\r\n  - Decode RGB48 \u2714\ufe0f\r\n  - Decode BGR48 \u2714\ufe0f\r\n  - Decode/Encode PAL4 \u2714\ufe0f\r\n  - Decode/Encode PAL8 \u2714\ufe0f\r\n  - Decode PAL16 \u2714\ufe0f\r\n  - Decode PAL32 \u2714\ufe0f\r\n  - Decode PAL_I8A8 \u2714\ufe0f\r\n  - Decode N64_RGB5A3 \u2714\ufe0f\r\n  - Decode N64_I4 \u2714\ufe0f\r\n  - Decode N64_I8 \u2714\ufe0f\r\n  - Decode N64_IA4 \u2714\ufe0f\r\n  - Decode N64_IA8 \u2714\ufe0f\r\n  - Decode N64_RGBA32 \u2714\ufe0f\r\n  - Decode N64_CMPR \u2714\ufe0f\r\n  - Decode/Encode BC1/DXT1 \u2714\ufe0f\r\n  - Decode/Encode DXT2 \u2714\ufe0f\r\n  - Decode/Encode BC2/DXT3 \u2714\ufe0f\r\n  - Decode/Encode DXT4 \u2714\ufe0f\r\n  - Decode/Encode BC3/DXT5 \u2714\ufe0f\r\n  - Decode/Encode BC4 \u2714\ufe0f\r\n  - Decode/Encode BC5 \u2714\ufe0f\r\n  - Decode/Encode BC6 \u2714\ufe0f\r\n  - Decode/Encode BC7 \u2714\ufe0f\r\n  - Decode/Encode PVRTCI_2bpp_RGB \u2714\ufe0f\r\n  - Decode/Encode PVRTCI_2bpp_RGBA \u2714\ufe0f\r\n  - Decode/Encode PVRTCI_4bpp_RGB \u2714\ufe0f\r\n  - Decode/Encode PVRTCI_4bpp_RGBA \u2714\ufe0f\r\n  - Decode/Encode PVRTCII_2bpp \u2714\ufe0f\r\n  - Decode/Encode PVRTCII_4bpp \u2714\ufe0f\r\n  - Decode/Encode ETC1 \u2714\ufe0f\r\n  - Decode/Encode BW1bpp \u2714\ufe0f\r\n  - Decode/Encode SharedExponentR9G9B9E5 \u2714\ufe0f\r\n  - Decode/Encode RGBG8888 \u2714\ufe0f\r\n  - Decode/Encode GRGB8888 \u2714\ufe0f\r\n  - Decode/Encode ETC2_RGB \u2714\ufe0f\r\n  - Decode/Encode ETC2_RGBA \u2714\ufe0f\r\n  - Decode/Encode ETC2_RGB_A1 \u2714\ufe0f\r\n  - Decode/Encode EAC_R11 \u2714\ufe0f\r\n  - Decode/Encode EAC_RG11 \u2714\ufe0f\r\n  - Decode/Encode ASTC_4x4 \u2714\ufe0f\r\n  - Decode/Encode ASTC_5x4 \u2714\ufe0f\r\n  - Decode/Encode ASTC_5x5 \u2714\ufe0f\r\n  - Decode/Encode ASTC_6x5 \u2714\ufe0f\r\n  - Decode/Encode ASTC_6x6 \u2714\ufe0f\r\n  - Decode/Encode ASTC_8x5 \u2714\ufe0f\r\n  - Decode/Encode ASTC_8x6 \u2714\ufe0f\r\n  - Decode/Encode ASTC_8x8 \u2714\ufe0f\r\n  - Decode/Encode ASTC_10x5 \u2714\ufe0f\r\n  - Decode/Encode ASTC_10x6 \u2714\ufe0f\r\n  - Decode/Encode ASTC_10x8 \u2714\ufe0f\r\n  - Decode/Encode ASTC_10x10 \u2714\ufe0f\r\n  - Decode/Encode ASTC_12x10 \u2714\ufe0f\r\n  - Decode/Encode ASTC_12x12 \u2714\ufe0f\r\n  - Decode/Encode ASTC_3x3x3 \u2714\ufe0f\r\n  - Decode/Encode ASTC_4x3x3 \u2714\ufe0f\r\n  - Decode/Encode ASTC_4x4x3 \u2714\ufe0f\r\n  - Decode/Encode ASTC_4x4x4 \u2714\ufe0f\r\n  - Decode/Encode ASTC_5x4x4 \u2714\ufe0f\r\n  - Decode/Encode ASTC_5x5x4 \u2714\ufe0f\r\n  - Decode/Encode ASTC_5x5x5 \u2714\ufe0f\r\n  - Decode/Encode ASTC_6x5x5 \u2714\ufe0f\r\n  - Decode/Encode ASTC_6x6x5 \u2714\ufe0f\r\n  - Decode/Encode ASTC_6x6x6 \u2714\ufe0f\r\n  - Decode/Encode BASISU_ETC1S \u2714\ufe0f\r\n  - Decode/Encode BASISU_UASTC \u2714\ufe0f\r\n  - Decode/Encode RGBM \u2714\ufe0f\r\n  - Decode/Encode RGBD \u2714\ufe0f\r\n  - Decode GST121 \u2714\ufe0f\r\n  - Decode GST221 \u2714\ufe0f\r\n  - Decode GST421 \u2714\ufe0f\r\n  - Decode GST821 \u2714\ufe0f\r\n  - Decode GST122 \u2714\ufe0f\r\n  - Decode GST222 \u2714\ufe0f\r\n  - Decode GST422 \u2714\ufe0f\r\n  - Decode GST822 \u2714\ufe0f\r\n  - Decode YUY2 \u2714\ufe0f\r\n  - Decode NV12 \u2714\ufe0f\r\n  - Decode NV21 \u2714\ufe0f\r\n  - Decode UYVY \u2714\ufe0f\r\n  - Decode YUV444P \u2714\ufe0f\r\n  - Decode YUV410P \u2714\ufe0f\r\n  - Decode YUV420P \u2714\ufe0f\r\n  - Decode YUV422P \u2714\ufe0f\r\n  - Decode YUV411P \u2714\ufe0f\r\n  - Decode UYYVYY411 \u2714\ufe0f\r\n  - Decode YUV440P \u2714\ufe0f\r\n  - Decode YUVA420P \u2714\ufe0f\r\n  - Decode AYUV \u2714\ufe0f\r\n  - Decode GRAY8A (LA88) \u2714\ufe0f\r\n  - Decode GRAY16 \u2714\ufe0f\r\n  - Decode RG88 \u2714\ufe0f\r\n  - Decode XRGB8888 \u2714\ufe0f\r\n  - Decode RGBX8888 \u2714\ufe0f\r\n  - Decode XBGR8888 \u2714\ufe0f\r\n  - Decode BGRX8888 \u2714\ufe0f\r\n  - Decode R8 \u2714\ufe0f\r\n  - Decode G8 \u2714\ufe0f\r\n  - Decode B8 \u2714\ufe0f\r\n  - Decode R16 \u2714\ufe0f\r\n  - Decode G16 \u2714\ufe0f\r\n  - Decode B16 \u2714\ufe0f\r\n  - Decode R32 \u2714\ufe0f\r\n  - Decode G32 \u2714\ufe0f\r\n  - Decode B32 \u2714\ufe0f\r\n  - Decode BUMPMAP_SR \u2714\ufe0f\r\n  - 3DS Swizzling/Twiddling \u2714\ufe0f\r\n  - CMPR Swizzling/Twiddling \u2714\ufe0f\r\n  - PS2 Swizzling/Twiddling \u2714\ufe0f\r\n  - PS2 Palette Swizzling/Twiddling \u2714\ufe0f\r\n  - PS4 Swizzling/Twiddling \u2714\ufe0f\r\n  - PSP Swizzling/Twiddling \u2714\ufe0f\r\n  - PS Vita Swizzling/Twiddling \u2714\ufe0f\r\n  - XBOX 360 Swizzling/Twiddling \u2714\ufe0f\r\n  - GameCube/WII Swizzling/Twiddling \u2714\ufe0f\r\n  - Switch Swizzling/Twiddling \u2714\ufe0f\r\n  - WII U Swizzling/Twiddling \u2714\ufe0f\r\n  - XBOX/PS3 Swizzling/Twiddling (Morton Order) \u2714\ufe0f\r\n  - Dreamcast Swizzling/Twiddling (Morton Order) \u2714\ufe0f\r\n  - BC Swizzling/Twiddling \u2714\ufe0f\r\n  - PS2 GS Texture Swizzling/Twiddling \u2714\ufe0f\r\n  - PS2 GS Texture Compression \u2714\ufe0f\r\n  - RLE TGA compression \u2714\ufe0f\r\n  - PackBits (Macintosh RLE) compression \u2714\ufe0f\r\n  - Executioners RLE compression \u2714\ufe0f\r\n  - Generating mipmaps \u2714\ufe0f\r\n\r\n* IO\r\n  - File Reader \u2714\ufe0f\r\n  - File Writer \u2714\ufe0f\r\n  - Bytes Handler \u2714\ufe0f\r\n  - Translation Text Handler \u2714\ufe0f\r\n  - Mod Handler \u2714\ufe0f\r\n  - File extension checking \u2714\ufe0f\r\n  - Padding calculation \u2714\ufe0f\r\n  - File size checking \u2714\ufe0f\r\n\r\n# Checksum calculation - example\r\n\r\n// CRC32 calculation\r\n```\r\nfrom reversebox.crc import crc32_iso_hdlc\r\nfrom reversebox.common import common\r\n\r\ntest_data = b'123456789'\r\ncrc32_handler = crc32_iso_hdlc.CRC32Handler()\r\ncrc32 = crc32_handler.calculate_crc32(test_data)\r\nprint(\"CRC32_INT: \", crc32)\r\nprint(\"CRC32_STR: \", common.convert_int_to_hex_string(crc32))\r\n```\r\n// CRC32 output\r\n```\r\nCRC32_INT:  3421780262\r\nCRC32_STR:  0xCBF43926\r\n```\r\n\r\n\r\n# XOR encryption - example\r\n\r\n// XOR Cipher (Basic)\r\n```\r\nfrom reversebox.encryption.encryption_xor_basic import xor_cipher_basic\r\n\r\n\r\ntest_data = b'abcd'\r\ntest_key = b'\\x3D'\r\nxor_result = xor_cipher_basic(test_data, test_key)\r\nprint(xor_result)\r\n```\r\n\r\n// XOR Cipher output\r\n```\r\nb'\\\\_^Y'\r\n```\r\n\r\n\r\n# File Handler - example\r\n\r\n// File reading\r\n```\r\nimport os\r\nfrom reversebox.io_files.file_handler import FileHandler\r\n\r\n\r\nfile_path = os.path.join(os.path.dirname(__file__), \"file.bin\")\r\nfile_reader = FileHandler(file_path, \"rb\")\r\nfile_reader.open()\r\nvalue = file_reader.read_str(4, \"utf8\")\r\nprint(value)\r\n```\r\n\r\n// File Reader Output\r\n```\r\nABCD\r\n```\r\n\r\n\r\n# Hash calculation - example\r\n\r\n// SHA-1 calculation\r\n```\r\nfrom reversebox.hash.hash_sha1 import SHA1Handler\r\n\r\ntest_data = b'abcd'\r\nsha1_handler = SHA1Handler()\r\nsha1 = sha1_handler.calculate_sha1_hash(test_data)\r\nprint(\"SHA-1 hash: \", sha1)\r\n```\r\n\r\n// SHA-1 Output\r\n```\r\nSHA-1 hash:  b'\\x81\\xfe\\x8b\\xfe\\x87Wl>\\xcb\"Bo\\x8eW\\x84s\\x82\\x91z\\xcf'\r\n```\r\n\r\n# Image decoding - example\r\n\r\n// DXT1 compressed image decoding\r\n\r\n```\r\nfrom reversebox.image.image_decoder import ImageDecoder\r\nfrom reversebox.image.image_formats import ImageFormats\r\nfrom reversebox.image.pillow_wrapper import PillowWrapper\r\n\r\n\r\ndef show_img():\r\n    with open(\"image_data_dxt1_64x64.bin\", \"rb\") as f:\r\n        image_data = f.read()\r\n\r\n    img_width: int = 64\r\n    img_height: int = 64\r\n    decoder = ImageDecoder()\r\n    wrapper = PillowWrapper()\r\n    converted_data: bytes = decoder.decode_compressed_image(image_data, img_width, img_height, ImageFormats.BC1_DXT1)\r\n    pil_image = wrapper.get_pillow_image_from_rgba8888_data(converted_data, img_width, img_height)\r\n    pil_image.show()\r\n\r\n\r\nif __name__ == '__main__':\r\n    show_img()\r\n```\r\n\r\n\r\n# More Examples\r\n\r\nNeed more examples? <br>\r\nCheck out list of tools written using ReverseBox:\r\n- [Giana's Return ZDA Tool](https://github.com/bartlomiejduda/Tools/blob/master/NEW%20Tools/Gianas%20Return/Gianas_Return_ZDA_Tool.py)\r\n- [ObsCure 2 HVP Extractor](https://github.com/bartlomiejduda/Tools/blob/master/NEW%20Tools/ObsCure%202/ObsCure%202%20HVP%20Tools/Obscure_2_hvp_extractor.py)\r\n- [Tail Concerto Translation Tools](https://github.com/bartlomiejduda/Tools/tree/master/NEW%20Tools/Tail%20Concerto/Tail%20Concerto%20Tools)\r\n- [EA Graphics Manager](https://github.com/bartlomiejduda/EA-Graphics-Manager)\r\n- [Acclaim TRE Tool](https://github.com/bartlomiejduda/Tools/tree/master/NEW%20Tools/Acclaim/Acclaim_TRE_Tool)\r\n- [F-Zero X TEX Tool](https://github.com/bartlomiejduda/Tools/tree/master/NEW%20Tools/F-Zero%20X/TEX%20Tool)\r\n- [ImageHeat](https://github.com/bartlomiejduda/ImageHeat)\r\n- [Hatch Engine Archive Tool](https://github.com/bartlomiejduda/Tools/tree/master/NEW%20Tools/Hatch%20Engine/Hatch%20Engine%20Archive%20Tool)\r\n- [ReverseBox Demo](https://github.com/bartlomiejduda/Tools/tree/master/ReverseBox_Demo)\r\n- [Super Galdelic Hour .egg texture extractor/converter](https://gist.github.com/boringhexi/e3f2e5ad98c39cdafa4913d7db23f81d)\r\n- and more...\r\n\r\n# Badges\r\n![PyPI Downloads](https://static.pepy.tech/badge/reversebox)\r\n![PyPI - Downloads](https://img.shields.io/pypi/dm/ReverseBox)\r\n![GitHub License](https://img.shields.io/github/license/bartlomiejduda/ReverseBox)\r\n![GitHub commit activity](https://img.shields.io/github/commit-activity/y/bartlomiejduda/ReverseBox)\r\n![GitHub repo size](https://img.shields.io/github/repo-size/bartlomiejduda/ReverseBox)\r\n![PyPI - Version](https://img.shields.io/pypi/v/ReverseBox)\r\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "A set of functions useful in reverse engineering.",
    "version": "0.48.0",
    "project_urls": {
        "Homepage": "https://github.com/bartlomiejduda/ReverseBox"
    },
    "split_keywords": [
        "reversebox",
        " reverse engineering",
        " re",
        " crc",
        " hash",
        " encryption",
        " compression",
        " checksum",
        " python",
        " image",
        " decode",
        " decoding",
        " rgb",
        " swizzle",
        " swizzling",
        " morton",
        " twiddle",
        " twiddling",
        " texture",
        " uyvy",
        " yuy2",
        " nv21",
        " nv12",
        " rgba",
        " rgba8888",
        " rgb565",
        " rgba8",
        " bgr",
        " grayscale",
        " graphics",
        " color",
        " pixel",
        " convert",
        " converting",
        " yuv",
        " raw",
        " psp",
        " ps1",
        " ps2",
        " ps3",
        " ps4",
        " xbox",
        " x360",
        " gamecube",
        " dreamcast",
        " bc",
        " bc1",
        " bc2",
        " bc3",
        " bc4",
        " bc5",
        " bc6",
        " bc7",
        " dxt1",
        " dxt2",
        " dxt3",
        " packbits",
        " rle",
        " macintosh",
        " jenkins",
        " murmur",
        " murmur3",
        " one-at-a-time",
        " additive",
        " astc",
        " etc1",
        " etc2",
        " dxt2",
        " dxt4",
        " eac",
        " basisu",
        " pvrtci",
        " uastc",
        " rgbm",
        " rgbd"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "83e8e34941b3240589454a2133a36d95a76578c3e103e1298f0dad0a92219b8c",
                "md5": "d5e93c73fa55652dc97473f6f6f7266e",
                "sha256": "e5014c55ed9f8c821c1d7a7a87f7ff9d2b241ba70fd311abbb81434e0ff013a5"
            },
            "downloads": -1,
            "filename": "reversebox-0.48.0.tar.gz",
            "has_sig": false,
            "md5_digest": "d5e93c73fa55652dc97473f6f6f7266e",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.6",
            "size": 1933492,
            "upload_time": "2025-07-09T15:24:03",
            "upload_time_iso_8601": "2025-07-09T15:24:03.538762Z",
            "url": "https://files.pythonhosted.org/packages/83/e8/e34941b3240589454a2133a36d95a76578c3e103e1298f0dad0a92219b8c/reversebox-0.48.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-07-09 15:24:03",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "bartlomiejduda",
    "github_project": "ReverseBox",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "requirements": [
        {
            "name": "crc",
            "specs": [
                [
                    "==",
                    "7.1.0"
                ]
            ]
        },
        {
            "name": "faker",
            "specs": [
                [
                    "==",
                    "33.1.0"
                ]
            ]
        },
        {
            "name": "hashbase",
            "specs": [
                [
                    "==",
                    "1.1.5"
                ]
            ]
        },
        {
            "name": "lzokay",
            "specs": [
                [
                    "==",
                    "1.1.8"
                ]
            ]
        },
        {
            "name": "matplotlib",
            "specs": [
                [
                    "==",
                    "3.10.0"
                ]
            ]
        },
        {
            "name": "mmh3",
            "specs": [
                [
                    "==",
                    "5.0.1"
                ]
            ]
        },
        {
            "name": "numpy",
            "specs": [
                [
                    "==",
                    "2.1.3"
                ]
            ]
        },
        {
            "name": "Pillow",
            "specs": [
                [
                    "==",
                    "10.4.0"
                ]
            ]
        },
        {
            "name": "polib",
            "specs": [
                [
                    "==",
                    "1.2.0"
                ]
            ]
        },
        {
            "name": "pre-commit",
            "specs": [
                [
                    "==",
                    "4.1.0"
                ]
            ]
        },
        {
            "name": "pytest",
            "specs": [
                [
                    "==",
                    "8.3.3"
                ]
            ]
        },
        {
            "name": "pytest-cov",
            "specs": [
                [
                    "==",
                    "6.0.0"
                ]
            ]
        },
        {
            "name": "setuptools",
            "specs": [
                [
                    "==",
                    "75.6.0"
                ]
            ]
        },
        {
            "name": "twine",
            "specs": [
                [
                    "==",
                    "5.1.1"
                ]
            ]
        },
        {
            "name": "types-setuptools",
            "specs": [
                [
                    "==",
                    "75.6.0.20241126"
                ]
            ]
        }
    ],
    "lcname": "reversebox"
}
        
Elapsed time: 0.63083s