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

94 lines
2.0 KiB
C
Raw Normal View History

2022-08-24 19:14:03 +03:00
#pragma once
#include <furi.h>
2022-09-01 18:03:18 +03: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 19:14:03 +03:00
#include <notification/notification.h>
#include <notification/notification_messages.h>
2022-09-01 18:03:18 +03:00
#include <toolbox/stream/stream.h>
#include <flipper_format/flipper_format_i.h>
2022-08-24 19:14:03 +03:00
2022-09-05 00:32:58 +03: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 18:32:52 +03:00
#include <RFID_Fuzzer_icons.h>
2022-09-01 18:03:18 +03:00
#include <lib/lfrfid/lfrfid_worker.h>
#include <lfrfid/protocols/lfrfid_protocols.h>
#define TAG "FlipFrid"
typedef enum {
FlipFridAttackDefaultValues,
FlipFridAttackBfCustomerId,
2022-09-05 00:32:58 +03:00
FlipFridAttackLoadFile,
FlipFridAttackLoadFileCustomUids,
2022-09-01 18:03:18 +03:00
} FlipFridAttacks;
typedef enum {
EM4100,
HIDProx,
PAC,
H10301,
} FlipFridProtos;
2022-09-01 18:03:18 +03:00
typedef enum {
NoneScene,
SceneEntryPoint,
SceneSelectFile,
SceneSelectField,
2022-09-05 00:32:58 +03:00
SceneAttack,
SceneLoadCustomUids,
2022-09-01 18:03:18 +03: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 18:03:18 +03: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 18:03:18 +03:00
2022-10-05 21:27:13 +03:00
FuriString* data_str;
uint8_t data[6];
uint8_t payload[6];
2022-09-01 18:03:18 +03:00
uint8_t attack_step;
FlipFridAttacks attack;
FlipFridProtos proto;
2022-10-05 21:27:13 +03:00
FuriString* attack_name;
FuriString* proto_name;
FuriString* main_menu_items[4];
FuriString* main_menu_proto_items[4];
2022-09-01 18:03:18 +03:00
DialogsApp* dialogs;
2022-10-05 21:27:13 +03:00
FuriString* notification_msg;
2022-09-01 18:03:18 +03:00
uint8_t key_index;
LFRFIDWorker* worker;
ProtocolDict* dict;
2022-09-05 00:32:58 +03:00
ProtocolId protocol;
2022-11-13 02:56:32 +03:00
bool workr_rund;
bool attack_stop_called;
2022-09-05 00:32:58 +03:00
uint8_t time_between_cards;
2022-09-05 00:32:58 +03:00
// Used for custom dictionnary
Stream* uids_stream;
2022-09-01 18:03:18 +03:00
} FlipFridState;