Skip to main content

A set of functions useful in reverse engineering.

Project description

Info

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

Why ReverseBox?
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

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

List of functionalities

  • Checksum

    • CRC8 (TODO) ❌
    • CRC16 (ARC) ✔️
    • CRC16 (Modbus) ✔️
    • CRC16 (Sick) ✔️
    • CRC16 (DNP) ✔️
    • CRC16-CCITT (XModem) ✔️
    • CRC16-CCITT (0xFFFF) ✔️
    • CRC16-CCITT (0x1D0F) ✔️
    • CRC16-CCITT (Kermit) ✔️
    • CRC32 (ISO/HDLC) ✔️
    • CRC32 (Asobo) (TODO) ❌
  • Compression

    • Asobo (TODO) ❌
    • BZE/BZZ (TODO) ❌
    • BZIP2 (TODO) ❌
    • GZIP (TODO) ❌
    • JCALG1 (TODO) ❌
    • LZMA (TODO) ❌
    • LZO1X (TODO) ❌
    • LZSS (TODO) ❌
    • NitroSDK (TODO) ❌
    • Oodle (TODO) ❌
    • Refpack (EA) (TODO) ❌
    • RNC (TODO) ❌
    • ZLIB (TODO) ❌
  • Encryption

    • AES (TODO) ❌
    • DES (TODO) ❌
    • Lucifer / DTD-1 (TODO) ❌
    • XOR Cipher (Basic) ✔️
    • (game-specific) XOR Cipher (Retro64 ECO) ✔️
    • (game-specific) XOR Cipher (Giana’s Return ZDA) (TODO) ❌
  • Hash

    • SHA-1 (TODO) ❌
    • MD5 ✔️ (wrapper only)
    • (game-specific) Hercules (TODO) ❌
    • (game-specific) E-racer (TODO) ❌
  • Image

    • PS2 Swizzling/Twiddling (TODO) ❌
    • PSP Swizzling/Twiddling (TODO) ❌
  • IO

    • File Reader ✔️
    • File Writer (TODO) ❌
    • File extension checking ✔️

Checksum calculation - example

// CRC16 (Kermit) calculation

from reversebox.checksum import checksum_crc16_kermit
from reversebox.common import common

test_data = b'123456789'
crc16_handler = checksum_crc16_kermit.CRC16KermitHandler()
crc16 = crc16_handler.calculate_crc16_kermit(test_data)
print("CRC16_INT: ", crc16)
print("CRC16_STR: ", common.convert_int_to_hex_string(crc16))

// CRC16 (Kermit) output

CRC16_INT:  35105
CRC16_STR:  0x8921

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 Reader - example

// File Reader Usage

from reversebox.io_files.file_reader import FileReader


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

// File Reader Output

ABCD

Project details


Release history Release notifications | RSS feed

This version

0.2.2

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ReverseBox-0.2.2.tar.gz (19.7 kB view details)

Uploaded Source

File details

Details for the file ReverseBox-0.2.2.tar.gz.

File metadata

  • Download URL: ReverseBox-0.2.2.tar.gz
  • Upload date:
  • Size: 19.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.10.6

File hashes

Hashes for ReverseBox-0.2.2.tar.gz
Algorithm Hash digest
SHA256 ac60c5850bc8c32e203e9671dc06620a096bfa10c7e0fb48e96f95d64a6bdeb9
MD5 65d5b7b6c895f6af2d6054495396377e
BLAKE2b-256 7409a45423b5d3cb59addcac7e21574b6ea51c2eec1d93fe979dc79eb9f0f438

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page