fix unirf crash, fix keeloq seed display, fix flipfrid

and add new unirf icon(animated) by Svarich
This commit is contained in:
MX
2022-08-25 03:21:44 +03:00
parent b31e4a36a8
commit f9d3d6bf5c
14 changed files with 94 additions and 65 deletions

View File

@@ -1,11 +1,10 @@
App( App(
appid="flipfrid", appid="flipfrid",
name="Rfid fuzzer", name="RFID Fuzzer",
apptype=FlipperAppType.PLUGIN, apptype=FlipperAppType.PLUGIN,
entry_point="flipfrid_start", entry_point="flipfrid_start",
cdefines=["APP_FLIP_FRID"], cdefines=["APP_FLIP_FRID"],
requires=["gui"], requires=["gui"],
stack_size=1 * 1024, stack_size=1 * 1024,
icon="A_125khz_14", order=29,
order=185,
) )

View File

@@ -9,7 +9,7 @@
#include "flipfrid.h" #include "flipfrid.h"
#define NUMBER_OF_ATTACKS 4 #define NUMBER_OF_ATTACKS 3
#define TIME_BETWEEN_CARDS \ #define TIME_BETWEEN_CARDS \
5 // Emulate 2 cards per second : (5 * (configTICK_RATE_HZ_RAW/10)) == (5*(1000/10)) == (5*100) == (500)ms 5 // Emulate 2 cards per second : (5 * (configTICK_RATE_HZ_RAW/10)) == (5*(1000/10)) == (5*100) == (500)ms
#define TAG "FLIPFRID" #define TAG "FLIPFRID"
@@ -95,7 +95,7 @@ static void flipfrid_draw_callback(Canvas* const canvas, void* ctx) {
if(flipfrid_state->current_attack_type == BruteForceCustomerId) { if(flipfrid_state->current_attack_type == BruteForceCustomerId) {
snprintf(uid, sizeof(uid), " ID : %2X ", flipfrid_state->current_uid[0]); snprintf(uid, sizeof(uid), " ID : %2X ", flipfrid_state->current_uid[0]);
} else if (flipfrid_state->current_attack_type == BadCrc) { } else if(flipfrid_state->current_attack_type == BadCrc) {
snprintf(uid, sizeof(uid), "Sending packets"); snprintf(uid, sizeof(uid), "Sending packets");
} else { } else {
snprintf( snprintf(
@@ -207,6 +207,8 @@ int32_t flipfrid_start(void* p) {
case InputKeyRight: case InputKeyRight:
// Next badge type // Next badge type
flipfrid_state->emitting = false; flipfrid_state->emitting = false;
attack_state = 0;
notification_message(flipfrid_state->notify, &sequence_blink_stop);
if(menu_selected_item_index < (NUMBER_OF_ATTACKS - 1)) { if(menu_selected_item_index < (NUMBER_OF_ATTACKS - 1)) {
menu_selected_item_index++; menu_selected_item_index++;
flipfrid_state->current_attack_type = flipfrid_state->current_attack_type =
@@ -216,6 +218,8 @@ int32_t flipfrid_start(void* p) {
case InputKeyLeft: case InputKeyLeft:
// Previous badge type // Previous badge type
flipfrid_state->emitting = false; flipfrid_state->emitting = false;
attack_state = 0;
notification_message(flipfrid_state->notify, &sequence_blink_stop);
if(menu_selected_item_index > 0) { if(menu_selected_item_index > 0) {
menu_selected_item_index--; menu_selected_item_index--;
flipfrid_state->current_attack_type = flipfrid_state->current_attack_type =
@@ -232,10 +236,12 @@ int32_t flipfrid_start(void* p) {
flipfrid_state->emitting = true; flipfrid_state->emitting = true;
attack_state = 0; attack_state = 0;
// TODO FIX BLINK // TODO FIX BLINK
notification_message(flipfrid_state->notify, &sequence_blink_start_magenta); notification_message(
flipfrid_state->notify, &sequence_blink_start_blue);
} }
break; break;
case InputKeyBack: case InputKeyBack:
notification_message(flipfrid_state->notify, &sequence_blink_stop);
flipfrid_state->emitting = false; flipfrid_state->emitting = false;
running = false; running = false;
break; break;

View File

@@ -36,7 +36,6 @@ App(
provides=[ provides=[
"music_player", "music_player",
"bt_hid", "bt_hid",
"flipfrid",
], ],
) )
@@ -78,5 +77,6 @@ App(
"wifi_scanner", "wifi_scanner",
"wav_player", "wav_player",
"multi_converter", "multi_converter",
"flipfrid",
], ],
) )

View File

@@ -86,7 +86,6 @@ typedef struct {
SubGhzTransmitter* tx_transmitter; SubGhzTransmitter* tx_transmitter;
FlipperFormat* tx_fff_data; FlipperFormat* tx_fff_data;
const char* tx_file_path; const char* tx_file_path;
//int repeat;
int button; int button;
int file_result; int file_result;
@@ -457,7 +456,9 @@ bool unirfremix_set_preset(UniRFPreset* p, const char* preset) {
} else if(!strcmp(preset, "FuriHalSubGhzPreset2FSKDev476Async")) { } else if(!strcmp(preset, "FuriHalSubGhzPreset2FSKDev476Async")) {
string_set(p->name, "FM476"); string_set(p->name, "FM476");
} else if(!strcmp(preset, "FuriHalSubGhzPresetCustom")) { } else if(!strcmp(preset, "FuriHalSubGhzPresetCustom")) {
string_set(p->name, "CUSTOM"); FURI_LOG_E(TAG, "Custom preset unsupported now");
return false;
// string_set(p->name, "CUSTOM");
} else { } else {
FURI_LOG_E(TAG, "Unsupported preset"); FURI_LOG_E(TAG, "Unsupported preset");
return false; return false;
@@ -501,6 +502,8 @@ bool unirfremix_key_load(
} }
if(!strcmp(string_get_cstr(temp_str), "FuriHalSubGhzPresetCustom")) { if(!strcmp(string_get_cstr(temp_str), "FuriHalSubGhzPresetCustom")) {
// TODO: check if preset is custom // TODO: check if preset is custom
FURI_LOG_E(TAG, "Could not use custom preset");
break;
} }
size_t preset_index = size_t preset_index =
subghz_setting_get_inx_preset_by_name(setting, string_get_cstr(preset->name)); subghz_setting_get_inx_preset_by_name(setting, string_get_cstr(preset->name));
@@ -583,11 +586,16 @@ bool unirfremix_save_protocol_to_file(FlipperFormat* fff_file, const char* dev_f
} }
void unirfremix_tx_stop(UniRFRemix* app) { void unirfremix_tx_stop(UniRFRemix* app) {
if(app->processing == 0) {
return;
}
if(!string_cmp_str(app->txpreset->protocol, "RAW")) { if(!string_cmp_str(app->txpreset->protocol, "RAW")) {
while(!furi_hal_subghz_is_async_tx_complete()) { while(!furi_hal_subghz_is_async_tx_complete()) {
furi_delay_ms(60); furi_delay_ms(15);
} }
} }
//Stop TX //Stop TX
furi_hal_subghz_stop_async_tx(); furi_hal_subghz_stop_async_tx();
FURI_LOG_I(TAG, "TX Done!"); FURI_LOG_I(TAG, "TX Done!");
@@ -1062,9 +1070,8 @@ int32_t unirfremix_app(void* p) {
break; break;
case InputKeyBack: case InputKeyBack:
if(input.type == InputTypeShort) { unirfremix_tx_stop(app);
exit_loop = true; exit_loop = true;
}
break; break;
} }
@@ -1135,9 +1142,7 @@ int32_t unirfremix_app(void* p) {
case InputKeyOk: case InputKeyOk:
break; break;
case InputKeyBack: case InputKeyBack:
if(input.type == InputTypeShort) {
exit_loop = true; exit_loop = true;
}
break; break;
} }

Binary file not shown.

Before

Width:  |  Height:  |  Size: 170 B

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 165 B

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 171 B

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 168 B

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 169 B

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 166 B

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

View File

@@ -1 +1 @@
3 4

View File

@@ -944,6 +944,7 @@ void subghz_protocol_decoder_keeloq_get_string(void* context, string_t output) {
uint32_t code_found_reverse_hi = code_found_reverse >> 32; uint32_t code_found_reverse_hi = code_found_reverse >> 32;
uint32_t code_found_reverse_lo = code_found_reverse & 0x00000000ffffffff; uint32_t code_found_reverse_lo = code_found_reverse & 0x00000000ffffffff;
if(strcmp(instance->manufacture_name, "BFT") == 0) {
string_cat_printf( string_cat_printf(
output, output,
"%s %dbit\r\n" "%s %dbit\r\n"
@@ -961,4 +962,22 @@ void subghz_protocol_decoder_keeloq_get_string(void* context, string_t output) {
instance->generic.btn, instance->generic.btn,
instance->manufacture_name, instance->manufacture_name,
instance->generic.seed); instance->generic.seed);
} else {
string_cat_printf(
output,
"%s %dbit\r\n"
"Key:%08lX%08lX\r\n"
"Fix:0x%08lX Cnt:%04X\r\n"
"Hop:0x%08lX Btn:%01lX\r\n"
"MF:%s",
instance->generic.protocol_name,
instance->generic.data_count_bit,
code_found_hi,
code_found_lo,
code_found_reverse_hi,
instance->generic.cnt,
code_found_reverse_lo,
instance->generic.btn,
instance->manufacture_name);
}
} }