unleashed-firmware/applications/external/flipfrid/flipfrid.h

92 lines
1.9 KiB
C
Raw Normal View History

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 <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-10-28 15:32:52 +00:00
#include <RFID_Fuzzer_icons.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 {
EM4100,
HIDProx,
PAC,
H10301,
} 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 {
FuriMutex* mutex;
2022-09-01 15:03:18 +00:00
bool is_running;
bool is_attacking;
FlipFridScene current_scene;
FlipFridScene previous_scene;
NotificationApp* notify;
u_int8_t menu_index;
u_int8_t menu_proto_index;
2022-09-01 15:03:18 +00:00
2022-10-05 18:27:13 +00:00
FuriString* data_str;
uint8_t data[6];
uint8_t payload[6];
2022-09-01 15:03:18 +00:00
uint8_t attack_step;
FlipFridAttacks attack;
FlipFridProtos proto;
2022-10-05 18:27:13 +00:00
FuriString* attack_name;
FuriString* proto_name;
2022-09-01 15:03:18 +00:00
DialogsApp* dialogs;
2022-10-05 18:27:13 +00:00
FuriString* notification_msg;
2022-09-01 15:03:18 +00:00
uint8_t key_index;
LFRFIDWorker* worker;
ProtocolDict* dict;
2022-09-04 21:32:58 +00:00
ProtocolId protocol;
2022-11-12 23:56:32 +00:00
bool workr_rund;
bool attack_stop_called;
2022-09-04 21:32:58 +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;