]>
git.zerfleddert.de Git - proxmark3-svn/blob - common/protocols.c
bdaff3f148703a09bbe7ab286247cb5cc53858fb
10 uint8_t block_writelock
;
20 picopass_conf_block conf
;
24 uint8_t app_issuer_area
[8];
28 #define FUSE_FPERS 0x80
29 #define FUSE_CODING1 0x40
30 #define FUSE_CODING0 0x20
31 #define FUSE_CRYPT1 0x10
32 #define FUSE_CRYPT0 0x08
33 #define FUSE_FPROD1 0x04
34 #define FUSE_FPROD0 0x02
38 void prnt(char *fmt
,...)
41 va_start(argptr
, fmt
);
43 printf(" "); // cleaning prompt
48 uint8_t isset(uint8_t val
, uint8_t mask
)
53 uint8_t notset(uint8_t val
, uint8_t mask
){
57 void fuse_config(const picopass_hdr
*hdr
)
59 uint8_t fuses
= hdr
->conf
.fuses
;
61 if (isset(fuses
,FUSE_FPERS
))prnt(" Mode: Personalization [Programmable]");
62 else prnt(" Mode: Application [Locked]");
64 if (isset(fuses
, FUSE_CODING1
))
68 if( isset( fuses
, FUSE_CODING0
)) prnt(" Coding: ISO 14443-2 B/ISO 15693");
69 else prnt(" Coding: ISO 14443B only");
71 if( isset (fuses
,FUSE_CRYPT1
| FUSE_CRYPT0
)) prnt(" Crypt: Secured page, keys not locked");
72 if( isset (fuses
,FUSE_CRYPT1
) && notset( fuses
, FUSE_CRYPT0
)) prnt(" Crypt: Secured page, keys not locked");
73 if( notset (fuses
,FUSE_CRYPT1
) && isset( fuses
, FUSE_CRYPT0
)) prnt(" Crypt: Non secured page");
74 if( notset (fuses
,FUSE_CRYPT1
) && notset( fuses
, FUSE_CRYPT0
)) prnt(" Crypt: No auth possible. Read only if RA is enabled");
76 if( isset( fuses
, FUSE_RA
)) prnt(" RA: Read access enabled");
77 else prnt(" RA: Read access not enabled");
79 void mem_config(const picopass_hdr
*hdr
)
81 uint8_t mem
= hdr
->conf
.mem_config
;
82 if( isset (mem
, 0x80)) prnt(" Mem: 16KBits (255 * 8 bytes)");
83 else prnt(" Mem: 2 KBits ( 32 * 8 bytes)");
86 void applimit_config(const picopass_hdr
*hdr
)
88 uint8_t applimit
= hdr
->conf
.app_limit
;
89 prnt(" AA1: blocks 6-%d", applimit
);
90 prnt(" AA2: blocks %d-", (applimit
+1));
92 void print_picopass_info(const picopass_hdr
*hdr
)
100 picopass_hdr hdr
= {0x27,0xaf,0x48,0x01,0xf9,0xff,0x12,0xe0,0x12,0xff,0xff,0xff,0x7f,0x1f,0xff,0x3c};
101 prnt("Picopass configuration:");
102 print_picopass_info(&hdr
);
104 int main(int argc
, char *argv
[])