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>
|
2022-09-14 22:14:55 +00:00
|
|
|
#include <m-string.h>
|
2022-09-01 15:03:18 +00:00
|
|
|
#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;
|
|
|
|
|
2022-09-20 18:45:16 +00:00
|
|
|
typedef enum {
|
|
|
|
EM4100,
|
|
|
|
HIDProx,
|
2022-10-03 23:30:36 +00:00
|
|
|
PAC,
|
2022-10-04 00:15:28 +00:00
|
|
|
H10301,
|
2022-09-20 18:45:16 +00:00
|
|
|
} FlipFridProtos;
|
|
|
|
|
2022-09-01 15:03:18 +00:00
|
|
|
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;
|
2022-09-20 18:45:16 +00:00
|
|
|
u_int8_t menu_proto_index;
|
2022-09-01 15:03:18 +00:00
|
|
|
|
|
|
|
string_t data_str;
|
2022-09-20 18:45:16 +00:00
|
|
|
uint8_t data[6];
|
|
|
|
uint8_t payload[6];
|
2022-09-01 15:03:18 +00:00
|
|
|
uint8_t attack_step;
|
|
|
|
FlipFridAttacks attack;
|
2022-09-20 18:45:16 +00:00
|
|
|
FlipFridProtos proto;
|
2022-09-01 15:03:18 +00:00
|
|
|
string_t attack_name;
|
2022-09-20 18:45:16 +00:00
|
|
|
string_t proto_name;
|
2022-09-01 15:03:18 +00:00
|
|
|
|
|
|
|
DialogsApp* dialogs;
|
|
|
|
string_t notification_msg;
|
|
|
|
uint8_t key_index;
|
|
|
|
LFRFIDWorker* worker;
|
|
|
|
ProtocolDict* dict;
|
2022-09-04 21:32:58 +00:00
|
|
|
ProtocolId protocol;
|
|
|
|
|
2022-10-04 20:43:15 +00:00
|
|
|
uint8_t time_between_cards;
|
|
|
|
|
2022-09-04 21:32:58 +00:00
|
|
|
// Used for custom dictionnary
|
|
|
|
Stream* uids_stream;
|
2022-09-01 15:03:18 +00:00
|
|
|
} FlipFridState;
|