Proxmark3 community

Research, development and trades concerning the powerful Proxmark3 device.

Remember; sharing is caring. Bring something back to the community.


"Learn the tools of the trade the hard way." +Fravia

You are not logged in.

Announcement

Time changes and with it the technology
Proxmark3 @ discord

Users of this forum, please be aware that information stored on this site is not private.

#1 2016-11-18 06:12:34

prof_abrasive
Contributor
From: Sydney
Registered: 2016-09-30
Posts: 11

Random write failures with Proxmark

So I've found, as have others, that writing to iClass cards randomly fails in a data-dependent way. It's quite consistent, and depends on the payload, block number, and I suspect also card key/MAC - so there are some things you can't write to some blocks on some cards. Painful.

I did manage to work around this by changing the timing of the 1of4 encoding in the ARM firmware - now I have no problems with any data on any of my test cards. But I have no justification for why this fix works...!

diff --git a/armsrc/iclass.c b/armsrc/iclass.c
index f99d0ec..221220b 100644
--- a/armsrc/iclass.c
+++ b/armsrc/iclass.c
@@ -1473,7 +1473,7 @@ void CodeIClassCommand(const uint8_t * cmd, int len)
     for(j = 0; j < 4; j++) {
       for(k = 0; k < 4; k++) {
                        if(k == (b & 3)) {
-                               ToSend[++ToSendMax] = 0x0f;
+                               ToSend[++ToSendMax] = 0xf0;
                        }
                        else {
                                ToSend[++ToSendMax] = 0x00;

Offline

#2 2016-11-18 21:47:21

marshmellow
Contributor
From: US
Registered: 2013-06-10
Posts: 2,302

Re: Random write failures with Proxmark

i'll take a look as soon as i can.  Thanks

Offline

#3 2016-11-21 23:08:20

marshmellow
Contributor
From: US
Registered: 2013-06-10
Posts: 2,302

Re: Random write failures with Proxmark

at first glance it does certainly appear this improves the write functions.  i need to find more time to dig into this.  Thanks for the suggestion.

Offline

#4 2016-11-22 15:49:02

Go_tus
Contributor
Registered: 2015-06-03
Posts: 81

Re: Random write failures with Proxmark

that's interesting,
you might also try to append crc in bool iClass_WriteBlock_ext(uint8_t blockNo, uint8_t *data)
before send command.

Last edited by Go_tus (2016-11-22 23:32:30)

Offline

#5 2016-11-29 20:56:57

marshmellow
Contributor
From: US
Registered: 2013-06-10
Posts: 2,302

Re: Random write failures with Proxmark

both suggestions are valuable.  i've committed both changes in my fork and iclass write is much more reliable.

Offline

Board footer

Powered by FluxBB