mirror of
https://github.com/DarkFlippers/unleashed-firmware
synced 2024-11-27 06:50:21 +00:00
fixes, rfid fuzzer still crashes
This commit is contained in:
parent
5a2719663f
commit
31aaa593fc
6 changed files with 35 additions and 36 deletions
|
@ -57,7 +57,6 @@ typedef struct {
|
||||||
FuriString* left_file;
|
FuriString* left_file;
|
||||||
FuriString* right_file;
|
FuriString* right_file;
|
||||||
FuriString* ok_file;
|
FuriString* ok_file;
|
||||||
FuriString* empty;
|
|
||||||
|
|
||||||
FuriString* up_l;
|
FuriString* up_l;
|
||||||
FuriString* left_l;
|
FuriString* left_l;
|
||||||
|
@ -873,7 +872,6 @@ void unirfremix_free(UniRFRemix* app, bool with_subghz) {
|
||||||
furi_string_free(app->left_file);
|
furi_string_free(app->left_file);
|
||||||
furi_string_free(app->right_file);
|
furi_string_free(app->right_file);
|
||||||
furi_string_free(app->ok_file);
|
furi_string_free(app->ok_file);
|
||||||
furi_string_free(app->empty);
|
|
||||||
|
|
||||||
furi_string_free(app->up_l);
|
furi_string_free(app->up_l);
|
||||||
furi_string_free(app->down_l);
|
furi_string_free(app->down_l);
|
||||||
|
@ -911,6 +909,7 @@ int32_t unirfremix_app(void* p) {
|
||||||
UniRFRemix* app = unirfremix_alloc();
|
UniRFRemix* app = unirfremix_alloc();
|
||||||
|
|
||||||
app->file_path = furi_string_alloc();
|
app->file_path = furi_string_alloc();
|
||||||
|
app->signal = furi_string_alloc();
|
||||||
|
|
||||||
//setup variables before population
|
//setup variables before population
|
||||||
app->up_file = furi_string_alloc();
|
app->up_file = furi_string_alloc();
|
||||||
|
@ -918,7 +917,6 @@ int32_t unirfremix_app(void* p) {
|
||||||
app->left_file = furi_string_alloc();
|
app->left_file = furi_string_alloc();
|
||||||
app->right_file = furi_string_alloc();
|
app->right_file = furi_string_alloc();
|
||||||
app->ok_file = furi_string_alloc();
|
app->ok_file = furi_string_alloc();
|
||||||
app->empty = furi_string_alloc();
|
|
||||||
|
|
||||||
app->up_l = furi_string_alloc();
|
app->up_l = furi_string_alloc();
|
||||||
app->down_l = furi_string_alloc();
|
app->down_l = furi_string_alloc();
|
||||||
|
@ -995,7 +993,7 @@ int32_t unirfremix_app(void* p) {
|
||||||
if(input.type == InputTypePress) {
|
if(input.type == InputTypePress) {
|
||||||
if(app->up_enabled) {
|
if(app->up_enabled) {
|
||||||
if(app->processing == 0) {
|
if(app->processing == 0) {
|
||||||
app->signal = app->empty;
|
furi_string_reset(app->signal);
|
||||||
app->signal = app->up_file;
|
app->signal = app->up_file;
|
||||||
app->button = 1;
|
app->button = 1;
|
||||||
app->processing = 1;
|
app->processing = 1;
|
||||||
|
@ -1013,7 +1011,7 @@ int32_t unirfremix_app(void* p) {
|
||||||
if(input.type == InputTypePress) {
|
if(input.type == InputTypePress) {
|
||||||
if(app->down_enabled) {
|
if(app->down_enabled) {
|
||||||
if(app->processing == 0) {
|
if(app->processing == 0) {
|
||||||
app->signal = app->empty;
|
furi_string_reset(app->signal);
|
||||||
app->signal = app->down_file;
|
app->signal = app->down_file;
|
||||||
app->button = 2;
|
app->button = 2;
|
||||||
app->processing = 1;
|
app->processing = 1;
|
||||||
|
@ -1031,7 +1029,7 @@ int32_t unirfremix_app(void* p) {
|
||||||
if(input.type == InputTypePress) {
|
if(input.type == InputTypePress) {
|
||||||
if(app->right_enabled) {
|
if(app->right_enabled) {
|
||||||
if(app->processing == 0) {
|
if(app->processing == 0) {
|
||||||
app->signal = app->empty;
|
furi_string_reset(app->signal);
|
||||||
app->signal = app->right_file;
|
app->signal = app->right_file;
|
||||||
app->button = 3;
|
app->button = 3;
|
||||||
app->processing = 1;
|
app->processing = 1;
|
||||||
|
@ -1049,7 +1047,7 @@ int32_t unirfremix_app(void* p) {
|
||||||
if(input.type == InputTypePress) {
|
if(input.type == InputTypePress) {
|
||||||
if(app->left_enabled) {
|
if(app->left_enabled) {
|
||||||
if(app->processing == 0) {
|
if(app->processing == 0) {
|
||||||
app->signal = app->empty;
|
furi_string_reset(app->signal);
|
||||||
app->signal = app->left_file;
|
app->signal = app->left_file;
|
||||||
app->button = 4;
|
app->button = 4;
|
||||||
app->processing = 1;
|
app->processing = 1;
|
||||||
|
@ -1067,7 +1065,7 @@ int32_t unirfremix_app(void* p) {
|
||||||
if(input.type == InputTypePress) {
|
if(input.type == InputTypePress) {
|
||||||
if(app->ok_enabled) {
|
if(app->ok_enabled) {
|
||||||
if(app->processing == 0) {
|
if(app->processing == 0) {
|
||||||
app->signal = app->empty;
|
furi_string_reset(app->signal);
|
||||||
app->signal = app->ok_file;
|
app->signal = app->ok_file;
|
||||||
app->button = 5;
|
app->button = 5;
|
||||||
app->processing = 1;
|
app->processing = 1;
|
||||||
|
|
|
@ -57,6 +57,8 @@ FlipFridState* flipfrid_alloc() {
|
||||||
FlipFridState* flipfrid = malloc(sizeof(FlipFridState));
|
FlipFridState* flipfrid = malloc(sizeof(FlipFridState));
|
||||||
flipfrid->notification_msg = furi_string_alloc();
|
flipfrid->notification_msg = furi_string_alloc();
|
||||||
flipfrid->attack_name = furi_string_alloc();
|
flipfrid->attack_name = furi_string_alloc();
|
||||||
|
flipfrid->proto_name = furi_string_alloc();
|
||||||
|
flipfrid->data_str = furi_string_alloc();
|
||||||
|
|
||||||
flipfrid->previous_scene = NoneScene;
|
flipfrid->previous_scene = NoneScene;
|
||||||
flipfrid->current_scene = SceneEntryPoint;
|
flipfrid->current_scene = SceneEntryPoint;
|
||||||
|
@ -97,6 +99,8 @@ void flipfrid_free(FlipFridState* flipfrid) {
|
||||||
// Strings
|
// Strings
|
||||||
furi_string_free(flipfrid->notification_msg);
|
furi_string_free(flipfrid->notification_msg);
|
||||||
furi_string_free(flipfrid->attack_name);
|
furi_string_free(flipfrid->attack_name);
|
||||||
|
furi_string_free(flipfrid->proto_name);
|
||||||
|
furi_string_free(flipfrid->data_str);
|
||||||
|
|
||||||
free(flipfrid->data);
|
free(flipfrid->data);
|
||||||
free(flipfrid->payload);
|
free(flipfrid->payload);
|
||||||
|
@ -120,8 +124,7 @@ int32_t flipfrid_start(void* p) {
|
||||||
FURI_LOG_E(TAG, "cannot create mutex\r\n");
|
FURI_LOG_E(TAG, "cannot create mutex\r\n");
|
||||||
furi_message_queue_free(event_queue);
|
furi_message_queue_free(event_queue);
|
||||||
furi_record_close(RECORD_NOTIFICATION);
|
furi_record_close(RECORD_NOTIFICATION);
|
||||||
furi_record_close(RECORD_DIALOGS);
|
flipfrid_free(flipfrid_state);
|
||||||
free(flipfrid_state);
|
|
||||||
return 255;
|
return 255;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -70,7 +70,7 @@ void flipfrid_center_displayed_key(FlipFridState* context, uint8_t index) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void flipfrid_scene_select_field_on_enter(FlipFridState* context) {
|
void flipfrid_scene_select_field_on_enter(FlipFridState* context) {
|
||||||
furi_string_free(context->notification_msg);
|
furi_string_reset(context->notification_msg);
|
||||||
}
|
}
|
||||||
|
|
||||||
void flipfrid_scene_select_field_on_exit(FlipFridState* context) {
|
void flipfrid_scene_select_field_on_exit(FlipFridState* context) {
|
||||||
|
|
|
@ -194,26 +194,24 @@ bool subbrute_device_create_packet_parsed(SubBruteDevice* instance, uint64_t ste
|
||||||
//char step_payload[32];
|
//char step_payload[32];
|
||||||
//memset(step_payload, '0', sizeof(step_payload));
|
//memset(step_payload, '0', sizeof(step_payload));
|
||||||
memset(instance->payload, 0, sizeof(instance->payload));
|
memset(instance->payload, 0, sizeof(instance->payload));
|
||||||
FuriString* candidate;
|
FuriString* candidate = furi_string_alloc();
|
||||||
candidate = furi_string_alloc();
|
|
||||||
|
|
||||||
if(instance->attack == SubBruteAttackLoadFile) {
|
if(instance->attack == SubBruteAttackLoadFile) {
|
||||||
if(step >= sizeof(instance->file_key)) {
|
if(step >= sizeof(instance->file_key)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
char subbrute_payload_byte[4];
|
char subbrute_payload_byte[4];
|
||||||
furi_string_set(candidate, instance->file_key);
|
furi_string_set_str(candidate, instance->file_key);
|
||||||
snprintf(subbrute_payload_byte, 4, "%02X ", (uint8_t)step);
|
snprintf(subbrute_payload_byte, 4, "%02X ", (uint8_t)step);
|
||||||
furi_string_replace_at(candidate, instance->load_index * 3, 3, subbrute_payload_byte);
|
furi_string_replace_at(candidate, instance->load_index * 3, 3, subbrute_payload_byte);
|
||||||
//snprintf(step_payload, sizeof(step_payload), "%02X", (uint8_t)instance->file_key[step]);
|
//snprintf(step_payload, sizeof(step_payload), "%02X", (uint8_t)instance->file_key[step]);
|
||||||
} else {
|
} else {
|
||||||
//snprintf(step_payload, sizeof(step_payload), "%16X", step);
|
//snprintf(step_payload, sizeof(step_payload), "%16X", step);
|
||||||
//snprintf(step_payload, sizeof(step_payload), "%016llX", step);
|
//snprintf(step_payload, sizeof(step_payload), "%016llX", step);
|
||||||
FuriString* buffer;
|
FuriString* buffer = furi_string_alloc();
|
||||||
buffer = furi_string_alloc();
|
furi_string_printf(buffer, "%16X", step);
|
||||||
buffer = furi_string_alloc_printf("%16X", step);
|
|
||||||
int j = 0;
|
int j = 0;
|
||||||
furi_string_set(candidate, " ");
|
furi_string_set_str(candidate, " ");
|
||||||
for(uint8_t i = 0; i < 16; i++) {
|
for(uint8_t i = 0; i < 16; i++) {
|
||||||
if(furi_string_get_char(buffer, i) != ' ') {
|
if(furi_string_get_char(buffer, i) != ' ') {
|
||||||
furi_string_set_char(candidate, i + j, furi_string_get_char(buffer, i));
|
furi_string_set_char(candidate, i + j, furi_string_get_char(buffer, i));
|
||||||
|
@ -306,8 +304,8 @@ SubBruteFileResult subbrute_device_attack_set(SubBruteDevice* instance, SubBrute
|
||||||
instance->frequency = 868350000;
|
instance->frequency = 868350000;
|
||||||
}
|
}
|
||||||
instance->bit = 12;
|
instance->bit = 12;
|
||||||
furi_string_set(instance->protocol_name, protocol_came);
|
furi_string_set_str(instance->protocol_name, protocol_came);
|
||||||
furi_string_set(instance->preset_name, preset_ook650_async);
|
furi_string_set_str(instance->preset_name, preset_ook650_async);
|
||||||
break;
|
break;
|
||||||
case SubBruteAttackChamberlain9bit300:
|
case SubBruteAttackChamberlain9bit300:
|
||||||
case SubBruteAttackChamberlain9bit315:
|
case SubBruteAttackChamberlain9bit315:
|
||||||
|
@ -320,32 +318,32 @@ SubBruteFileResult subbrute_device_attack_set(SubBruteDevice* instance, SubBrute
|
||||||
instance->frequency = 390000000;
|
instance->frequency = 390000000;
|
||||||
}
|
}
|
||||||
instance->bit = 9;
|
instance->bit = 9;
|
||||||
furi_string_set(instance->protocol_name, protocol_cham_code);
|
furi_string_set_str(instance->protocol_name, protocol_cham_code);
|
||||||
furi_string_set(instance->preset_name, preset_ook650_async);
|
furi_string_set_str(instance->preset_name, preset_ook650_async);
|
||||||
break;
|
break;
|
||||||
case SubBruteAttackLinear10bit300:
|
case SubBruteAttackLinear10bit300:
|
||||||
instance->frequency = 300000000;
|
instance->frequency = 300000000;
|
||||||
instance->bit = 10;
|
instance->bit = 10;
|
||||||
furi_string_set(instance->protocol_name, protocol_linear);
|
furi_string_set_str(instance->protocol_name, protocol_linear);
|
||||||
furi_string_set(instance->preset_name, preset_ook650_async);
|
furi_string_set_str(instance->preset_name, preset_ook650_async);
|
||||||
break;
|
break;
|
||||||
case SubBruteAttackLinear10bit310:
|
case SubBruteAttackLinear10bit310:
|
||||||
instance->frequency = 310000000;
|
instance->frequency = 310000000;
|
||||||
instance->bit = 10;
|
instance->bit = 10;
|
||||||
furi_string_set(instance->protocol_name, protocol_linear);
|
furi_string_set_str(instance->protocol_name, protocol_linear);
|
||||||
furi_string_set(instance->preset_name, preset_ook650_async);
|
furi_string_set_str(instance->preset_name, preset_ook650_async);
|
||||||
break;
|
break;
|
||||||
case SubBruteAttackNICE12bit433:
|
case SubBruteAttackNICE12bit433:
|
||||||
instance->frequency = 433920000;
|
instance->frequency = 433920000;
|
||||||
instance->bit = 12;
|
instance->bit = 12;
|
||||||
furi_string_set(instance->protocol_name, protocol_nice_flo);
|
furi_string_set_str(instance->protocol_name, protocol_nice_flo);
|
||||||
furi_string_set(instance->preset_name, preset_ook650_async);
|
furi_string_set_str(instance->preset_name, preset_ook650_async);
|
||||||
break;
|
break;
|
||||||
case SubBruteAttackNICE12bit868:
|
case SubBruteAttackNICE12bit868:
|
||||||
instance->frequency = 868350000;
|
instance->frequency = 868350000;
|
||||||
instance->bit = 12;
|
instance->bit = 12;
|
||||||
furi_string_set(instance->protocol_name, protocol_nice_flo);
|
furi_string_set_str(instance->protocol_name, protocol_nice_flo);
|
||||||
furi_string_set(instance->preset_name, preset_ook650_async);
|
furi_string_set_str(instance->preset_name, preset_ook650_async);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
FURI_LOG_E(TAG, "Unknown attack type: %d", type);
|
FURI_LOG_E(TAG, "Unknown attack type: %d", type);
|
||||||
|
|
|
@ -33,7 +33,7 @@ void subbrute_main_view_set_callback(
|
||||||
instance->context = context;
|
instance->context = context;
|
||||||
}
|
}
|
||||||
|
|
||||||
void center_displayed_key(FuriString* result, const char* key_cstr, uint8_t index) {
|
FuriString* center_displayed_key(const char* key_cstr, uint8_t index) {
|
||||||
uint8_t str_index = (index * 3);
|
uint8_t str_index = (index * 3);
|
||||||
|
|
||||||
char display_menu[] = {
|
char display_menu[] = {
|
||||||
|
@ -75,7 +75,7 @@ void center_displayed_key(FuriString* result, const char* key_cstr, uint8_t inde
|
||||||
display_menu[15] = ' ';
|
display_menu[15] = ' ';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
result = furi_string_alloc_set(display_menu);
|
return furi_string_alloc_set(display_menu);
|
||||||
}
|
}
|
||||||
|
|
||||||
void subbrute_main_view_draw(Canvas* canvas, SubBruteMainViewModel* model) {
|
void subbrute_main_view_draw(Canvas* canvas, SubBruteMainViewModel* model) {
|
||||||
|
@ -97,9 +97,8 @@ void subbrute_main_view_draw(Canvas* canvas, SubBruteMainViewModel* model) {
|
||||||
canvas_draw_str_aligned(canvas, 64, 26, AlignCenter, AlignTop, msg_index);
|
canvas_draw_str_aligned(canvas, 64, 26, AlignCenter, AlignTop, msg_index);
|
||||||
|
|
||||||
FuriString* menu_items;
|
FuriString* menu_items;
|
||||||
menu_items = furi_string_alloc();
|
|
||||||
|
|
||||||
center_displayed_key(menu_items, m->key_field, m->index);
|
menu_items = center_displayed_key(m->key_field, m->index);
|
||||||
canvas_set_font(canvas, FontSecondary);
|
canvas_set_font(canvas, FontSecondary);
|
||||||
canvas_draw_str_aligned(
|
canvas_draw_str_aligned(
|
||||||
canvas, 64, 40, AlignCenter, AlignTop, furi_string_get_cstr(menu_items));
|
canvas, 64, 40, AlignCenter, AlignTop, furi_string_get_cstr(menu_items));
|
||||||
|
@ -109,6 +108,7 @@ void subbrute_main_view_draw(Canvas* canvas, SubBruteMainViewModel* model) {
|
||||||
elements_button_right(canvas, ">");
|
elements_button_right(canvas, ">");
|
||||||
|
|
||||||
furi_string_reset(menu_items);
|
furi_string_reset(menu_items);
|
||||||
|
furi_string_free(menu_items);
|
||||||
} else {
|
} else {
|
||||||
// Menu
|
// Menu
|
||||||
canvas_set_color(canvas, ColorBlack);
|
canvas_set_color(canvas, ColorBlack);
|
||||||
|
|
|
@ -35,13 +35,13 @@ void wifi_marauder_scene_console_output_on_enter(void* context) {
|
||||||
if(0 == strncmp("help", app->selected_tx_string, strlen("help"))) {
|
if(0 == strncmp("help", app->selected_tx_string, strlen("help"))) {
|
||||||
const char* help_msg =
|
const char* help_msg =
|
||||||
"For app support/feedback,\nreach out to me:\n@cococode#6011 (discord)\n0xchocolate (github)\n";
|
"For app support/feedback,\nreach out to me:\n@cococode#6011 (discord)\n0xchocolate (github)\n";
|
||||||
string_cat_str(app->text_box_store, help_msg);
|
furi_string_cat_str(app->text_box_store, help_msg);
|
||||||
app->text_box_store_strlen += strlen(help_msg);
|
app->text_box_store_strlen += strlen(help_msg);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(app->show_stopscan_tip) {
|
if(app->show_stopscan_tip) {
|
||||||
const char* help_msg = "Press BACK to send stopscan\n";
|
const char* help_msg = "Press BACK to send stopscan\n";
|
||||||
string_cat_str(app->text_box_store, help_msg);
|
furi_string_cat_str(app->text_box_store, help_msg);
|
||||||
app->text_box_store_strlen += strlen(help_msg);
|
app->text_box_store_strlen += strlen(help_msg);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue