How mufeedvh/basecrack works
Purpose and Entry Points
BaseCrack is a Python decoder for common alphanumeric base encodings, including recursively layered (“magic mode”) payloads and image-derived text/metadata. The primary executable and public library surface is basecrack.py; library consumers instantiate BaseCrack and call decode(). api_example.py demonstrates programmatic use. Packaging is defined by setup.py.
Command-Line Orchestration
basecrack.py is the control-plane entry point for interactive input and command-line modes: direct strings, files, magic decoding, image EXIF extraction, OCR, and optional output wordlists. It routes each selected mode into the decoding engine and owns user-facing argument handling and result presentation.
• basecrack.py
• config.json
Decode Engine and Scheme Identification
The core decoding logic is split between the main BaseCrack implementation and a chain-oriented module. The engine attempts supported schemes, identifies the successful encoding type, and returns decoded content plus its scheme label. This is the main boundary between CLI/API callers and individual codec implementations.
• basecrack.py
• src/base_chain.py
• src/messages.py
Recursive / Multi-Encoding Flow
Magic mode repeatedly applies decoding candidates to an input until it reaches a usable terminal value or no further valid transformation is found. The chain layer represents the architecture for sequencing candidate decoders and tracking multi-stage decoding rather than treating each input as a single isolated conversion.
• src/base_chain.py
• basecrack.py
Codec Layer
Standard Python-supported base formats are likely dispatched by the primary engine, while formats requiring custom algorithms are isolated under src. Base91 and Base92 therefore form a specialized codec boundary that can be invoked alongside standard Base16/32/36/58/62/64/85/100 variants.
• src/base92.py
• src/base_chain.py
• src/__init__.py
Batch and Image-Derived Inputs
The CLI accepts line-oriented files for batch decoding and can source candidate encoded strings from image EXIF metadata or OCR output. Image OCR depends on the external Tesseract runtime, accessed through Python dependencies; Windows-specific executable location is configured through config.json. Image processing is initiated from the central CLI/engine rather than a separate service.
• basecrack.py
• config.json
• requirements.txt
Runtime, Delivery, and Dependencies
This is a Python 3 application/library, distributable through setup.py and containerizable with Dockerfile. Its material external integration is Tesseract OCR (system executable and libraries) for image text detection; no server, database, or persistent infrastructure is represented in the repository tree.
• requirements.txt
• setup.py
• Dockerfile
Main entry points: basecrack.py CLI orchestration · base_chain.py Decode chain · Dockerfile Container image · requirements.txt Python dependencies
Components 17
Entry & callers
- CLI orchestration · Parses modes, presents results, and coordinates input sources.
basecrack.py - BaseCrack API · Consumers instantiate BaseCrack and call decode().
basecrack.py - Programmatic example
api_example.py - Strings and batch files · Direct values and line-oriented file inputs.
basecrack.py
Decode pipeline
- Decode engine · Attempts supported encodings and returns content with its scheme label.
basecrack.py - Magic mode · Continues transformations until a terminal value or no valid step remains.
basecrack.py - Decode chain · Sequences candidate decoders and tracks multi-stage transformations.
src/base_chain.py - Standard base codecs · Python-supported base format decoding dispatched by the engine.
basecrack.py - Base91 / Base92 codecs · Specialized algorithms used alongside standard formats.
src/base92.py - Result messages
src/messages.py
Image input
- EXIF extraction · Extracts candidate encoded text from image metadata.
basecrack.py - OCR extraction · Obtains candidate text from images through Tesseract.
basecrack.py - Tesseract OCR · System OCR executable and libraries.
- OCR configuration · Contains Windows-specific Tesseract location settings.
config.json
Runtime & delivery
- Python dependencies
requirements.txt - Python package
setup.py - Container image
Dockerfile
Connections 20
- Programmatic example → BaseCrack API: uses
- Strings and batch files → CLI orchestration: selected input
- CLI orchestration → Decode engine: dispatches
- BaseCrack API → Decode engine: calls
- CLI orchestration → Magic mode: magic option
- Magic mode → Decode chain: repeated candidates
- Decode engine → Decode chain: identifies scheme
- Decode chain → Standard base codecs: tries
- Decode chain → Base91 / Base92 codecs: tries
- Decode engine → Result messages: formats outcomes
- EXIF extraction → CLI orchestration: candidate text
- OCR extraction → CLI orchestration: candidate text
- CLI orchestration → EXIF extraction: EXIF mode
- CLI orchestration → OCR extraction: OCR mode
- OCR extraction → Tesseract OCR: invokes
- OCR configuration → OCR extraction: configures location
- Python dependencies → CLI orchestration: provides libraries
- Python package → BaseCrack API: packages
- Container image → Python dependencies: installs
- Container image → Tesseract OCR: includes runtime