This commit is contained in:
Philippe Teuwen 2019-05-12 20:38:03 +02:00
commit 4929b16bf9

View file

@ -144,20 +144,19 @@ static uint16_t printHexLine(uint16_t tracepos, uint16_t traceLen, uint8_t *trac
} }
switch (protocol) { switch (protocol) {
case ISO_14443A: case ISO_14443A: {
{
/* https://www.kaiser.cx/pcap-iso14443.html defines a pseudo header: /* https://www.kaiser.cx/pcap-iso14443.html defines a pseudo header:
* version (currently 0x00), event (Rdr: 0xfe, Tag: 0xff), length (2 bytes) * version (currently 0x00), event (Rdr: 0xfe, Tag: 0xff), length (2 bytes)
* to convert to pcap(ng) via text2pcap or to import into Wireshark * to convert to pcap(ng) via text2pcap or to import into Wireshark
* we use format timestamp, newline, offset (0x000000), pseudo header, data * we use format timestamp, newline, offset (0x000000), pseudo header, data
* `text2pcap -t "%S." -l 264 -n <input-text-file> <output-pcapng-file>` * `text2pcap -t "%S." -l 264 -n <input-text-file> <output-pcapng-file>`
*/ */
char line[(data_len *3) + 1]; char line[(data_len * 3) + 1];
char *ptr = &line[0]; char *ptr = &line[0];
for (int j = 0; j < data_len ; j++) { for (int j = 0; j < data_len ; j++) {
ptr += sprintf (ptr, "%02x", frame[j]); ptr += sprintf(ptr, "%02x", frame[j]);
ptr += sprintf (ptr, " "); ptr += sprintf(ptr, " ");
} }
char data_len_str[5]; char data_len_str[5];