diff --git a/CHANGELOG.md b/CHANGELOG.md index c261fa87f..2ecfdaab0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,7 @@ All notable changes to this project will be documented in this file. This project uses the changelog in accordance with [keepchangelog](http://keepachangelog.com/). Please use this to write notable changes, which is not the same as git commit log... ## [unreleased][unreleased] +- Fixed `lf t55xx detect` - dropped the psk3 candidates, which run the same demodulation as the psk2 one beside them and so can never match a psk3 tag, only fire on demodulation errors (@mfcarroll) - Fixed `lf t55xx detect` - a psk3 tag read back as psk2 with a block 0 one bit out, and a freshly wiped psk2 tag was reported as psk3 on no evidence; the two are now reported as ambiguous where the waveform cannot separate them, and block 0 is narrowed using the subcarrier, the broadcast period and whether password mode is in use (@mfcarroll) - Added doc/md/PM5_Start_Here/Getting_Started_With_PM5.md now exists as a starting point for those who have their PM5 (@innocentbystanderproxmark) - Fixed `tools/ePassport` - the personal number read from the MRZ optional-data field showed a filler character where a space belonged, and a document number longer than nine characters left its overflow there (@pkilar) diff --git a/client/src/cmdlft55xx.c b/client/src/cmdlft55xx.c index 6ae42664e..fc9fbd648 100644 --- a/client/src/cmdlft55xx.c +++ b/client/src/cmdlft55xx.c @@ -1202,7 +1202,9 @@ static void t55xx_psk_coherent(int fitclk, uint8_t clk, t55xx_conf_block_t *test if (n >= 32) { - for (int variant = 0; variant < 4 && *hits == before; variant++) { + // three variants, not four: inverting does not move a stream's + // transitions, so a fourth barely differed from variant 2 + for (int variant = 0; variant < 3 && *hits == before; variant++) { const bool inverted = ((variant & 1) != 0); @@ -1217,7 +1219,7 @@ static void t55xx_psk_coherent(int fitclk, uint8_t clk, t55xx_conf_block_t *test setDemodBuff(work, n, 0); setClockGrid((uint32_t)(got_clk + 0.5), got_phase); - static const uint8_t modes[4] = { DEMOD_PSK1, DEMOD_PSK1, DEMOD_PSK2, DEMOD_PSK3 }; + static const uint8_t modes[3] = { DEMOD_PSK1, DEMOD_PSK1, DEMOD_PSK2 }; int bitRate = 0; if (test(modes[variant], &tests[*hits].offset, &bitRate, clk, &tests[*hits].Q5) == false) { @@ -1776,20 +1778,13 @@ bool t55xxTryDetectModulationEx(uint8_t downlink_mode, bool print_config, uint32 ++hits; } } // inverse waves does not affect this demod - // PSK3 - needs a call to psk1TOpsk2. - if (PSKDemod(0, 0, 6, false) == PM3_SUCCESS) { - psk1TOpsk2(g_DemodBuffer, g_DemodBufferLen); - if (test(DEMOD_PSK3, &tests[hits].offset, &bitRate, clk, &tests[hits].Q5)) { - tests[hits].modulation = DEMOD_PSK3; - tests[hits].psk_carrier = t55xx_observed_psk_carrier(); - tests[hits].bitrate = bitRate; - tests[hits].inverted = false; - tests[hits].block0 = PackBits(tests[hits].offset, 32, g_DemodBuffer); - tests[hits].ST = false; - tests[hits].downlink_mode = downlink_mode; - ++hits; - } - } // inverse waves does not affect this demod + + // no psk3 candidate here on purpose: it would demodulate the same + // as psk2 and only differ in the test() constant, which wants two + // adjacent ones - and this demod recovers rising edges, which are + // never adjacent. psk3 is reached by ruling psk2 out instead, see + // t55xx_psk3_resolve() + //undo trim samples restore_bufferS32(saveState, g_GraphBuffer); g_GridOffset = saveState.offset;