// Work with mifare cards.\r
//-----------------------------------------------------------------------------\r
\r
-#include <string.h>\r
#include "mifareutil.h"\r
+\r
+#include <string.h>\r
+#include <stdbool.h>\r
+\r
#include "proxmark3.h"\r
#include "apps.h"\r
#include "util.h"\r
#include "parity.h"\r
-\r
#include "iso14443crc.h"\r
#include "iso14443a.h"\r
#include "crapto1/crapto1.h"\r
\r
}\r
\r
+uint8_t SectorTrailer(uint8_t blockNo)\r
+{\r
+ if (blockNo < 32*4) {\r
+ return (blockNo | 0x03);\r
+ } else {\r
+ return (blockNo | 0x0f);\r
+ }\r
+}\r
+\r
+bool IsSectorTrailer(uint8_t blockNo)\r
+{\r
+ return (blockNo == SectorTrailer(blockNo));\r
+}\r
\r
// work with emulator memory\r
void emlSetMem(uint8_t *data, int blockNum, int blocksCount) {\r