# HexaWork - Byte Inspector ## Overview HexaWork is a Python Tkinter application for binary file inspection and analysis. It provides a hexadecimal viewer and advanced byte analysis capabilities. ## Features ### 1. Hexadecimal View - Three-column display: offset, hexadecimal values, and ASCII representation - Uppercase hexadecimal values for better readability - Monospace font for perfect alignment - Horizontal and vertical scrollbars ### 2. Byte Analysis #### Normal Order - HEX: Hexadecimal representation of selected bytes - DEC: Corresponding decimal value - !HEX: Bitwise complement in hexadecimal - !DEC: Bitwise complement in decimal #### Reverse Order - HEX: Hexadecimal representation of bytes in reverse order - DEC: Decimal value of reverse order - !HEX: Bitwise complement in hexadecimal - !DEC: Bitwise complement in decimal ### 3. Flexible Selection - Direct selection of hexadecimal values - Full line selection including offset and ASCII - Automatic analysis update on selection ### 4. ASCII Pattern Analysis - Comprehensive file-wide ASCII text scanning - Detects various patterns: * Phone numbers * Short letter sequences * Alphanumeric codes * Potential 3-letter abbreviations - Interactive results popup - Supports multiple pattern types ### 5. Advanced ASCII Pattern Recognition - Comprehensive file-wide text scanning - Multiple pattern detection: * Possible Software Numbers (10-11 digits) * Vehicle Identification Numbers (VIN) * Potential Code Sequences * Possible PIN Codes - Unique pattern occurrence counting - Interactive results display - Supports complex alphanumeric pattern matching ### 6. Pattern Analysis Features - Detailed pattern identification: * Detects 3+ letter codes * Finds long numeric sequences * Highlights repeated patterns - Occurrence frequency tracking - User-friendly results popup - Flexible pattern recognition ## Recent Updates and Enhancements ### Logging System - Created centralized logging mechanism in `logger.py` - Logs saved in timestamped files in `logs/` directory - Provides detailed error tracking and information logging - Supports both console and file logging ### Binary Graph Visualization - Replaced Matplotlib with Plotly for interactive graphing - Added `tkinterweb` support for rendering interactive graphs - Enhanced scrolling capabilities for large binary files - Improved error handling and data validation ### Error Handling - Comprehensive error management across all modules - User-friendly error messages - Detailed logging for debugging purposes ### Performance Improvements - More robust data type handling - Optimized graph rendering - Improved scrolling mechanisms ### New Dependencies - Added `plotly` for interactive graphing - Added `tkinterweb` for HTML-based graph rendering ### Installation ```bash pip install -r requirements.txt ``` ### Known Limitations - Initial graph view limited to 512 data points - Requires Python 3.12+ - Windows platform recommended ## Troubleshooting - If you encounter any import errors, ensure all dependencies are installed - Check log files in the `logs/` directory for detailed error information ## Installation 1. Requirements: - Python 3.7 or higher - Tkinter (usually included with Python) 2. Install dependencies: ```bash pip install -r requirements.txt ``` ## Usage 1. Run the program: ```bash python main.py ``` 2. Features: - Click "Select File" to choose a binary file - Select bytes in the hex viewer (using mouse or keyboard) - View automatic analysis in Normal Order and Reverse Order panels - Use scrollbars to navigate large files ## Examples ### Byte Analysis If you select bytes "4E 31": - Normal Order: * HEX: 4E31 * DEC: 20017 * !HEX: [complement] * !DEC: [decimal complement] - Reverse Order: * HEX: 314E * DEC: 12622 * !HEX: [complement] * !DEC: [decimal complement] ## Detailed Update History ### Version 0.2.0 - Advanced Editing Capabilities #### Hexadecimal Editing Enhancements - Implemented sophisticated in-place hexadecimal editing - Developed smart cursor positioning algorithm * Maintains cursor location during edits * Handles edits at any file location - Preserved line formatting during byte modifications - Added real-time hex value validation #### File Modification Safety - Introduced file size change warning mechanism - Implemented confirmation dialog for file size alterations - Ensured user awareness of potential file structure changes #### Checksum Refinements - Enhanced checksum calculation methods - Supported variable-length byte sequences - Implemented three distinct checksum types: * 1-byte Sum Checksum * 1-byte XOR Checksum * 16-bit Checksum - Provided hexadecimal representation of checksums #### Technical Improvements - Added comprehensive error logging - Improved input validation - Enhanced user interaction during file editing ### Version 0.3.0 - Binary Graph Enhancements #### Graph Display Improvements - Implemented custom Tkinter-based graph visualization - Added support for 8-bit, 16-bit, and 32-bit data display - Enhanced scrolling mechanism for viewing large datasets - Dynamic point display control (5-1500 points) #### Axis Customization - X-axis: * Hexadecimal value display * Special 16-bit mode with doubled values * Automatic scaling based on visible points - Y-axis: * Fixed maximum values based on bit mode (255, 65535, 4294967295) * Decimal value display * Proper scaling for all data ranges #### Interactive Features - Smooth scrolling with scrollbar and mouse wheel - Dynamic graph updates when changing bit modes - Automatic rescaling when changing number of visible points - Default 512-point display for optimal performance #### Technical Improvements - Implemented efficient canvas-based plotting - Enhanced error handling and logging - Improved memory management for large datasets - Better user experience with responsive controls ### Version 0.3.1 - Interactive Graph Hover #### Enhanced Graph Interaction - Implemented interactive hover functionality in binary graph - Added dynamic vertical line tracking mouse position - Hover label displays: * X-axis position in hexadecimal * Y-axis value in decimal and hexadecimal - Seamless integration with existing 8-bit, 16-bit, and 32-bit modes - Improved data visualization with real-time coordinate tracking ### Upcoming Features - Large file performance optimization - Advanced search functionality - More configurable display options - Comprehensive unit testing ## Logging - Log file: hexawork.log - Records operations and errors for debugging - Format: timestamp, module, level, message ## Contributing Feel free to: - Report bugs - Suggest improvements - Submit pull requests ## License This project is under the MIT license.