mirror of
https://github.com/DarkFlippers/unleashed-firmware
synced 2024-11-26 22:40:25 +00:00
set time between cards to 6, run fbt format
This commit is contained in:
parent
c213ff596a
commit
ca02826cfd
7 changed files with 61 additions and 59 deletions
|
@ -42,10 +42,7 @@ ARRAY_DEF(
|
||||||
#pragma GCC diagnostic push
|
#pragma GCC diagnostic push
|
||||||
#pragma GCC diagnostic ignored "-Wunused-function"
|
#pragma GCC diagnostic ignored "-Wunused-function"
|
||||||
// Using in applications/archive/views/archive_browser_view.c
|
// Using in applications/archive/views/archive_browser_view.c
|
||||||
static void archive_menu_add_item(
|
static void archive_menu_add_item(ArchiveContextMenuItem_t* obj, string_t text, uint32_t event) {
|
||||||
ArchiveContextMenuItem_t* obj,
|
|
||||||
string_t text,
|
|
||||||
uint32_t event) {
|
|
||||||
string_init_move(obj->text, text);
|
string_init_move(obj->text, text);
|
||||||
obj->event = event;
|
obj->event = event;
|
||||||
}
|
}
|
||||||
|
|
|
@ -133,7 +133,7 @@ bool archive_scene_browser_on_event(void* context, SceneManagerEvent event) {
|
||||||
case ArchiveBrowserEventFileMenuRename:
|
case ArchiveBrowserEventFileMenuRename:
|
||||||
if(favorites) {
|
if(favorites) {
|
||||||
browser->callback(ArchiveBrowserEventEnterFavMove, browser->context);
|
browser->callback(ArchiveBrowserEventEnterFavMove, browser->context);
|
||||||
//} else if((archive_is_known_app(selected->type)) && (selected->is_app == false)) {
|
//} else if((archive_is_known_app(selected->type)) && (selected->is_app == false)) {
|
||||||
} else {
|
} else {
|
||||||
// Added ability to rename files and folders
|
// Added ability to rename files and folders
|
||||||
archive_show_file_menu(browser, false);
|
archive_show_file_menu(browser, false);
|
||||||
|
|
|
@ -3,7 +3,10 @@
|
||||||
string_t menu_items[4];
|
string_t menu_items[4];
|
||||||
string_t menu_proto_items[2];
|
string_t menu_proto_items[2];
|
||||||
|
|
||||||
void flipfrid_scene_entrypoint_menu_callback(FlipFridState* context, uint32_t index, uint32_t proto_index) {
|
void flipfrid_scene_entrypoint_menu_callback(
|
||||||
|
FlipFridState* context,
|
||||||
|
uint32_t index,
|
||||||
|
uint32_t proto_index) {
|
||||||
switch(index) {
|
switch(index) {
|
||||||
case FlipFridAttackDefaultValues:
|
case FlipFridAttackDefaultValues:
|
||||||
context->attack = FlipFridAttackDefaultValues;
|
context->attack = FlipFridAttackDefaultValues;
|
||||||
|
@ -111,7 +114,8 @@ void flipfrid_scene_entrypoint_on_event(FlipFridEvent event, FlipFridState* cont
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case InputKeyOk:
|
case InputKeyOk:
|
||||||
flipfrid_scene_entrypoint_menu_callback(context, context->menu_index, context->menu_proto_index);
|
flipfrid_scene_entrypoint_menu_callback(
|
||||||
|
context, context->menu_index, context->menu_proto_index);
|
||||||
break;
|
break;
|
||||||
case InputKeyBack:
|
case InputKeyBack:
|
||||||
context->is_running = false;
|
context->is_running = false;
|
||||||
|
@ -163,16 +167,19 @@ void flipfrid_scene_entrypoint_on_draw(Canvas* canvas, FlipFridState* context) {
|
||||||
}
|
}
|
||||||
|
|
||||||
canvas_set_font(canvas, FontPrimary);
|
canvas_set_font(canvas, FontPrimary);
|
||||||
canvas_draw_str_aligned(
|
canvas_draw_str_aligned(canvas, 34, 4, AlignCenter, AlignTop, "<");
|
||||||
canvas, 34, 4, AlignCenter, AlignTop, "<");
|
|
||||||
|
|
||||||
canvas_set_font(canvas, FontPrimary);
|
canvas_set_font(canvas, FontPrimary);
|
||||||
canvas_draw_str_aligned(
|
canvas_draw_str_aligned(
|
||||||
canvas, 64, 4, AlignCenter, AlignTop, string_get_cstr(menu_proto_items[context->menu_proto_index]));
|
canvas,
|
||||||
|
64,
|
||||||
|
4,
|
||||||
|
AlignCenter,
|
||||||
|
AlignTop,
|
||||||
|
string_get_cstr(menu_proto_items[context->menu_proto_index]));
|
||||||
|
|
||||||
canvas_set_font(canvas, FontPrimary);
|
canvas_set_font(canvas, FontPrimary);
|
||||||
canvas_draw_str_aligned(
|
canvas_draw_str_aligned(canvas, 94, 4, AlignCenter, AlignTop, ">");
|
||||||
canvas, 94, 4, AlignCenter, AlignTop, ">");
|
|
||||||
|
|
||||||
if(context->menu_proto_index < HIDProx) {
|
if(context->menu_proto_index < HIDProx) {
|
||||||
canvas_set_font(canvas, FontSecondary);
|
canvas_set_font(canvas, FontSecondary);
|
||||||
|
|
|
@ -36,7 +36,7 @@ bool flipfrid_load(FlipFridState* context, const char* file_path) {
|
||||||
break;
|
break;
|
||||||
} else {
|
} else {
|
||||||
FURI_LOG_I(TAG, "Key type: %s", string_get_cstr(temp_str));
|
FURI_LOG_I(TAG, "Key type: %s", string_get_cstr(temp_str));
|
||||||
|
|
||||||
if(context->proto == EM4100) {
|
if(context->proto == EM4100) {
|
||||||
if(strcmp(string_get_cstr(temp_str), "EM4100") != 0) {
|
if(strcmp(string_get_cstr(temp_str), "EM4100") != 0) {
|
||||||
FURI_LOG_E(TAG, "Unsupported Key type");
|
FURI_LOG_E(TAG, "Unsupported Key type");
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
#include <gui/elements.h>
|
#include <gui/elements.h>
|
||||||
|
|
||||||
uint8_t counter = 0;
|
uint8_t counter = 0;
|
||||||
#define TIME_BETWEEN_CARDS 5
|
#define TIME_BETWEEN_CARDS 6
|
||||||
uint8_t id_list[17][5] = {
|
uint8_t id_list[17][5] = {
|
||||||
{0x00, 0x00, 0x00, 0x00, 0x00}, // Null bytes
|
{0x00, 0x00, 0x00, 0x00, 0x00}, // Null bytes
|
||||||
{0xFF, 0xFF, 0xFF, 0xFF, 0xFF}, // Only FF
|
{0xFF, 0xFF, 0xFF, 0xFF, 0xFF}, // Only FF
|
||||||
|
@ -68,7 +68,8 @@ void flipfrid_scene_run_attack_on_tick(FlipFridState* context) {
|
||||||
switch(context->attack) {
|
switch(context->attack) {
|
||||||
case FlipFridAttackDefaultValues:
|
case FlipFridAttackDefaultValues:
|
||||||
if(context->proto == EM4100) {
|
if(context->proto == EM4100) {
|
||||||
context->protocol = protocol_dict_get_protocol_by_name(context->dict, "EM4100");
|
context->protocol =
|
||||||
|
protocol_dict_get_protocol_by_name(context->dict, "EM4100");
|
||||||
|
|
||||||
context->payload[0] = id_list[context->attack_step][0];
|
context->payload[0] = id_list[context->attack_step][0];
|
||||||
context->payload[1] = id_list[context->attack_step][1];
|
context->payload[1] = id_list[context->attack_step][1];
|
||||||
|
@ -87,7 +88,8 @@ void flipfrid_scene_run_attack_on_tick(FlipFridState* context) {
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
} else {
|
} else {
|
||||||
context->protocol = protocol_dict_get_protocol_by_name(context->dict, "HIDProx");
|
context->protocol =
|
||||||
|
protocol_dict_get_protocol_by_name(context->dict, "HIDProx");
|
||||||
|
|
||||||
context->payload[0] = id_list_hid[context->attack_step][0];
|
context->payload[0] = id_list_hid[context->attack_step][0];
|
||||||
context->payload[1] = id_list_hid[context->attack_step][1];
|
context->payload[1] = id_list_hid[context->attack_step][1];
|
||||||
|
@ -95,7 +97,7 @@ void flipfrid_scene_run_attack_on_tick(FlipFridState* context) {
|
||||||
context->payload[3] = id_list_hid[context->attack_step][3];
|
context->payload[3] = id_list_hid[context->attack_step][3];
|
||||||
context->payload[4] = id_list_hid[context->attack_step][4];
|
context->payload[4] = id_list_hid[context->attack_step][4];
|
||||||
context->payload[5] = id_list_hid[context->attack_step][5];
|
context->payload[5] = id_list_hid[context->attack_step][5];
|
||||||
|
|
||||||
if(context->attack_step == 15) {
|
if(context->attack_step == 15) {
|
||||||
context->attack_step = 0;
|
context->attack_step = 0;
|
||||||
counter = 0;
|
counter = 0;
|
||||||
|
@ -111,7 +113,8 @@ void flipfrid_scene_run_attack_on_tick(FlipFridState* context) {
|
||||||
|
|
||||||
case FlipFridAttackBfCustomerId:
|
case FlipFridAttackBfCustomerId:
|
||||||
if(context->proto == EM4100) {
|
if(context->proto == EM4100) {
|
||||||
context->protocol = protocol_dict_get_protocol_by_name(context->dict, "EM4100");
|
context->protocol =
|
||||||
|
protocol_dict_get_protocol_by_name(context->dict, "EM4100");
|
||||||
|
|
||||||
context->payload[0] = context->attack_step;
|
context->payload[0] = context->attack_step;
|
||||||
context->payload[1] = 0x00;
|
context->payload[1] = 0x00;
|
||||||
|
@ -130,7 +133,8 @@ void flipfrid_scene_run_attack_on_tick(FlipFridState* context) {
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
} else {
|
} else {
|
||||||
context->protocol = protocol_dict_get_protocol_by_name(context->dict, "HIDProx");
|
context->protocol =
|
||||||
|
protocol_dict_get_protocol_by_name(context->dict, "HIDProx");
|
||||||
|
|
||||||
context->payload[0] = context->attack_step;
|
context->payload[0] = context->attack_step;
|
||||||
context->payload[1] = 0x00;
|
context->payload[1] = 0x00;
|
||||||
|
@ -150,10 +154,11 @@ void flipfrid_scene_run_attack_on_tick(FlipFridState* context) {
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
case FlipFridAttackLoadFile:
|
case FlipFridAttackLoadFile:
|
||||||
if(context->proto == EM4100) {
|
if(context->proto == EM4100) {
|
||||||
context->protocol = protocol_dict_get_protocol_by_name(context->dict, "EM4100");
|
context->protocol =
|
||||||
|
protocol_dict_get_protocol_by_name(context->dict, "EM4100");
|
||||||
|
|
||||||
context->payload[0] = context->data[0];
|
context->payload[0] = context->data[0];
|
||||||
context->payload[1] = context->data[1];
|
context->payload[1] = context->data[1];
|
||||||
|
@ -175,7 +180,8 @@ void flipfrid_scene_run_attack_on_tick(FlipFridState* context) {
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
} else {
|
} else {
|
||||||
context->protocol = protocol_dict_get_protocol_by_name(context->dict, "HIDProx");
|
context->protocol =
|
||||||
|
protocol_dict_get_protocol_by_name(context->dict, "HIDProx");
|
||||||
|
|
||||||
context->payload[0] = context->data[0];
|
context->payload[0] = context->data[0];
|
||||||
context->payload[1] = context->data[1];
|
context->payload[1] = context->data[1];
|
||||||
|
@ -201,7 +207,8 @@ void flipfrid_scene_run_attack_on_tick(FlipFridState* context) {
|
||||||
|
|
||||||
case FlipFridAttackLoadFileCustomUids:
|
case FlipFridAttackLoadFileCustomUids:
|
||||||
if(context->proto == EM4100) {
|
if(context->proto == EM4100) {
|
||||||
context->protocol = protocol_dict_get_protocol_by_name(context->dict, "EM4100");
|
context->protocol =
|
||||||
|
protocol_dict_get_protocol_by_name(context->dict, "EM4100");
|
||||||
|
|
||||||
while(true) {
|
while(true) {
|
||||||
string_reset(context->data_str);
|
string_reset(context->data_str);
|
||||||
|
@ -229,7 +236,8 @@ void flipfrid_scene_run_attack_on_tick(FlipFridState* context) {
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
} else {
|
} else {
|
||||||
context->protocol = protocol_dict_get_protocol_by_name(context->dict, "HIDProx");
|
context->protocol =
|
||||||
|
protocol_dict_get_protocol_by_name(context->dict, "HIDProx");
|
||||||
|
|
||||||
while(true) {
|
while(true) {
|
||||||
string_reset(context->data_str);
|
string_reset(context->data_str);
|
||||||
|
@ -258,7 +266,6 @@ void flipfrid_scene_run_attack_on_tick(FlipFridState* context) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if(counter > TIME_BETWEEN_CARDS) {
|
if(counter > TIME_BETWEEN_CARDS) {
|
||||||
|
@ -316,31 +323,31 @@ void flipfrid_scene_run_attack_on_draw(Canvas* canvas, FlipFridState* context) {
|
||||||
canvas_set_font(canvas, FontPrimary);
|
canvas_set_font(canvas, FontPrimary);
|
||||||
canvas_draw_str_aligned(
|
canvas_draw_str_aligned(
|
||||||
canvas, 64, 8, AlignCenter, AlignTop, string_get_cstr(context->attack_name));
|
canvas, 64, 8, AlignCenter, AlignTop, string_get_cstr(context->attack_name));
|
||||||
|
|
||||||
char uid[18];
|
char uid[18];
|
||||||
if(context->protocol == protocol_dict_get_protocol_by_name(context->dict, "HIDProx")) {
|
if(context->protocol == protocol_dict_get_protocol_by_name(context->dict, "HIDProx")) {
|
||||||
snprintf(
|
snprintf(
|
||||||
uid,
|
uid,
|
||||||
sizeof(uid),
|
sizeof(uid),
|
||||||
"%02X:%02X:%02X:%02X:%02X:%02X",
|
"%02X:%02X:%02X:%02X:%02X:%02X",
|
||||||
context->payload[0],
|
context->payload[0],
|
||||||
context->payload[1],
|
context->payload[1],
|
||||||
context->payload[2],
|
context->payload[2],
|
||||||
context->payload[3],
|
context->payload[3],
|
||||||
context->payload[4],
|
context->payload[4],
|
||||||
context->payload[5]);
|
context->payload[5]);
|
||||||
} else {
|
} else {
|
||||||
snprintf(
|
snprintf(
|
||||||
uid,
|
uid,
|
||||||
sizeof(uid),
|
sizeof(uid),
|
||||||
"%02X:%02X:%02X:%02X:%02X",
|
"%02X:%02X:%02X:%02X:%02X",
|
||||||
context->payload[0],
|
context->payload[0],
|
||||||
context->payload[1],
|
context->payload[1],
|
||||||
context->payload[2],
|
context->payload[2],
|
||||||
context->payload[3],
|
context->payload[3],
|
||||||
context->payload[4]);
|
context->payload[4]);
|
||||||
}
|
}
|
||||||
|
|
||||||
canvas_draw_str_aligned(canvas, 64, 24, AlignCenter, AlignTop, uid);
|
canvas_draw_str_aligned(canvas, 64, 24, AlignCenter, AlignTop, uid);
|
||||||
|
|
||||||
canvas_set_font(canvas, FontSecondary);
|
canvas_set_font(canvas, FontSecondary);
|
||||||
|
|
|
@ -60,19 +60,8 @@ const char* const delay_text[DELAY_COUNT] = {
|
||||||
"10min",
|
"10min",
|
||||||
"30min",
|
"30min",
|
||||||
};
|
};
|
||||||
const uint32_t delay_value[DELAY_COUNT] = {
|
const uint32_t delay_value[DELAY_COUNT] =
|
||||||
1000,
|
{1000, 5000, 10000, 15000, 30000, 60000, 90000, 120000, 300000, 600000, 1800000};
|
||||||
5000,
|
|
||||||
10000,
|
|
||||||
15000,
|
|
||||||
30000,
|
|
||||||
60000,
|
|
||||||
90000,
|
|
||||||
120000,
|
|
||||||
300000,
|
|
||||||
600000,
|
|
||||||
1800000
|
|
||||||
};
|
|
||||||
|
|
||||||
#define VIBRO_COUNT 2
|
#define VIBRO_COUNT 2
|
||||||
const char* const vibro_text[VIBRO_COUNT] = {
|
const char* const vibro_text[VIBRO_COUNT] = {
|
||||||
|
|
|
@ -39,7 +39,8 @@ struct ReaderAnalyzer {
|
||||||
NfcDebugPcap* pcap;
|
NfcDebugPcap* pcap;
|
||||||
};
|
};
|
||||||
|
|
||||||
static FuriHalNfcDevData reader_analyzer_nfc_data[] = { //XXX
|
static FuriHalNfcDevData reader_analyzer_nfc_data[] = {
|
||||||
|
//XXX
|
||||||
[ReaderAnalyzerNfcDataMfClassic] =
|
[ReaderAnalyzerNfcDataMfClassic] =
|
||||||
{.sak = 0x08,
|
{.sak = 0x08,
|
||||||
.atqa = {0x44, 0x00},
|
.atqa = {0x44, 0x00},
|
||||||
|
@ -101,7 +102,8 @@ int32_t reader_analyzer_thread(void* context) {
|
||||||
ReaderAnalyzer* reader_analyzer_alloc() {
|
ReaderAnalyzer* reader_analyzer_alloc() {
|
||||||
ReaderAnalyzer* instance = malloc(sizeof(ReaderAnalyzer));
|
ReaderAnalyzer* instance = malloc(sizeof(ReaderAnalyzer));
|
||||||
reader_analyzer_nfc_data[ReaderAnalyzerNfcDataMfClassic].cuid = rand(); //XXX
|
reader_analyzer_nfc_data[ReaderAnalyzerNfcDataMfClassic].cuid = rand(); //XXX
|
||||||
furi_hal_random_fill_buf((uint8_t*) &reader_analyzer_nfc_data[ReaderAnalyzerNfcDataMfClassic].uid, 7);
|
furi_hal_random_fill_buf(
|
||||||
|
(uint8_t*)&reader_analyzer_nfc_data[ReaderAnalyzerNfcDataMfClassic].uid, 7);
|
||||||
instance->nfc_data = reader_analyzer_nfc_data[ReaderAnalyzerNfcDataMfClassic];
|
instance->nfc_data = reader_analyzer_nfc_data[ReaderAnalyzerNfcDataMfClassic];
|
||||||
instance->alive = false;
|
instance->alive = false;
|
||||||
instance->stream =
|
instance->stream =
|
||||||
|
|
Loading…
Reference in a new issue