mirror of
https://github.com/Next-Flip/Momentum-Firmware.git
synced 2026-05-14 15:48:35 -07:00
Update subbrute
This commit is contained in:
@@ -185,7 +185,8 @@ int32_t subbrute_app(void* p) {
|
||||
// Auto switch to internal radio if external radio is not available
|
||||
furi_delay_ms(15);
|
||||
if(!furi_hal_subghz_check_radio()) {
|
||||
furi_hal_subghz_set_radio_type(SubGhzRadioInternal);
|
||||
furi_hal_subghz_select_radio_type(SubGhzRadioInternal);
|
||||
furi_hal_subghz_init_radio_type(SubGhzRadioInternal);
|
||||
}
|
||||
|
||||
furi_hal_power_suppress_charge_enter();
|
||||
@@ -195,6 +196,8 @@ int32_t subbrute_app(void* p) {
|
||||
furi_hal_power_suppress_charge_exit();
|
||||
// Disable power for External CC1101 if it was enabled and module is connected
|
||||
furi_hal_subghz_disable_ext_power();
|
||||
// Reinit SPI handles for internal radio / nfc
|
||||
furi_hal_subghz_init_radio_type(SubGhzRadioInternal);
|
||||
|
||||
subbrute_free(instance);
|
||||
|
||||
|
||||
@@ -104,7 +104,6 @@ bool subbrute_device_save_file(SubBruteDevice* instance, const char* dev_file_na
|
||||
instance->current_step,
|
||||
instance->file_protocol_info->bits,
|
||||
instance->file_protocol_info->te,
|
||||
instance->file_protocol_info->repeat,
|
||||
instance->bit_index,
|
||||
instance->key_from_file,
|
||||
instance->two_bytes);
|
||||
@@ -116,8 +115,7 @@ bool subbrute_device_save_file(SubBruteDevice* instance, const char* dev_file_na
|
||||
instance->protocol_info->file,
|
||||
instance->current_step,
|
||||
instance->protocol_info->bits,
|
||||
instance->protocol_info->te,
|
||||
instance->protocol_info->repeat);
|
||||
instance->protocol_info->te);
|
||||
}
|
||||
|
||||
result = true;
|
||||
|
||||
@@ -522,9 +522,9 @@ static const char* subbrute_protocol_file_types[] = {
|
||||
* Values to not use less memory for packet parse operations
|
||||
*/
|
||||
static const char* subbrute_key_file_start_no_tail =
|
||||
"Filetype: Flipper SubGhz Key File\nVersion: 1\nFrequency: %u\nPreset: %s\nProtocol: %s\nBit: %d\nKey: %s\nRepeat: %d\n";
|
||||
"Filetype: Flipper SubGhz Key File\nVersion: 1\nFrequency: %u\nPreset: %s\nProtocol: %s\nBit: %d\nKey: %s\n";
|
||||
static const char* subbrute_key_file_start_with_tail =
|
||||
"Filetype: Flipper SubGhz Key File\nVersion: 1\nFrequency: %u\nPreset: %s\nProtocol: %s\nBit: %d\nKey: %s\nTE: %d\nRepeat: %d\n";
|
||||
"Filetype: Flipper SubGhz Key File\nVersion: 1\nFrequency: %u\nPreset: %s\nProtocol: %s\nBit: %d\nKey: %s\nTE: %d\n";
|
||||
static const char* subbrute_key_small_no_tail = "Bit: %d\nKey: %s\nRepeat: %d\n";
|
||||
//static const char* subbrute_key_small_raw =
|
||||
// "Filetype: Flipper SubGhz Key File\nVersion: 1\nFrequency: %u\nPreset: %s\nProtocol: %s\nBit: %d\n";
|
||||
@@ -771,8 +771,7 @@ void subbrute_protocol_default_generate_file(
|
||||
SubBruteFileProtocol file,
|
||||
uint64_t step,
|
||||
uint8_t bits,
|
||||
uint32_t te,
|
||||
uint8_t repeat) {
|
||||
uint32_t te) {
|
||||
FuriString* candidate = furi_string_alloc();
|
||||
subbrute_protocol_create_candidate_for_default(candidate, file, step);
|
||||
|
||||
@@ -790,8 +789,7 @@ void subbrute_protocol_default_generate_file(
|
||||
subbrute_protocol_file(file),
|
||||
bits,
|
||||
furi_string_get_cstr(candidate),
|
||||
te,
|
||||
repeat);
|
||||
te);
|
||||
} else {
|
||||
stream_write_format(
|
||||
stream,
|
||||
@@ -800,8 +798,7 @@ void subbrute_protocol_default_generate_file(
|
||||
subbrute_protocol_preset(preset),
|
||||
subbrute_protocol_file(file),
|
||||
bits,
|
||||
furi_string_get_cstr(candidate),
|
||||
repeat);
|
||||
furi_string_get_cstr(candidate));
|
||||
}
|
||||
|
||||
furi_string_free(candidate);
|
||||
@@ -815,7 +812,6 @@ void subbrute_protocol_file_generate_file(
|
||||
uint64_t step,
|
||||
uint8_t bits,
|
||||
uint32_t te,
|
||||
uint8_t repeat,
|
||||
uint8_t bit_index,
|
||||
uint64_t file_key,
|
||||
bool two_bytes) {
|
||||
@@ -826,6 +822,7 @@ void subbrute_protocol_file_generate_file(
|
||||
candidate, step, bit_index, file_key, two_bytes);
|
||||
|
||||
stream_clean(stream);
|
||||
|
||||
if(te) {
|
||||
stream_write_format(
|
||||
stream,
|
||||
@@ -835,8 +832,7 @@ void subbrute_protocol_file_generate_file(
|
||||
subbrute_protocol_file(file),
|
||||
bits,
|
||||
furi_string_get_cstr(candidate),
|
||||
te,
|
||||
repeat);
|
||||
te);
|
||||
} else {
|
||||
stream_write_format(
|
||||
stream,
|
||||
@@ -845,8 +841,7 @@ void subbrute_protocol_file_generate_file(
|
||||
subbrute_protocol_preset(preset),
|
||||
subbrute_protocol_file(file),
|
||||
bits,
|
||||
furi_string_get_cstr(candidate),
|
||||
repeat);
|
||||
furi_string_get_cstr(candidate));
|
||||
}
|
||||
|
||||
furi_string_free(candidate);
|
||||
|
||||
@@ -110,8 +110,7 @@ void subbrute_protocol_default_generate_file(
|
||||
SubBruteFileProtocol file,
|
||||
uint64_t step,
|
||||
uint8_t bits,
|
||||
uint32_t te,
|
||||
uint8_t repeat);
|
||||
uint32_t te);
|
||||
void subbrute_protocol_file_generate_file(
|
||||
Stream* stream,
|
||||
uint32_t frequency,
|
||||
@@ -120,7 +119,6 @@ void subbrute_protocol_file_generate_file(
|
||||
uint64_t step,
|
||||
uint8_t bits,
|
||||
uint32_t te,
|
||||
uint8_t repeat,
|
||||
uint8_t bit_index,
|
||||
uint64_t file_key,
|
||||
bool two_bytes);
|
||||
|
||||
Reference in New Issue
Block a user