Skip to content

Commit

Permalink
NFC Magic: Incorrect total blocks usage fix from (#102)[flipperdevice…
Browse files Browse the repository at this point in the history
  • Loading branch information
Leptopt1los committed Jan 2, 2024
1 parent cc246d5 commit 77d8de9
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 7 deletions.
8 changes: 2 additions & 6 deletions base_pack/nfc_magic/lib/magic/protocols/gen4/gen4_poller.c
Original file line number Diff line number Diff line change
@@ -1,14 +1,10 @@
#include "core/check.h"
#include "core/log.h"
#include "gen4_poller_i.h"
#include "protocols/gen4/gen4_poller.h"
#include <nfc/protocols/iso14443_3a/iso14443_3a.h>
#include <nfc/protocols/iso14443_3a/iso14443_3a_poller.h>
#include <nfc/helpers/nfc_util.h>
#include <nfc/nfc_poller.h>

#include <furi/furi.h>

#define GEN4_POLLER_THREAD_FLAG_DETECTED (1U << 0)

typedef NfcCommand (*Gen4PollerStateHandler)(Gen4Poller* instance);
Expand Down Expand Up @@ -280,7 +276,7 @@ static NfcCommand gen4_poller_write_mf_classic(Gen4Poller* instance) {
instance->config[25] = iso3_data->atqa[1];
instance->config[26] = iso3_data->sak;
instance->config[27] = 0x00;
instance->config[28] = instance->total_blocks;
instance->config[28] = instance->total_blocks - 1;
instance->config[29] = Gen4PollerDirectWriteBlock0ModeDisabled;

Gen4PollerError error = gen4_poller_set_config(
Expand Down Expand Up @@ -359,7 +355,7 @@ static NfcCommand gen4_poller_write_mf_ultralight(Gen4Poller* instance) {
instance->config[25] = iso3_data->atqa[1];
instance->config[26] = iso3_data->sak;
instance->config[27] = 0x00;
instance->config[28] = instance->total_blocks;
instance->config[28] = instance->total_blocks - 1;
instance->config[29] = Gen4PollerDirectWriteBlock0ModeDisabled;

Gen4PollerError error = gen4_poller_set_config(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
#include "gen4_poller.h"
#include <nfc/nfc_poller.h>
#include <nfc/protocols/iso14443_3a/iso14443_3a_poller.h>
#include <stdint.h>

#define TAG "Gen4Poller"

Expand Down

0 comments on commit 77d8de9

Please sign in to comment.