some fixes for rfid fuzzer

This commit is contained in:
MX
2022-09-05 14:05:43 +03:00
parent 361895c689
commit ca8217b692
6 changed files with 38 additions and 22 deletions
+9 -5
View File
@@ -6,6 +6,8 @@
#include "scene/flipfrid_scene_run_attack.h"
#include "scene/flipfrid_scene_load_custom_uids.h"
#define RFIDFUZZER_APP_FOLDER "/ext/rfidfuzzer"
static void flipfrid_draw_callback(Canvas* const canvas, void* ctx) {
FlipFridState* flipfrid_state = (FlipFridState*)acquire_mutex((ValueMutex*)ctx, 100);
@@ -53,8 +55,6 @@ static void flipfrid_timer_callback(FuriMessageQueue* event_queue) {
FlipFridState* flipfrid_alloc() {
FlipFridState* flipfrid = malloc(sizeof(FlipFridState));
string_init(flipfrid->file_path);
string_init(flipfrid->file_path_tmp);
string_init(flipfrid->notification_msg);
string_init(flipfrid->attack_name);
@@ -91,9 +91,7 @@ void flipfrid_free(FlipFridState* flipfrid) {
furi_record_close(RECORD_DIALOGS);
notification_message(flipfrid->notify, &sequence_blink_stop);
// Path strings
string_clear(flipfrid->file_path);
string_clear(flipfrid->file_path_tmp);
// Strings
string_clear(flipfrid->notification_msg);
string_clear(flipfrid->attack_name);
@@ -124,6 +122,12 @@ int32_t flipfrid_start(void* p) {
return 255;
}
Storage* storage = furi_record_open(RECORD_STORAGE);
if(!storage_simply_mkdir(storage, RFIDFUZZER_APP_FOLDER)) {
FURI_LOG_E(TAG, "Could not create folder %s", RFIDFUZZER_APP_FOLDER);
}
furi_record_close(RECORD_STORAGE);
// Configure view port
FURI_LOG_I(TAG, "Initializing viewport");
ViewPort* view_port = view_port_alloc();
-2
View File
@@ -65,8 +65,6 @@ typedef struct {
string_t attack_name;
DialogsApp* dialogs;
string_t file_path;
string_t file_path_tmp;
string_t notification_msg;
uint8_t key_index;
LFRFIDWorker* worker;
@@ -3,6 +3,7 @@
#include "flipfrid_scene_entrypoint.h"
#define LFRFID_UIDS_EXTENSION ".txt"
#define RFIDFUZZER_APP_PATH_FOLDER "/ext/rfidfuzzer"
bool flipfrid_load_uids(FlipFridState* context, const char* file_path) {
bool result = false;
@@ -20,18 +21,19 @@ bool flipfrid_load_uids(FlipFridState* context, const char* file_path) {
bool flipfrid_load_custom_uids_from_file(FlipFridState* context) {
// Input events and views are managed by file_select
string_t uid_path;
string_init(uid_path);
string_set_str(uid_path, RFIDFUZZER_APP_PATH_FOLDER);
bool res = dialog_file_browser_show(
context->dialogs,
context->file_path,
context->file_path,
LFRFID_UIDS_EXTENSION,
true,
&I_sub1_10px,
true);
context->dialogs, uid_path, uid_path, LFRFID_UIDS_EXTENSION, true, &I_125_10px, false);
if(res) {
res = flipfrid_load_uids(context, string_get_cstr(context->file_path));
res = flipfrid_load_uids(context, string_get_cstr(uid_path));
}
string_clear(uid_path);
return res;
}
@@ -2,6 +2,7 @@
#include "flipfrid_scene_entrypoint.h"
#define LFRFID_APP_EXTENSION ".rfid"
#define LFRFID_APP_PATH_FOLDER "/ext/lfrfid"
bool flipfrid_load(FlipFridState* context, const char* file_path) {
bool result = false;
@@ -121,24 +122,25 @@ void flipfrid_scene_load_file_on_draw(Canvas* canvas, FlipFridState* context) {
}
bool flipfrid_load_protocol_from_file(FlipFridState* context) {
string_t file_path;
string_init(file_path);
string_t user_file_path;
string_init(user_file_path);
string_set_str(user_file_path, LFRFID_APP_PATH_FOLDER);
// Input events and views are managed by file_select
bool res = dialog_file_browser_show(
context->dialogs,
context->file_path,
context->file_path,
user_file_path,
user_file_path,
LFRFID_APP_EXTENSION,
true,
&I_125_10px,
true);
if(res) {
res = flipfrid_load(context, string_get_cstr(context->file_path));
res = flipfrid_load(context, string_get_cstr(user_file_path));
}
string_clear(file_path);
string_clear(user_file_path);
return res;
}
+3 -1
View File
@@ -1,10 +1,11 @@
V:0
T:1661895856
T:1662375286
D:badusb
D:dolphin
D:infrared
D:music_player
D:nfc
D:rfidfuzzer
D:subghz
D:u2f
D:unirf
@@ -252,6 +253,7 @@ F:81dc04c7b181f94b644079a71476dff4:4742:nfc/assets/aid.nfc
F:86efbebdf41bb6bf15cc51ef88f069d5:2565:nfc/assets/country_code.nfc
F:41b4f08774249014cb8d3dffa5f5c07d:1757:nfc/assets/currency_code.nfc
F:5f57e2ecfc850efb74c7d2677eb75a2e:51832:nfc/assets/mf_classic_dict.nfc
F:319958d37b2316a2e752ebb856c32524:126:rfidfuzzer/example_uids.txt
D:subghz/assets
F:dda1ef895b8a25fde57c874feaaef997:650:subghz/assets/came_atomo
F:50cf77ba8b935ee6cb3b6f111cf2d93d:286:subghz/assets/dangerous_settings
@@ -0,0 +1,8 @@
# Example file, P.S. keep empty line at the end!
0000000000
FE00000000
CAFE000000
00CAFE0000
0000CAFE00
000000CAFE
00000000CA