Skip to content

Commit 8cb09e7

Browse files
authored
Picopass: detect config card (#87)
1 parent 6b0379d commit 8cb09e7

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

picopass/scenes/picopass_scene_read_card_success.c

+5-3
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,8 @@ void picopass_scene_read_card_success_on_enter(void* context) {
4343
AA1[PICOPASS_ICLASS_PACS_CFG_BLOCK_INDEX].data, 0x00, PICOPASS_BLOCK_LEN);
4444
bool empty = picopass_is_memset(
4545
AA1[PICOPASS_ICLASS_PACS_CFG_BLOCK_INDEX].data, 0xFF, PICOPASS_BLOCK_LEN);
46-
bool sio = 0x30 == AA1[PICOPASS_ICLASS_PACS_CFG_BLOCK_INDEX].data[0];
46+
bool SE = 0x30 == AA1[PICOPASS_ICLASS_PACS_CFG_BLOCK_INDEX].data[0];
47+
bool configCard = (AA1[PICOPASS_ICLASS_PACS_CFG_BLOCK_INDEX].data[7] >> 2 & 3) == 2;
4748

4849
if(no_key) {
4950
furi_string_cat_printf(wiegand_str, "Read Failed");
@@ -68,7 +69,8 @@ void picopass_scene_read_card_success_on_enter(void* context) {
6869
"More",
6970
picopass_scene_read_card_success_widget_callback,
7071
picopass);
71-
72+
} else if(configCard) {
73+
furi_string_cat_printf(wiegand_str, "Config Card");
7274
} else if(empty) {
7375
furi_string_cat_printf(wiegand_str, "Empty");
7476
widget_add_button_element(
@@ -79,7 +81,7 @@ void picopass_scene_read_card_success_on_enter(void* context) {
7981
picopass);
8082
} else if(pacs->bitLength == 0 || pacs->bitLength == 255) {
8183
// Neither of these are valid. Indicates the block was all 0x00 or all 0xff
82-
if(sio) {
84+
if(SE) {
8385
furi_string_cat_printf(wiegand_str, "SIO");
8486
} else {
8587
furi_string_cat_printf(wiegand_str, "Invalid PACS");

0 commit comments

Comments
 (0)