2022-08-24 16:14:03 +00:00
|
|
|
#pragma once
|
|
|
|
#include <furi.h>
|
2022-09-01 15:03:18 +00:00
|
|
|
#include <furi_hal.h>
|
|
|
|
#include <input/input.h>
|
|
|
|
#include <gui/gui.h>
|
|
|
|
#include <gui/modules/submenu.h>
|
|
|
|
#include "m-string.h"
|
|
|
|
#include <dialogs/dialogs.h>
|
2022-08-24 16:14:03 +00:00
|
|
|
#include <notification/notification.h>
|
|
|
|
#include <notification/notification_messages.h>
|
2022-09-01 15:03:18 +00:00
|
|
|
#include <toolbox/stream/stream.h>
|
|
|
|
#include <flipper_format/flipper_format_i.h>
|
2022-08-24 16:14:03 +00:00
|
|
|
|
2022-09-04 21:32:58 +00:00
|
|
|
#include <toolbox/stream/stream.h>
|
|
|
|
#include <toolbox/stream/string_stream.h>
|
|
|
|
#include <toolbox/stream/file_stream.h>
|
|
|
|
#include <toolbox/stream/buffered_file_stream.h>
|
|
|
|
|
2022-09-01 15:03:18 +00:00
|
|
|
#include <lib/lfrfid/lfrfid_worker.h>
|
|
|
|
#include <lfrfid/protocols/lfrfid_protocols.h>
|
|
|
|
|
|
|
|
#define TAG "FlipFrid"
|
|
|
|
|
|
|
|
typedef enum {
|
|
|
|
FlipFridAttackDefaultValues,
|
|
|
|
FlipFridAttackBfCustomerId,
|
2022-09-04 21:32:58 +00:00
|
|
|
FlipFridAttackLoadFile,
|
|
|
|
FlipFridAttackLoadFileCustomUids,
|
2022-09-01 15:03:18 +00:00
|
|
|
} FlipFridAttacks;
|
|
|
|
|
|
|
|
typedef enum {
|
|
|
|
NoneScene,
|
|
|
|
SceneEntryPoint,
|
|
|
|
SceneSelectFile,
|
|
|
|
SceneSelectField,
|
2022-09-04 21:32:58 +00:00
|
|
|
SceneAttack,
|
|
|
|
SceneLoadCustomUids,
|
2022-09-01 15:03:18 +00:00
|
|
|
} FlipFridScene;
|
|
|
|
|
|
|
|
typedef enum {
|
|
|
|
EventTypeTick,
|
|
|
|
EventTypeKey,
|
|
|
|
} EventType;
|
|
|
|
|
|
|
|
typedef struct {
|
|
|
|
EventType evt_type;
|
|
|
|
InputKey key;
|
|
|
|
InputType input_type;
|
|
|
|
} FlipFridEvent;
|
|
|
|
|
|
|
|
// STRUCTS
|
|
|
|
typedef struct {
|
|
|
|
bool is_running;
|
|
|
|
bool is_attacking;
|
|
|
|
FlipFridScene current_scene;
|
|
|
|
FlipFridScene previous_scene;
|
|
|
|
NotificationApp* notify;
|
|
|
|
u_int8_t menu_index;
|
|
|
|
|
|
|
|
string_t data_str;
|
|
|
|
uint8_t data[5];
|
|
|
|
uint8_t payload[5];
|
|
|
|
uint8_t attack_step;
|
|
|
|
FlipFridAttacks attack;
|
|
|
|
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;
|
|
|
|
ProtocolDict* dict;
|
2022-09-04 21:32:58 +00:00
|
|
|
ProtocolId protocol;
|
|
|
|
|
|
|
|
// Used for custom dictionnary
|
|
|
|
Stream* uids_stream;
|
2022-09-01 15:03:18 +00:00
|
|
|
} FlipFridState;
|