Skip to content

Conversation

@grugnoymeme
Copy link
Contributor

What's new

This update enhances the Microel card parser by adding support for extracting additional data fields from the Mifare Classic 1K card, including:

Basic card information:

UID
ATQA
SAK

Extended data fields:

Vendor ID
Available credit
Last transaction details
Transaction date
Operation number
Operation type
Admission credit
Deposit status (Yes/No)
Points balance
Previous credit amount
Date of previous credit

These additions improve the accuracy and completeness of the parsed data.

Checklist (For Reviewer)

  • PR has description of feature/bug or link to Confluence/Jira task
  • Description contains actions to verify feature/bugfix
  • I've built this code, uploaded it to the device and verified feature/bugfix

Copy link
Member

@hedger hedger left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please use English in code comments and variable names - for ease of further support.
Could you please provide a sample dump file to verify the parser?


#define KEY_LENGTH 6
#define UID_LENGTH 4
// Offset per la conversione dell'anno (5 bit: da 0 a 31, quindi range 2010–2041)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please keep all comments in English

}
} else {
//Key a is the same as sumHex
// KeyA uguale a sumHex
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here and everywhere

MfClassicKey key_default = {0};
memcpy(key_default.data, keyF, sizeof(keyF));

bool __attribute__((unused)) default_auth_works = false;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why do we need that?

}

bool keys_found = false;
uint8_t chiaveA[6], chiaveB[6];
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

keyA, keyB

void trea_calculateKeys(
const uint8_t* uid,
const uint8_t* codiceGestore,
uint8_t* chiaveA,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

keyA, keyB

switch(service_indicator) {
case 0x04:
return "Autolavaggio";
// Altri tipi da aggiungere con nuovi dump:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use English please

@hedger hedger self-assigned this Sep 22, 2025
@hedger hedger added NFC NFC-related New Feature Contains an IMPLEMENTATION of a new feature labels Sep 22, 2025
@hedger
Copy link
Member

hedger commented Sep 24, 2025

Please un-draft when fixed

@hedger hedger marked this pull request as draft September 24, 2025 14:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

New Feature Contains an IMPLEMENTATION of a new feature NFC NFC-related

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants