Added a function to calculate the access bits that go in bytes 6 to 8 on the sector trailer, the result can be used for write_trailer function.
Example:
A card's default access conditions are:
Block 0
Block 1
Block 2
Block 3
C1
0
0
0
0
C2
0
0
0
0
C3
0
0
0
1
access_bits = get_access_bits(c1=(0,0,0,0), c2=(0,0,0,0), c3=(0,0,0,1)) # Named parameters not necessary, just used for demonstration
> (255, 7, 128) #0xFF, 0x07, 0x80
Added a function to calculate the access bits that go in bytes 6 to 8 on the sector trailer, the result can be used for write_trailer function.
Example: A card's default access conditions are:
The formula used can be seen on page 12 on MIFARE card's reference sheet