Skip to content

Conversation

@Leptopt1los
Copy link
Contributor

@Leptopt1los Leptopt1los commented Jan 10, 2024

Issue

At the moment, when performing a dictionary attack on MF Classic, when you try to skip the user dictionary, the system dictionary is also skipped after it. This bug is not reproduced if you attach the card to the flipper after reading has started, or if you remove it and reapply it while reading with a user dictionary.

The bug is due to the fact that when an NfcCustomEventDictAttackSkip event occurs with the DictAttackStateUserDictInProgress state, instance->nfc_dict_context.is_card_present is false (see line 226 on nfc_scene_mf_classic_dict_attack.c)

##Issue verification:

  • Create manually MF Classic 1k 4byte UID dump
  • Write it to magic card
  • Try to read it
  • Skip user dict

System dict will also be skipped

What's new

The issue described above is fixed

Verification

Same as issue verification. After user dict skipping, system dict attack must be started

Checklist (For Reviewer)

  • PR has description of feature/bug or link to Confluence/Jira task
  • Description contains actions to verify feature/bugfix
  • I've built this code, uploaded it to the device and verified feature/bugfix

@gornekich gornekich self-assigned this Jan 10, 2024
@hedger hedger added NFC NFC-related Bug labels Jan 10, 2024
@gornekich
Copy link
Member

Hello @Leptopt1los
Thanks for PR. I reproduced the bug but the problem is in different place. instance->nfc_dict_context.is_card_present variable should be updated on MFC poller event, but event is not emitted because of incorrect MFC poller state initialization.

Please, consider attached patch. If it works fine for you, please apply this patch to this PR and we will merge it.
mfc_poller_fix_patch.txt
Applying patch: git apply <path_to_patch_file>

Copy link
Member

@gornekich gornekich left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not completely correct fix

@Leptopt1los Leptopt1los requested a review from gornekich January 11, 2024 15:34
Copy link
Member

@gornekich gornekich left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks

@skotopes skotopes merged commit d289545 into flipperdevices:dev Jan 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Bug NFC NFC-related

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants