MIFARE Classic 1K cannot read or write

  apdu, c++, nfc, rfid

hello i’m working with APDU command for writting and reading a RFID card .while changing the block Number LSB the write operation doesnt’t work . It’s just work with the block 2 only
have any one an idea about it .

        if (nres == SM_SUCCESS)// &&
        //bAPDURes )

        nlenrcv = sizeof(btRcv);
        nlencmd = 0;

        btCmd[nlencmd++] = 0xFF;                // CLA
        btCmd[nlencmd++] = 0xD6;                // INS
        btCmd[nlencmd++] = 0x00;                // P1, Mifare Block Number MSB, 
        btCmd[nlencmd++] = 0x02;                // P2, Mifare Block Number LSB
        btCmd[nlencmd++] = 16;              // Lc, Data Length
        memcpy(btCmd + nlencmd, btWrite, 16);
        nlencmd += 16;

        nres = m_Smart.RFTransmit(DEV_INTERNALRF, nlencmd, btCmd, (DWORD*)&nlenrcv, btRcv); 

    

Source: Windows Questions C++

LEAVE A COMMENT