Carregar ficheiros para "/"
This commit is contained in:
231
README.md
Normal file
231
README.md
Normal file
@ -0,0 +1,231 @@
|
||||
# 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.
|
||||
7
requirements.txt
Normal file
7
requirements.txt
Normal file
@ -0,0 +1,7 @@
|
||||
numpy>=1.24.0
|
||||
struct
|
||||
plotly
|
||||
tkinterweb
|
||||
logging
|
||||
PyQt6>=6.5.0
|
||||
PyQt6-Charts>=6.5.0
|
||||
88
view_parameters.py
Normal file
88
view_parameters.py
Normal file
@ -0,0 +1,88 @@
|
||||
import tkinter as tk
|
||||
from tkinter import ttk
|
||||
|
||||
class ViewParametersDialog:
|
||||
def __init__(self, parent, current_params=None):
|
||||
self.dialog = tk.Toplevel(parent)
|
||||
self.dialog.title("Parâmetros de visualização")
|
||||
self.dialog.geometry("300x400")
|
||||
self.dialog.resizable(False, False)
|
||||
|
||||
# Make it modal
|
||||
self.dialog.transient(parent)
|
||||
self.dialog.grab_set()
|
||||
|
||||
# Use current parameters if provided, otherwise use defaults
|
||||
if current_params is None:
|
||||
current_params = {
|
||||
'first_cell': '0000F0',
|
||||
'offset': 0,
|
||||
'columns': 16,
|
||||
'hex_view': False,
|
||||
'show_diff': True,
|
||||
'value_type': '8bit'
|
||||
}
|
||||
|
||||
# Parameters
|
||||
self.first_cell = tk.StringVar(value=current_params['first_cell'])
|
||||
self.offset = tk.StringVar(value=str(current_params['offset']))
|
||||
self.columns = tk.StringVar(value=str(current_params['columns']))
|
||||
self.hex_view = tk.BooleanVar(value=current_params['hex_view'])
|
||||
self.show_diff = tk.BooleanVar(value=current_params['show_diff'])
|
||||
self.value_type = tk.StringVar(value=current_params['value_type'])
|
||||
|
||||
self.create_widgets()
|
||||
|
||||
def create_widgets(self):
|
||||
# Primeira Célula
|
||||
ttk.Label(self.dialog, text="Primeira Célula").grid(row=0, column=0, sticky='w', padx=5, pady=2)
|
||||
ttk.Entry(self.dialog, textvariable=self.first_cell, width=20).grid(row=1, column=0, sticky='w', padx=5)
|
||||
|
||||
# Offset byte num
|
||||
ttk.Label(self.dialog, text="Offset byte num").grid(row=2, column=0, sticky='w', padx=5, pady=2)
|
||||
ttk.Spinbox(self.dialog, from_=0, to=1000, textvariable=self.offset, width=5).grid(row=3, column=0, sticky='w', padx=5)
|
||||
|
||||
# Número de colunas
|
||||
ttk.Label(self.dialog, text="Número de colunas").grid(row=4, column=0, sticky='w', padx=5, pady=2)
|
||||
column_spin = ttk.Spinbox(self.dialog, from_=1, to=32, textvariable=self.columns, width=5)
|
||||
column_spin.grid(row=5, column=0, sticky='w', padx=5)
|
||||
|
||||
# Checkboxes
|
||||
ttk.Checkbutton(self.dialog, text="Mostrar em hexadecimal", variable=self.hex_view).grid(row=6, column=0, sticky='w', padx=5, pady=5)
|
||||
ttk.Checkbutton(self.dialog, text="Mostrar diferenças", variable=self.show_diff).grid(row=7, column=0, sticky='w', padx=5)
|
||||
|
||||
# Valor Frame
|
||||
value_frame = ttk.LabelFrame(self.dialog, text="Valor")
|
||||
value_frame.grid(row=8, column=0, sticky='nsew', padx=5, pady=5)
|
||||
|
||||
# Valor options
|
||||
ttk.Label(value_frame, text="Valor:").grid(row=0, column=0, sticky='w', padx=5, pady=2)
|
||||
ttk.Radiobutton(value_frame, text="Valor de 8 bit", variable=self.value_type, value="8bit").grid(row=1, column=0, sticky='w', padx=20)
|
||||
ttk.Radiobutton(value_frame, text="Valor de 16 bit", variable=self.value_type, value="16bit").grid(row=2, column=0, sticky='w', padx=20)
|
||||
ttk.Radiobutton(value_frame, text="Valor de 32 bit", variable=self.value_type, value="32bit").grid(row=3, column=0, sticky='w', padx=20)
|
||||
ttk.Radiobutton(value_frame, text="Valor floating point", variable=self.value_type, value="float").grid(row=4, column=0, sticky='w', padx=20)
|
||||
|
||||
# Buttons
|
||||
button_frame = ttk.Frame(self.dialog)
|
||||
button_frame.grid(row=10, column=0, pady=10)
|
||||
|
||||
ttk.Button(button_frame, text="OK", command=self.ok_clicked).pack(side=tk.LEFT, padx=5)
|
||||
ttk.Button(button_frame, text="Cancelar", command=self.dialog.destroy).pack(side=tk.LEFT, padx=5)
|
||||
|
||||
def ok_clicked(self):
|
||||
# Return the parameters
|
||||
self.result = {
|
||||
'first_cell': self.first_cell.get(),
|
||||
'offset': int(self.offset.get()),
|
||||
'columns': int(self.columns.get()),
|
||||
'hex_view': self.hex_view.get(),
|
||||
'show_diff': self.show_diff.get(),
|
||||
'value_type': self.value_type.get()
|
||||
}
|
||||
self.dialog.destroy()
|
||||
|
||||
def show(self):
|
||||
# Center the dialog on parent
|
||||
self.dialog.focus_set()
|
||||
self.dialog.wait_window()
|
||||
return getattr(self, 'result', None)
|
||||
Reference in New Issue
Block a user