ReverseBox is a Python package with a set of functions useful in software reverse engineering.
Why ReverseBox?
It's designed to help with:
- Decompressing / compressing data
- Decrypting / encrypting data
- Tedious reverse engineering tasks e.g. testing different checksum algorithms to find the one that was used in the software or file format
- Figuring out file formats
- Parsing data structures
- Wrapping functions for input/output operations
- Searching for raw images
Who should use ReverseBox?
Mostly developers and reverse engineers (e.g. file format researchers
or software researchers).
-
Checksum
- Adler32 βοΈ
- 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 βοΈ (wrapper only)
- 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 βοΈ (wrapper only)
-
Compression
- Asobo (TODO) β
- BZE/BZZ (TODO) β
- BZIP2 (TODO) β
- GZIP (TODO) β
- JCALG1 (TODO) β
- LZMA (TODO) β
- LZO / LZO1X βοΈ (wrapper only)
- LZSS (TODO) β
- NitroSDK (TODO) β
- Oodle (TODO) β
- Refpack (EA Games) βοΈ (wrapper only)
- RNC (TODO) β
- ZLIB βοΈ (wrapper only)
-
Encryption
- AES (TODO) β
- DES (TODO) β
- Lucifer / DTD-1 (TODO) β
- ROT13 βοΈ
- XOR Cipher (Basic) βοΈ
- XOR Cipher (Basic) Guesser βοΈ
- (game-specific) XOR Cipher (Retro64 ECO) βοΈ
- (game-specific) XOR Cipher (Gianaβs Return ZDA) βοΈ
-
Hash
- DJB2 βοΈ
- FNV0-32 βοΈ
- FNV0-64 βοΈ
- FNV1-32 βοΈ
- FNV1-64 βοΈ
- FNV1A-32 βοΈ
- FNV1A-64 βοΈ
- SHA-1 βοΈ (wrapper only)
- SHA-2 (256 bits) βοΈ (wrapper only)
- MD2 βοΈ (wrapper only)
- MD5 βοΈ (wrapper only)
- (game-specific) Hercules (TODO) β
- (game-specific) E-racer (TODO) β
-
Image
- Decode RGBA2222 βοΈ
- Decode RGBX2222 βοΈ
- Decode RGB565 βοΈ
- Decode RGB888 βοΈ
- Decode ARGB4444 βοΈ
- Decode RGBA4444 βοΈ
- Decode XRGB1555 βοΈ
- Decode ABGR1555 βοΈ
- Decode XBGR1555 βοΈ
- Decode ARGB8888 βοΈ
- Decode ABGR8888 βοΈ
- Decode PAL4_RGBX5551 βοΈ
- Decode PAL4_RGB888 βοΈ
- Decode PAL4_RGB565 βοΈ
- Decode PAL4_RGBA8888 βοΈ
- Decode PAL4_RGB5A3 βοΈ
- Decode PAL8_RGBX2222 βοΈ
- Decode PAL8_RGBX5551 βοΈ
- Decode PAL8_BGRX5551 βοΈ
- Decode PAL8_RGB888 βοΈ
- Decode PAL8_BGR888 βοΈ
- Decode PAL8_RGB565 βοΈ
- Decode PAL8_RGBX6666 βοΈ
- Decode PAL8_RGB5A3 βοΈ
- Decode PAL8_RGBA8888 βοΈ
- Decode PAL8_BGRA8888 βοΈ
- Decode DXT1 βοΈ
- Decode DXT3 βοΈ
- Decode DXT5 βοΈ
- Decode GST121 βοΈ
- Decode GST221 βοΈ
- Decode GST421 βοΈ
- Decode GST821 βοΈ
- Decode GST122 βοΈ
- Decode GST222 βοΈ
- Decode GST422 βοΈ
- Decode GST822 βοΈ
- Decode YUY2 βοΈ
- 3DS Swizzling/Twiddling βοΈ
- CMPR Swizzling/Twiddling βοΈ
- PS2 Swizzling/Twiddling βοΈ
- PSP Swizzling/Twiddling βοΈ
- GameCube/WII Swizzling/Twiddling βοΈ
- PSVITA Swizzling/Twiddling βοΈ
- Switch Swizzling/Twiddling βοΈ
- XBOX/PS3 Swizzling/Twiddling (Morton Order) βοΈ
- PS2 GS Texture Swizzling/Twiddling βοΈ
- PS2 GS Texture Compression βοΈ
-
IO
- File Reader βοΈ
- File Writer βοΈ
- Bytes Handler βοΈ
- Translation Text Handler βοΈ
- Mod Handler βοΈ
- File extension checking βοΈ
- Padding calculation βοΈ
- File size checking βοΈ
// 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 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 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
// 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'
Need more examples?
Check out list of tools written using ReverseBox: