From 367fd6f4c97388039793c08e1f8b96d9bddc1079 Mon Sep 17 00:00:00 2001 From: iceman1001 Date: Wed, 18 Mar 2026 18:51:14 +0700 Subject: [PATCH] documentation --- client/src/cmdhficlass.c | 26 ++++++++++++++++---------- 1 file changed, 16 insertions(+), 10 deletions(-) diff --git a/client/src/cmdhficlass.c b/client/src/cmdhficlass.c index bf77c347b..0d372110d 100644 --- a/client/src/cmdhficlass.c +++ b/client/src/cmdhficlass.c @@ -4183,23 +4183,28 @@ out: switch(b7) { - case TEAR_PERSO_ENABLED: { // stabilize 0xBC with write operation to 0xBE - PrintAndLogEx(SUCCESS, "Detected fuse: "_GREEN_("0x%02X") " stabilizing to: "_YELLOW_("0xBE") NOLF, data_read[7]); + case TEAR_PERSO_ENABLED: { + + // stabilize 0xBC with write operation to 0xBE + PrintAndLogEx(SUCCESS, "Detected fuse: " _GREEN_("0x%02X") " stabilizing to: " _YELLOW_("0xBE") NOLF, data_read[7]); memcpy(data, data_read, PICOPASS_BLOCK_SIZE); data[7] = TEAR_PERSO_STABLE; iclass_write_block(blockno, data, mac, key, use_credit_key, elite, rawkey, use_replay, false, auth, shallow_mod); + + // verify if it was a succesful write res = iclass_read_block_ex(key, blockno, keyType, elite, rawkey, use_replay, verbose, read_auth, shallow_mod, data_verify, false); if (data_verify[7] == TEAR_PERSO_STABLE) { PrintAndLogEx(SUCCESS, " ( %s )", _GREEN_("ok")); - PrintAndLogEx(SUCCESS, "Detected fuse: "_GREEN_("0x%02X") " set non-secure memory: "_YELLOW_("0xAC"), data_read[7]); + PrintAndLogEx(SUCCESS, "Detected fuse: " _GREEN_("0x%02X") " set non-secure memory: " _YELLOW_("0xAC"), data_read[7]); memcpy(data, data_verify, PICOPASS_BLOCK_SIZE); data[7] = TEAR_UNLOCKED; + // set non-secure memory with 0xAC, in this state it will always succeed iclass_write_block(blockno, data, mac, key, use_credit_key, elite, rawkey, use_replay, false, auth, shallow_mod); iclass_read_interesting_data(key, keyType, elite, rawkey, use_replay, verbose, shallow_mod); @@ -4210,24 +4215,25 @@ out: } case TEAR_PERSO_STABLE: - case TEAR_PERSO_STABLE2: { // unlock tag with write operation to 0xAC - PrintAndLogEx(SUCCESS, "Detected fuse: "_GREEN_("0x%02X") " set non-secure memory: "_YELLOW_("0xAC"), data_read[7]); + case TEAR_PERSO_STABLE2: { + + PrintAndLogEx(SUCCESS, "Detected fuse: " _GREEN_("0x%02X") " set non-secure memory: " _YELLOW_("0xAC"), data_read[7]); memcpy(data, data_read, PICOPASS_BLOCK_SIZE); data[7] = TEAR_UNLOCKED; + // set non-secure memory with 0xAC, in this state it will always succeed iclass_write_block(blockno, data, mac, key, use_credit_key, elite, rawkey, use_replay, false, auth, shallow_mod); iclass_read_interesting_data(key, keyType, elite, rawkey, use_replay, verbose, shallow_mod); - break; } - case TEAR_UNLOCKED: { // don't do anything as this is ok - PrintAndLogEx(SUCCESS, "Detected fuse: "_GREEN_("0x%02X")" _non secure memory_ ( %s )", data_read[7], _GREEN_("ok")); + case TEAR_UNLOCKED: { + + // don't do anything as this is ok + PrintAndLogEx(SUCCESS, "Detected fuse: " _GREEN_("0x%02X")" _non secure memory_ ( %s )", data_read[7], _GREEN_("ok")); - // if tag is now UNLOCKED, read block 3 and 4 and print the content iclass_read_interesting_data(key, keyType, elite, rawkey, use_replay, verbose, shallow_mod); - break; } case TEAR_INITAL: {