2022-11-11 15:12:55 +00:00
|
|
|
#pragma once
|
|
|
|
#include <furi.h>
|
|
|
|
#include <furi_hal.h>
|
|
|
|
#include <input/input.h>
|
|
|
|
#include <gui/gui.h>
|
|
|
|
#include <gui/modules/submenu.h>
|
|
|
|
#include <dialogs/dialogs.h>
|
|
|
|
#include <notification/notification.h>
|
|
|
|
#include <notification/notification_messages.h>
|
|
|
|
#include <toolbox/stream/stream.h>
|
|
|
|
#include <flipper_format/flipper_format_i.h>
|
|
|
|
|
|
|
|
#include <toolbox/stream/stream.h>
|
|
|
|
#include <toolbox/stream/string_stream.h>
|
|
|
|
#include <toolbox/stream/file_stream.h>
|
|
|
|
#include <toolbox/stream/buffered_file_stream.h>
|
|
|
|
|
2023-06-02 12:14:32 +00:00
|
|
|
#include <ibtn_fuzzer_icons.h>
|
2022-11-11 15:12:55 +00:00
|
|
|
|
2023-03-20 17:08:02 +00:00
|
|
|
#include <lib/ibutton/ibutton_worker.h>
|
|
|
|
#include <lib/ibutton/ibutton_key.h>
|
2022-11-11 15:12:55 +00:00
|
|
|
|
|
|
|
#define TAG "iBtnFuzzer"
|
|
|
|
|
|
|
|
typedef enum {
|
|
|
|
iBtnFuzzerAttackDefaultValues,
|
|
|
|
iBtnFuzzerAttackLoadFile,
|
|
|
|
iBtnFuzzerAttackLoadFileCustomUids,
|
|
|
|
} iBtnFuzzerAttacks;
|
|
|
|
|
|
|
|
typedef enum {
|
|
|
|
DS1990,
|
|
|
|
Metakom,
|
|
|
|
Cyfral,
|
|
|
|
} iBtnFuzzerProtos;
|
|
|
|
|
|
|
|
typedef enum {
|
|
|
|
NoneScene,
|
|
|
|
SceneEntryPoint,
|
|
|
|
SceneSelectFile,
|
|
|
|
SceneSelectField,
|
|
|
|
SceneAttack,
|
|
|
|
SceneLoadCustomUids,
|
|
|
|
} iBtnFuzzerScene;
|
|
|
|
|
|
|
|
typedef enum {
|
|
|
|
EventTypeTick,
|
|
|
|
EventTypeKey,
|
|
|
|
} EventType;
|
|
|
|
|
|
|
|
typedef struct {
|
|
|
|
EventType evt_type;
|
|
|
|
InputKey key;
|
|
|
|
InputType input_type;
|
|
|
|
} iBtnFuzzerEvent;
|
|
|
|
|
|
|
|
// STRUCTS
|
|
|
|
typedef struct {
|
2023-03-07 21:18:23 +00:00
|
|
|
FuriMutex* mutex;
|
2022-11-11 15:12:55 +00:00
|
|
|
bool is_running;
|
|
|
|
bool is_attacking;
|
|
|
|
iBtnFuzzerScene current_scene;
|
|
|
|
iBtnFuzzerScene previous_scene;
|
|
|
|
NotificationApp* notify;
|
|
|
|
u_int8_t menu_index;
|
|
|
|
u_int8_t menu_proto_index;
|
|
|
|
|
|
|
|
FuriString* data_str;
|
|
|
|
uint8_t data[8];
|
|
|
|
uint8_t payload[8];
|
|
|
|
uint8_t attack_step;
|
|
|
|
iBtnFuzzerAttacks attack;
|
|
|
|
iBtnFuzzerProtos proto;
|
|
|
|
FuriString* attack_name;
|
|
|
|
FuriString* proto_name;
|
2023-04-22 22:57:38 +00:00
|
|
|
FuriString* main_menu_items[3];
|
|
|
|
FuriString* main_menu_proto_items[3];
|
2022-11-11 15:12:55 +00:00
|
|
|
|
|
|
|
DialogsApp* dialogs;
|
|
|
|
FuriString* notification_msg;
|
|
|
|
uint8_t key_index;
|
|
|
|
iButtonWorker* worker;
|
|
|
|
iButtonKey* key;
|
2023-03-03 04:23:48 +00:00
|
|
|
iButtonProtocolId keytype;
|
|
|
|
iButtonProtocols* protocols;
|
2022-11-11 15:12:55 +00:00
|
|
|
bool workr_rund;
|
|
|
|
bool enter_rerun;
|
2022-12-10 01:36:44 +00:00
|
|
|
bool attack_stop_called;
|
2022-11-11 15:12:55 +00:00
|
|
|
|
|
|
|
uint8_t time_between_cards;
|
|
|
|
|
|
|
|
// Used for custom dictionnary
|
|
|
|
Stream* uids_stream;
|
|
|
|
} iBtnFuzzerState;
|