Make clang happy and fix several
error: expression which evaluates to zero treated as a null pointer constant of type 'uint8_t *' (aka 'unsigned char *')
[-Werror,-Wnon-literal-null-conversion]
and
cmdhfmfdes.c:732:31: error: suggest braces around initialization of subobject [-Werror,-Wmissing-braces]
FixesRfidResearchGroup/proxmark3#659
Fixed/changed things:
* added info that virtual tag is always MIM1024
* changed reading files to read binary files (as written by 'hf legic dump')
* changed extension for writing files (*.bin and *.eml) to be on par with 'hf legic dump'
* CRC was calculated wrong when data was not padded with 0 for one char hex strings
* readTag (rt) can now be called multiple times without using the wrong filename
* tag length was calculated wrong as segment header length field includes the header itself
* bytes are XORed before writing them to a tag
* default name for file contains now the tag id
This commit adds a standalone mode for Legic Prime.
It reads and simulates a Legic tag.
Tested with MIM1024 tags.
MIM256 and MIM512 should work to. We just read the data and for simulating
we pretend to be a MIM1024 card.
Co-authored-by: Stefanie Hofmann <>
Adding option 'x' to show trace output for 14a in hexdump format.
This output can be imported into Wireshark using the 'Import from Hex Dump' option.
Encapsulation type should be set to 'ISO 14443' and Max Frame Length to 256.
Format defined at https://www.kaiser.cx/pcap-iso14443.html