From 881d712ccd21b64a16ca1bcc7965c75b65d46924 Mon Sep 17 00:00:00 2001 From: Mykhailo Shevchuk Date: Thu, 17 Oct 2024 19:12:04 +0300 Subject: [PATCH 1/2] Fixed bug with reading pwd locked MFULs --- .../mf_ultralight/mf_ultralight_poller.c | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/lib/nfc/protocols/mf_ultralight/mf_ultralight_poller.c b/lib/nfc/protocols/mf_ultralight/mf_ultralight_poller.c index 0e5ff001162..83875bb8547 100644 --- a/lib/nfc/protocols/mf_ultralight/mf_ultralight_poller.c +++ b/lib/nfc/protocols/mf_ultralight/mf_ultralight_poller.c @@ -505,16 +505,14 @@ static NfcCommand mf_ultralight_poller_handler_read_pages(MfUltralightPoller* in instance->error = mf_ultralight_poller_read_page(instance, start_page, &data); } - const uint8_t read_cnt = instance->data->type == MfUltralightTypeMfulC ? 1 : 4; if(instance->error == MfUltralightErrorNone) { - for(size_t i = 0; i < read_cnt; i++) { - if(start_page + i < instance->pages_total) { - FURI_LOG_D(TAG, "Read page %d success", start_page + i); - instance->data->page[start_page + i] = data.page[i]; - instance->pages_read++; - instance->data->pages_read = instance->pages_read; - } - } + if (start_page < instance->pages_total) { + FURI_LOG_D(TAG, "Read page %d success", start_page); + instance->data->page[start_page] = data.page[0]; + instance->pages_read++; + instance->data->pages_read = instance->pages_read; + } + if(instance->pages_read == instance->pages_total) { instance->state = MfUltralightPollerStateReadCounters; } From cb207c6fbb1fe9d4e80309065729e0e3895a3bbc Mon Sep 17 00:00:00 2001 From: Aleksandr Kutuzov Date: Thu, 31 Oct 2024 19:47:11 +0900 Subject: [PATCH 2/2] Format sources --- .../protocols/mf_ultralight/mf_ultralight_poller.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/lib/nfc/protocols/mf_ultralight/mf_ultralight_poller.c b/lib/nfc/protocols/mf_ultralight/mf_ultralight_poller.c index 83875bb8547..7d51f6c6ee8 100644 --- a/lib/nfc/protocols/mf_ultralight/mf_ultralight_poller.c +++ b/lib/nfc/protocols/mf_ultralight/mf_ultralight_poller.c @@ -506,13 +506,13 @@ static NfcCommand mf_ultralight_poller_handler_read_pages(MfUltralightPoller* in } if(instance->error == MfUltralightErrorNone) { - if (start_page < instance->pages_total) { - FURI_LOG_D(TAG, "Read page %d success", start_page); - instance->data->page[start_page] = data.page[0]; - instance->pages_read++; - instance->data->pages_read = instance->pages_read; - } - + if(start_page < instance->pages_total) { + FURI_LOG_D(TAG, "Read page %d success", start_page); + instance->data->page[start_page] = data.page[0]; + instance->pages_read++; + instance->data->pages_read = instance->pages_read; + } + if(instance->pages_read == instance->pages_total) { instance->state = MfUltralightPollerStateReadCounters; }