Fix/improve 'lf cotag demod' auto threshold estimation
and demodulation of COTAG traces with high value spikes and
COTAG traces with very low amplitude values.
em4x05_print_blocks() byte-swaps its buffer in place to display the blocks.
In CmdEM4x05Dump() that call runs before pm3_save_dump(), so the buffer
handed to the saver has been swapped out of the canonical on-disk order and
the saved .bin/.json reloads with every block reversed.
The read loop stores each word as data[addr] = BSWAP_32(word), which is what
the loader in CmdEM4x05View() expects (it reads blocks MSB-first via
bytes_to_num()). The extra in-place swap in the print routine undoes that
right before the save. It also corrupts the auto-generated filename, which is
built from BSWAP_32(data[1]) after the print call. Symmetric words such as
0x00000000 survive the swap, so it's easy to miss.
Give em4x05_print_blocks() a private copy to swap and print, and take the
input as const so it can't mutate the caller's buffer. On-screen output is
unchanged; the dump path now saves the untouched buffer.
Fixes#3403
Replaces the "not implemented yet" stub for ISO14B_STANDARD card type.
Phase A performs a transparent READ BINARY sweep (ISO7816-4 INS=B0 with
15-bit P1/P2 offset), which covers simple memory cards that have an
implicit current EF.
Phase B performs an SFI scan (P1 bit 7 set, bits 4-0 = SFI 1-30), reading
each EF directly without requiring a prior SELECT EF. This avoids SW=6986
("no current EF") returned by ISO7816-4 file-system cards. SFI-form
addressing is limited to 256 bytes per EF per the standard.
Field state is tracked across phases so the WUPB+ATTRIB reconnect cost is
paid only once. Collected data is displayed via a new print_std_blocks()
function (16-byte rows, offset/hex/ASCII columns, dense-output support) and
saved with the PUPI as filename via pm3_save_dump().
If neither phase yields data, actionable hints are printed directing the
user to hf 14b apdu or hf 14b ndefread for application-level access.