set time between cards to 6, run fbt format

This commit is contained in:
MX 2022-09-20 23:24:34 +03:00
parent c213ff596a
commit ca02826cfd
No known key found for this signature in database
GPG key ID: 6C4C311DFD4B4AB5
7 changed files with 61 additions and 59 deletions

View file

@ -42,10 +42,7 @@ ARRAY_DEF(
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wunused-function"
// Using in applications/archive/views/archive_browser_view.c
static void archive_menu_add_item(
ArchiveContextMenuItem_t* obj,
string_t text,
uint32_t event) {
static void archive_menu_add_item(ArchiveContextMenuItem_t* obj, string_t text, uint32_t event) {
string_init_move(obj->text, text);
obj->event = event;
}

View file

@ -133,7 +133,7 @@ bool archive_scene_browser_on_event(void* context, SceneManagerEvent event) {
case ArchiveBrowserEventFileMenuRename:
if(favorites) {
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 {
// Added ability to rename files and folders
archive_show_file_menu(browser, false);

View file

@ -3,7 +3,10 @@
string_t menu_items[4];
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) {
case FlipFridAttackDefaultValues:
context->attack = FlipFridAttackDefaultValues;
@ -111,7 +114,8 @@ void flipfrid_scene_entrypoint_on_event(FlipFridEvent event, FlipFridState* cont
}
break;
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;
case InputKeyBack:
context->is_running = false;
@ -163,16 +167,19 @@ void flipfrid_scene_entrypoint_on_draw(Canvas* canvas, FlipFridState* context) {
}
canvas_set_font(canvas, FontPrimary);
canvas_draw_str_aligned(
canvas, 34, 4, AlignCenter, AlignTop, "<");
canvas_draw_str_aligned(canvas, 34, 4, AlignCenter, AlignTop, "<");
canvas_set_font(canvas, FontPrimary);
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_draw_str_aligned(
canvas, 94, 4, AlignCenter, AlignTop, ">");
canvas_draw_str_aligned(canvas, 94, 4, AlignCenter, AlignTop, ">");
if(context->menu_proto_index < HIDProx) {
canvas_set_font(canvas, FontSecondary);

View file

@ -36,7 +36,7 @@ bool flipfrid_load(FlipFridState* context, const char* file_path) {
break;
} else {
FURI_LOG_I(TAG, "Key type: %s", string_get_cstr(temp_str));
if(context->proto == EM4100) {
if(strcmp(string_get_cstr(temp_str), "EM4100") != 0) {
FURI_LOG_E(TAG, "Unsupported Key type");

View file

@ -2,7 +2,7 @@
#include <gui/elements.h>
uint8_t counter = 0;
#define TIME_BETWEEN_CARDS 5
#define TIME_BETWEEN_CARDS 6
uint8_t id_list[17][5] = {
{0x00, 0x00, 0x00, 0x00, 0x00}, // Null bytes
{0xFF, 0xFF, 0xFF, 0xFF, 0xFF}, // Only FF
@ -68,7 +68,8 @@ void flipfrid_scene_run_attack_on_tick(FlipFridState* context) {
switch(context->attack) {
case FlipFridAttackDefaultValues:
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[1] = id_list[context->attack_step][1];
@ -87,7 +88,8 @@ void flipfrid_scene_run_attack_on_tick(FlipFridState* context) {
}
break;
} 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[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[4] = id_list_hid[context->attack_step][4];
context->payload[5] = id_list_hid[context->attack_step][5];
if(context->attack_step == 15) {
context->attack_step = 0;
counter = 0;
@ -111,7 +113,8 @@ void flipfrid_scene_run_attack_on_tick(FlipFridState* context) {
case FlipFridAttackBfCustomerId:
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[1] = 0x00;
@ -130,7 +133,8 @@ void flipfrid_scene_run_attack_on_tick(FlipFridState* context) {
}
break;
} 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[1] = 0x00;
@ -150,10 +154,11 @@ void flipfrid_scene_run_attack_on_tick(FlipFridState* context) {
}
break;
}
case FlipFridAttackLoadFile:
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[1] = context->data[1];
@ -175,7 +180,8 @@ void flipfrid_scene_run_attack_on_tick(FlipFridState* context) {
}
break;
} 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[1] = context->data[1];
@ -201,7 +207,8 @@ void flipfrid_scene_run_attack_on_tick(FlipFridState* context) {
case FlipFridAttackLoadFileCustomUids:
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) {
string_reset(context->data_str);
@ -229,7 +236,8 @@ void flipfrid_scene_run_attack_on_tick(FlipFridState* context) {
}
break;
} 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) {
string_reset(context->data_str);
@ -258,7 +266,6 @@ void flipfrid_scene_run_attack_on_tick(FlipFridState* context) {
break;
}
}
}
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_draw_str_aligned(
canvas, 64, 8, AlignCenter, AlignTop, string_get_cstr(context->attack_name));
char uid[18];
if(context->protocol == protocol_dict_get_protocol_by_name(context->dict, "HIDProx")) {
snprintf(
uid,
sizeof(uid),
"%02X:%02X:%02X:%02X:%02X:%02X",
context->payload[0],
context->payload[1],
context->payload[2],
context->payload[3],
context->payload[4],
context->payload[5]);
uid,
sizeof(uid),
"%02X:%02X:%02X:%02X:%02X:%02X",
context->payload[0],
context->payload[1],
context->payload[2],
context->payload[3],
context->payload[4],
context->payload[5]);
} else {
snprintf(
uid,
sizeof(uid),
"%02X:%02X:%02X:%02X:%02X",
context->payload[0],
context->payload[1],
context->payload[2],
context->payload[3],
context->payload[4]);
uid,
sizeof(uid),
"%02X:%02X:%02X:%02X:%02X",
context->payload[0],
context->payload[1],
context->payload[2],
context->payload[3],
context->payload[4]);
}
canvas_draw_str_aligned(canvas, 64, 24, AlignCenter, AlignTop, uid);
canvas_set_font(canvas, FontSecondary);

View file

@ -60,19 +60,8 @@ const char* const delay_text[DELAY_COUNT] = {
"10min",
"30min",
};
const uint32_t delay_value[DELAY_COUNT] = {
1000,
5000,
10000,
15000,
30000,
60000,
90000,
120000,
300000,
600000,
1800000
};
const uint32_t delay_value[DELAY_COUNT] =
{1000, 5000, 10000, 15000, 30000, 60000, 90000, 120000, 300000, 600000, 1800000};
#define VIBRO_COUNT 2
const char* const vibro_text[VIBRO_COUNT] = {

View file

@ -39,7 +39,8 @@ struct ReaderAnalyzer {
NfcDebugPcap* pcap;
};
static FuriHalNfcDevData reader_analyzer_nfc_data[] = { //XXX
static FuriHalNfcDevData reader_analyzer_nfc_data[] = {
//XXX
[ReaderAnalyzerNfcDataMfClassic] =
{.sak = 0x08,
.atqa = {0x44, 0x00},
@ -101,7 +102,8 @@ int32_t reader_analyzer_thread(void* context) {
ReaderAnalyzer* reader_analyzer_alloc() {
ReaderAnalyzer* instance = malloc(sizeof(ReaderAnalyzer));
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->alive = false;
instance->stream =