Picopass standard KDF dictionary (#2478)
* Split iclass dictionaries based on KDF * Allow cancelling during key test Co-authored-by: あく <alleteam@gmail.com>
This commit is contained in:
@@ -5,6 +5,7 @@
|
||||
|
||||
#define ICLASS_ELITE_DICT_FLIPPER_NAME APP_DATA_PATH("assets/iclass_elite_dict.txt")
|
||||
#define ICLASS_ELITE_DICT_USER_NAME APP_DATA_PATH("assets/iclass_elite_dict_user.txt")
|
||||
#define ICLASS_STANDARD_DICT_FLIPPER_NAME APP_DATA_PATH("assets/iclass_standard_dict.txt")
|
||||
|
||||
#define TAG "IclassEliteDict"
|
||||
|
||||
@@ -25,6 +26,9 @@ bool iclass_elite_dict_check_presence(IclassEliteDictType dict_type) {
|
||||
(storage_common_stat(storage, ICLASS_ELITE_DICT_FLIPPER_NAME, NULL) == FSE_OK);
|
||||
} else if(dict_type == IclassEliteDictTypeUser) {
|
||||
dict_present = (storage_common_stat(storage, ICLASS_ELITE_DICT_USER_NAME, NULL) == FSE_OK);
|
||||
} else if(dict_type == IclassStandardDictTypeFlipper) {
|
||||
dict_present =
|
||||
(storage_common_stat(storage, ICLASS_STANDARD_DICT_FLIPPER_NAME, NULL) == FSE_OK);
|
||||
}
|
||||
|
||||
furi_record_close(RECORD_STORAGE);
|
||||
@@ -52,6 +56,15 @@ IclassEliteDict* iclass_elite_dict_alloc(IclassEliteDictType dict_type) {
|
||||
buffered_file_stream_close(dict->stream);
|
||||
break;
|
||||
}
|
||||
} else if(dict_type == IclassStandardDictTypeFlipper) {
|
||||
if(!buffered_file_stream_open(
|
||||
dict->stream,
|
||||
ICLASS_STANDARD_DICT_FLIPPER_NAME,
|
||||
FSAM_READ,
|
||||
FSOM_OPEN_EXISTING)) {
|
||||
buffered_file_stream_close(dict->stream);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// Read total amount of keys
|
||||
@@ -148,4 +161,4 @@ bool iclass_elite_dict_add_key(IclassEliteDict* dict, uint8_t* key) {
|
||||
|
||||
furi_string_free(key_str);
|
||||
return key_added;
|
||||
}
|
||||
}
|
||||
|
@@ -9,6 +9,7 @@
|
||||
typedef enum {
|
||||
IclassEliteDictTypeUser,
|
||||
IclassEliteDictTypeFlipper,
|
||||
IclassStandardDictTypeFlipper,
|
||||
} IclassEliteDictType;
|
||||
|
||||
typedef struct IclassEliteDict IclassEliteDict;
|
||||
@@ -25,4 +26,4 @@ bool iclass_elite_dict_get_next_key(IclassEliteDict* dict, uint8_t* key);
|
||||
|
||||
bool iclass_elite_dict_rewind(IclassEliteDict* dict);
|
||||
|
||||
bool iclass_elite_dict_add_key(IclassEliteDict* dict, uint8_t* key);
|
||||
bool iclass_elite_dict_add_key(IclassEliteDict* dict, uint8_t* key);
|
||||
|
Reference in New Issue
Block a user