nfc-mfultralight: write uiBlocks, as we read
We use a variable, uiBlocks, to determine how many blocks to read/write. Reading is actually done via a hardcoded 0xF value however. Additionally, make uiblocks a const, as we use it as a constant and change the page variable to uint32_t for consistency sake. Signed-off-by: Olliver Schinagl <oliver@schinagl.nl>
This commit is contained in:
parent
4b8871fd8f
commit
ed62b01a0f
1 changed files with 3 additions and 2 deletions
|
@ -60,12 +60,13 @@
|
||||||
|
|
||||||
#define MAX_TARGET_COUNT 16
|
#define MAX_TARGET_COUNT 16
|
||||||
#define MAX_UID_LEN 10
|
#define MAX_UID_LEN 10
|
||||||
|
#define BLOCK_COUNT 0xf
|
||||||
|
|
||||||
static nfc_device *pnd;
|
static nfc_device *pnd;
|
||||||
static nfc_target nt;
|
static nfc_target nt;
|
||||||
static mifare_param mp;
|
static mifare_param mp;
|
||||||
static mifareul_tag mtDump;
|
static mifareul_tag mtDump;
|
||||||
static uint32_t uiBlocks = 0xF;
|
static const uint32_t uiBlocks = BLOCK_COUNT;
|
||||||
|
|
||||||
// special unlock command
|
// special unlock command
|
||||||
uint8_t abtUnlock1[1] = { 0x40 };
|
uint8_t abtUnlock1[1] = { 0x40 };
|
||||||
|
@ -275,7 +276,7 @@ write_card(bool write_otp, bool write_lock, bool write_uid)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
for (int page = uiSkippedPages; page <= 0xF; page++) {
|
for (uint32_t page = uiSkippedPages; page <= ((uiBlocks / 4) * 4); page++) {
|
||||||
if ((page == 0x2) && (!write_lock)) {
|
if ((page == 0x2) && (!write_lock)) {
|
||||||
printf("s");
|
printf("s");
|
||||||
uiSkippedPages++;
|
uiSkippedPages++;
|
||||||
|
|
Loading…
Reference in a new issue