mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2024-09-21 07:46:12 +08:00
bug fix, added 0xFE in the wrong place
This commit is contained in:
parent
8d24e105ea
commit
5280ada054
|
@ -6054,7 +6054,7 @@ int CmdHFMFNDEFWrite(const char *Cmd) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Has raw bytes ndef a terminator block?
|
// Has raw bytes ndef a terminator block?
|
||||||
if (raw[bytes] != 0xFE) {
|
if (raw[bytes - 1] != 0xFE) {
|
||||||
if (fix_msg == false) {
|
if (fix_msg == false) {
|
||||||
PrintAndLogEx(WARNING, "raw NDEF message doesn't have a terminator block, continuing...");
|
PrintAndLogEx(WARNING, "raw NDEF message doesn't have a terminator block, continuing...");
|
||||||
} else {
|
} else {
|
||||||
|
@ -6063,13 +6063,15 @@ int CmdHFMFNDEFWrite(const char *Cmd) {
|
||||||
PrintAndLogEx(WARNING, "no room for terminator block, exiting...");
|
PrintAndLogEx(WARNING, "no room for terminator block, exiting...");
|
||||||
return PM3_EMALLOC;
|
return PM3_EMALLOC;
|
||||||
}
|
}
|
||||||
raw[bytes++] = 0xFE;
|
raw[bytes] = 0xFE;
|
||||||
|
bytes++;
|
||||||
PrintAndLogEx(SUCCESS, "Added terminator block (0xFE)");
|
PrintAndLogEx(SUCCESS, "Added terminator block (0xFE)");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (verbose) {
|
if (verbose) {
|
||||||
PrintAndLogEx(INFO, "raw: %s", sprint_hex(raw, bytes));
|
PrintAndLogEx(INFO, "Num of Bytes... %u", bytes);
|
||||||
|
print_buffer(raw, bytes, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
// read MAD Sector 0, block1,2
|
// read MAD Sector 0, block1,2
|
||||||
|
|
Loading…
Reference in a new issue