Class MFRC522Hack

Class Documentation

class MFRC522Hack

Public Functions

inline MFRC522Hack(MFRC522 &device, const bool logErrors, Print *logPrint = nullptr)
bool MIFARE_OpenUidBackdoor(void) const

Performs the “magic sequence” needed to get Chinese UID changeable Mifare cards to allow writing to sector 0, where the card UID is stored.

Note that you do not need to have selected the card through REQA or WUPA, this sequence works immediately when the card is in the reader vicinity. This means you can use this method even on “bricked” cards that your reader does not recognise anymore (see MFRC522Hack::MIFARE_UnbrickUidSector).

Of course with non-bricked devices, you’re free to select them before calling this function.

bool MIFARE_SetUid(const byte *const newUid, const byte uidSize, MFRC522::MIFARE_Key &key, bool withBackdoor) const

Reads entire block 0, including all manufacturer data, and overwrites that block with the new UID, a freshly calculated BCC, and the original manufacturer data.

Notes: The common default KEY A is 0xFFFFFFFFFFFF. Make sure to have selected the card before this function is called.

bool MIFARE_UnbrickUidSector(void) const

Resets entire sector 0 to zeroes, so the card can be read again by readers.