This Python script analyzes and modifies parameters found in Sector 1, Rows 1, 2, and 3 of MicroEL cards. It provides a user-friendly interface for parsing, displaying, and editing the hexadecimal data stored in these specific card locations.
The MicroEL Card Analyzer and Editor serves to:
- Parse and display the contents of Sector 1, Rows 1, 2, and 3 of MicroEL cards.
- Allow users to modify specific parameters within these rows.
- Provide a clear visualization of the data, including original hex values, inverted hex values, and decimal representations.
- Facilitate easy editing of card parameters in various formats (HEX, HEX INVERTED, DECIMAL).
The script processes a 32-character hexadecimal string, divided into the following parameters:
- Operation number: 4 characters (2 bytes)
- Total input sum: 4 characters (2 bytes)
- Deposit: 2 characters (1 byte)
- Credit: 4 characters (2 bytes)
- Transaction date: 8 characters (4 bytes)
- Points: 4 characters (2 bytes)
- Last transaction amount: 4 characters (2 bytes)
- Checksum: 2 characters (1 byte)
Each character in the hexadecimal string represents 4 bits, so 2 characters make 1 byte (8 bits). Key features include:
- Colorized display of the full hexadecimal string
- Detailed breakdown of each parameter
- Interactive parameter modification
- Support for inputting new values in HEX, HEX INVERTED, or DECIMAL format
- Automatic recalculation and display of modified data
- Run the script: python microel_card_analyzer.py
- Enter the 32-character hexadecimal string when prompted
- View the parsed and colorized data
- Choose to modify a parameter if desired
- Select the parameter to modify
- Choose the format for entering the new value (HEX, HEX INVERTED, or DECIMAL)
- Enter the new value
- View the updated data
- Repeat steps 4-8 as needed, or exit the program
The third row of Sector 1 indicates the row with the previous credit. This information is crucial for understanding the card's transaction history and current balance.
Python 3.6 or higher