if (transferToEml) {\r
uint8_t sectortrailer;\r
if (trgBlockNo < 32*4) { // 4 block sector\r
- sectortrailer = (trgBlockNo & 0x03) + 3;\r
+ sectortrailer = (trgBlockNo & ~0x03) + 3;\r
} else { // 16 block sector\r
- sectortrailer = (trgBlockNo & 0x0f) + 15;\r
+ sectortrailer = (trgBlockNo & ~0x0f) + 15;\r
}\r
mfEmlGetMem(keyBlock, sectortrailer, 1);\r
\r
}\r
\r
// 1 - blocks count\r
- UsbCommand c = {CMD_MIFARE_EML_MEMSET, {blockNo, 1, 0}};\r
- memcpy(c.d.asBytes, memBlock, 16);\r
- SendCommand(&c);\r
- return 0;\r
+ return mfEmlSetMem(memBlock, blockNo, 1);\r
}\r
\r
\r