Skip to content

Commit

Permalink
Merge pull request #18 from leedave/feature/repeats
Browse files Browse the repository at this point in the history
Feature/repeats
  • Loading branch information
leedave authored Jan 5, 2024
2 parents cc0c618 + ca16f0c commit 85a94f8
Show file tree
Hide file tree
Showing 10 changed files with 57 additions and 6 deletions.
20 changes: 19 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,27 @@ Means that the SubGhz Code is being generated for the configured range
### Purple Blinking LED
Means that SubGhz Signals are being sent

## Settings Explanation

### Pager Type
Sets the current Pager type your targeting. Each model uses a different encoding, you cannot trigger multiple models at once

### First Station / Last Station
Each Station has a unique id. This is important so many stations can run in one location without conflicting each other. Use these settings to define a range of stations to trigger

I do not recommend a lager range than 10

### Fist Pager / Last Pager
The range of numbers on the pagers to be triggered. Most stations don't have many pagers, so a range of 0 - 31 probably is enough for all.

### Signal Repeat
How many times a single pager trigger is sent. Usually a signal is sent multiple times to combat radio noise that can cause a signal not to be recognised.
This is the total number of signals, so a setting of 0 will not send anything. More signals take longer, less have a higher risk of no effect. Set a number between 1 and 10.


## Can this Brute-Force Attacks
This is a Proof-of-Concept. In Theory it could, but I wouldn't recommend trying it. Its annoying for people targeted and it could get you into trouble. Seriously, don't be that person, nobody will like your for it.
Appart from that, most pagers support 8191 Stations. Triggering ~30 Pagers per station would easily take a long time. That when only sending each trigger once. It is recommended is to repeat the signal approx 10x (currently not possible, but possible that stations don't react to a single call), so that would already take all day.
Appart from that, most pagers support 8191 Stations. Triggering ~30 Pagers per station would easily take a long time. That when only sending each trigger once. It is recommended is to repeat the signal approx 10x, so that would already take all day.
Also your Flipper Zero will crash in that time, as the generated signals use RAM which is limited in the device. There may be ways to work around this, but I think its better to have such a limitation.

## Does this even work
Expand Down
2 changes: 1 addition & 1 deletion application.fam
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ App(
fap_icon="icons/meal_pager_10px.png",
fap_icon_assets="icons",
fap_category="Sub-Ghz",
fap_version="0.7",
fap_version="0.8",
fap_author="leedave",
fap_weburl="https://github.com/leedave/flipper-zero-meal-pager",
fap_description="This app triggers restaurant pagers in a brute force manner, useful to test if devices are still functional.",
Expand Down
6 changes: 6 additions & 0 deletions docs/changelog.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
## v0.8
- Added Repeats feature
- Repeats configuration in settings
- Usage of repeats in T119
- Usage of repeats in TD157

## v0.7

- Added support for TD157
Expand Down
3 changes: 3 additions & 0 deletions helpers/meal_pager_storage.c
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,8 @@ void meal_pager_save_settings(void* context) {
flipper_format_write_uint32(
fff_file, MEAL_PAGER_SETTINGS_KEY_FIRST_PAGER, &app->first_pager, 1);
flipper_format_write_uint32(fff_file, MEAL_PAGER_SETTINGS_KEY_LAST_PAGER, &app->last_pager, 1);
flipper_format_write_uint32(fff_file, MEAL_PAGER_SETTINGS_KEY_LAST_PAGER, &app->last_pager, 1);
flipper_format_write_uint32(fff_file, MEAL_PAGER_SETTINGS_KEY_REPEATS, &app->repeats, 1);
flipper_format_write_uint32(fff_file, MEAL_PAGER_SETTINGS_KEY_HAPTIC, &app->haptic, 1);
flipper_format_write_uint32(fff_file, MEAL_PAGER_SETTINGS_KEY_SPEAKER, &app->speaker, 1);
flipper_format_write_uint32(fff_file, MEAL_PAGER_SETTINGS_KEY_LED, &app->led, 1);
Expand Down Expand Up @@ -185,6 +187,7 @@ void meal_pager_read_settings(void* context) {
flipper_format_read_uint32(
fff_file, MEAL_PAGER_SETTINGS_KEY_FIRST_PAGER, &app->first_pager, 1);
flipper_format_read_uint32(fff_file, MEAL_PAGER_SETTINGS_KEY_LAST_PAGER, &app->last_pager, 1);
flipper_format_read_uint32(fff_file, MEAL_PAGER_SETTINGS_KEY_REPEATS, &app->repeats, 1);
flipper_format_read_uint32(fff_file, MEAL_PAGER_SETTINGS_KEY_HAPTIC, &app->haptic, 1);
flipper_format_read_uint32(fff_file, MEAL_PAGER_SETTINGS_KEY_SPEAKER, &app->speaker, 1);
flipper_format_read_uint32(fff_file, MEAL_PAGER_SETTINGS_KEY_LED, &app->led, 1);
Expand Down
3 changes: 2 additions & 1 deletion helpers/meal_pager_storage.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#include <flipper_format/flipper_format_i.h>
#include "../meal_pager_i.h"

#define MEAL_PAGER_SETTINGS_FILE_VERSION 1
#define MEAL_PAGER_SETTINGS_FILE_VERSION 2
#define CONFIG_FILE_DIRECTORY_PATH EXT_PATH("apps_data/meal_pager")
#define MEAL_PAGER_SETTINGS_SAVE_PATH CONFIG_FILE_DIRECTORY_PATH "/meal_pager.conf"
#define MEAL_PAGER_SETTINGS_SAVE_PATH_TMP MEAL_PAGER_SETTINGS_SAVE_PATH ".tmp"
Expand All @@ -16,6 +16,7 @@
#define MEAL_PAGER_SETTINGS_KEY_LAST_STATION "Last Station"
#define MEAL_PAGER_SETTINGS_KEY_FIRST_PAGER "First Pager"
#define MEAL_PAGER_SETTINGS_KEY_LAST_PAGER "Last Pager"
#define MEAL_PAGER_SETTINGS_KEY_REPEATS "Repeats"
#define MEAL_PAGER_SETTINGS_KEY_HAPTIC "Haptic"
#define MEAL_PAGER_SETTINGS_KEY_LED "Led"
#define MEAL_PAGER_SETTINGS_KEY_SPEAKER "Speaker"
Expand Down
5 changes: 4 additions & 1 deletion helpers/retekess/meal_pager_retekess_t119.c
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,10 @@ static void meal_pager_retekess_t119_generate_pager(
//FURI_LOG_D(TAG, "Manchester: %s", manchester);
char* rawSignal = genRawDataT119(200, 600, manchester);
//FURI_LOG_D(TAG, "RAW_Data: %s", rawSignal);
flipper_format_write_string_cstr(ff, "RAW_Data", rawSignal);
for(u_int32_t i = 1; app->repeats >= i; i++) {
flipper_format_write_string_cstr(ff, "RAW_Data", rawSignal);
}
//flipper_format_write_string_cstr(ff, "RAW_Data", rawSignal);
free(manchester);
free(rawSignal);
}
Expand Down
4 changes: 3 additions & 1 deletion helpers/retekess/meal_pager_retekess_td157.c
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,9 @@ static void meal_pager_retekess_td157_generate_pager(
customConcat(fullId, actionId);
char* manchester = encManchester(fullId, 0);
char* rawSignal = genRawDataTD157(200, 600, manchester);
flipper_format_write_string_cstr(ff, "RAW_Data", rawSignal);
for(u_int32_t i = 1; app->repeats >= i; i++) {
flipper_format_write_string_cstr(ff, "RAW_Data", rawSignal);
}
free(manchester);
free(rawSignal);
}
Expand Down
4 changes: 3 additions & 1 deletion meal_pager.c
Original file line number Diff line number Diff line change
Expand Up @@ -49,13 +49,15 @@ Meal_Pager* meal_pager_app_alloc() {
app->pager_type = 0;
app->first_station = 0;
app->first_station_char = "0";
app->last_station = 255;
app->last_station = 10;
app->last_station_char = "10";
app->first_pager = 0;
app->first_pager_char = "0";
app->last_pager = 31;
app->last_pager_char = "31";
app->stop_transmit = false;
app->repeats = 1;
app->repeats_char = "1";

// Used for File Browser
app->dialogs = furi_record_open(RECORD_DIALOGS);
Expand Down
2 changes: 2 additions & 0 deletions meal_pager_i.h
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,8 @@ typedef struct {
uint32_t current_station;
uint32_t current_pager;
bool stop_transmit;
uint32_t repeats;
char* repeats_char;
} Meal_Pager;

typedef enum {
Expand Down
14 changes: 14 additions & 0 deletions scenes/meal_pager_scene_settings.c
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,15 @@ static void meal_pager_scene_settings_set_last_pager(VariableItem* item) {
app->last_pager = index;
}

static void meal_pager_scene_settings_set_repeats(VariableItem* item) {
Meal_Pager* app = variable_item_get_context(item);
uint32_t index = variable_item_get_current_value_index(item);

snprintf(app->repeats_char, 20, "%lu", index);
variable_item_set_current_value_text(item, app->repeats_char);
app->repeats = index;
}

static void meal_pager_scene_settings_set_haptic(VariableItem* item) {
Meal_Pager* app = variable_item_get_context(item);
uint8_t index = variable_item_get_current_value_index(item);
Expand Down Expand Up @@ -189,6 +198,11 @@ void meal_pager_scene_settings_on_enter(void* context) {
variable_item_set_current_value_text(item, app->last_pager_char);

// Repeat Attacks
item = variable_item_list_add(
app->variable_item_list, "Signal Repeat", 11, meal_pager_scene_settings_set_repeats, app);
variable_item_set_current_value_index(item, app->repeats);
snprintf(app->repeats_char, 20, "%lu", app->repeats);
variable_item_set_current_value_text(item, app->repeats_char);

// Vibro on/off
item = variable_item_list_add(
Expand Down

0 comments on commit 85a94f8

Please sign in to comment.