Discussion Board

Results 1 to 2 of 2
  1. #1
    Registered User
    Join Date
    Apr 2011

    problem with read/write data from mifare4k in 6212

    Hi to all!
    I have some trouble with my 6212. On this phone was used next code:

    	byte[] KeyA = {(byte)0xa0, (byte)0xa1, (byte)0xa2, (byte)0xa3, (byte)0xa4, (byte)0xa5};
    	MFKey.KeyA key = new MFKEY.KeyA(KeyA);
    	byte[] arr = new byte[16];
                for(int i = 0; i < arr.length; i++)
                    arr[i] = 0;
                for (int i =0; i<256 /*all blocks*/;i++)
                    WriteBlock(i,arr,key); /* write arr[] in Block(i) with access by "key" */
    so it set all data in mifare4k to zero successfully (main idea was delete all data).
    But ofcourse I have got a problem now, I can't read or write something there. I use various keys (standard and zero-keys), use KeyA and KeyB for access.. I read access bits, it show that I can read/write data. But it does not help..
    Have you any idea? What should I do for read/write data now? And what I lose sight of?

  2. #2
    Registered User
    Join Date
    Feb 2009
    Hagenberg, Austria

    Re: problem with read/write data from mifare4k in 6212

    Hallo EOZz,

    with this code you have set all blocks of the MIFARE card to 0x00000000000000000000000000000000. This means that for each sector you also set the sector trailer to zero. Thus you set key A, key B and the access bits to zero as well. For key A and key B this would not be too much of a problem as they would then simply be 0x000000000000. But setting the access bits (i.e. bytes 6 to 8) to zero is a big problem.

    The problem is this: Bytes 6 to 9 contain each a non-inverted and an inverted version of each access bit. Thus, if all bits are zero this is certainly an invaild value (as for each access bit that is 0, the inverted version would need to be 1). From the MIFARE documentation:
    Remark: With each memory access the internal logic verifies the format of the access conditions. If it detects a format violation the whole sector is irreversible blocked.
    Therefore, I would expect that your card is irreversibly damaged.


Similar Threads

  1. Can I read/write data in SIM card with S60 5th?
    By brianrxu in forum Symbian Tools & SDKs
    Replies: 4
    Last Post: 2010-01-08, 05:54
  2. read / write data From / to Infrared thru J2ME application
    By huzefap in forum Mobile Java Networking & Messaging & Security
    Replies: 2
    Last Post: 2009-10-13, 13:46
  3. Read and Write raw data from disk
    By mysymbianforum in forum Symbian
    Replies: 2
    Last Post: 2009-05-26, 09:26
  4. read(write) structured data from(to) file
    By malep1 in forum Symbian
    Replies: 3
    Last Post: 2006-02-09, 09:21
  5. write and read a TInt data from the file
    By billqu in forum Symbian
    Replies: 2
    Last Post: 2004-12-27, 15:10

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts