mirror of
https://github.com/Next-Flip/Momentum-Firmware.git
synced 2026-05-13 06:38:35 -07:00
subbrute upd
This commit is contained in:
@@ -46,6 +46,23 @@ We do not condone illegal activity and strongly encourage keeping transmissions
|
|||||||
- Linear 10bit 300MHz
|
- Linear 10bit 300MHz
|
||||||
- Linear 10bit 310MHz
|
- Linear 10bit 310MHz
|
||||||
|
|
||||||
|
#### UNILARM
|
||||||
|
|
||||||
|
- UNILARM 25bit 330MHz
|
||||||
|
- UNILARM 25bit 433MHz
|
||||||
|
|
||||||
|
#### SMC5326
|
||||||
|
|
||||||
|
- SMC5326 25bit 330MHz
|
||||||
|
- SMC5326 25bit 433MHz
|
||||||
|
|
||||||
|
#### PT2260
|
||||||
|
|
||||||
|
- PT2260 24bit 315MHz
|
||||||
|
- PT2260 24bit 330MHz
|
||||||
|
- PT2260 24bit 390MHz
|
||||||
|
- PT2260 24bit 433MHz
|
||||||
|
|
||||||
#### Additional
|
#### Additional
|
||||||
|
|
||||||
- BF Existing dump works for all other static protocols supported by Flipper Zero
|
- BF Existing dump works for most other static protocols supported by Flipper Zero
|
||||||
|
|||||||
@@ -108,7 +108,7 @@ bool subbrute_worker_init_default_attack(
|
|||||||
#ifdef FURI_DEBUG
|
#ifdef FURI_DEBUG
|
||||||
FURI_LOG_I(
|
FURI_LOG_I(
|
||||||
TAG,
|
TAG,
|
||||||
"subbrute_worker_init_default_attack: %s, bits: %d, preset: %s, file: %s, te: %d, repeat: %d, max_value: %lld",
|
"subbrute_worker_init_default_attack: %s, bits: %d, preset: %s, file: %s, te: %ld, repeat: %d, max_value: %lld",
|
||||||
subbrute_protocol_name(instance->attack),
|
subbrute_protocol_name(instance->attack),
|
||||||
instance->bits,
|
instance->bits,
|
||||||
subbrute_protocol_preset(instance->preset),
|
subbrute_protocol_preset(instance->preset),
|
||||||
@@ -157,7 +157,7 @@ bool subbrute_worker_init_file_attack(
|
|||||||
#ifdef FURI_DEBUG
|
#ifdef FURI_DEBUG
|
||||||
FURI_LOG_I(
|
FURI_LOG_I(
|
||||||
TAG,
|
TAG,
|
||||||
"subbrute_worker_init_file_attack: %s, bits: %d, preset: %s, file: %s, te: %d, repeat: %d, max_value: %lld, key: %llX",
|
"subbrute_worker_init_file_attack: %s, bits: %d, preset: %s, file: %s, te: %ld, repeat: %d, max_value: %lld, key: %llX",
|
||||||
subbrute_protocol_name(instance->attack),
|
subbrute_protocol_name(instance->attack),
|
||||||
instance->bits,
|
instance->bits,
|
||||||
subbrute_protocol_preset(instance->preset),
|
subbrute_protocol_preset(instance->preset),
|
||||||
@@ -256,7 +256,7 @@ bool subbrute_worker_transmit_current_key(SubBruteWorker* instance, uint64_t ste
|
|||||||
instance->two_bytes);
|
instance->two_bytes);
|
||||||
} else {
|
} else {
|
||||||
subbrute_protocol_default_payload(
|
subbrute_protocol_default_payload(
|
||||||
stream, step, instance->bits, instance->te, instance->repeat);
|
stream, instance->file, step, instance->bits, instance->te, instance->repeat);
|
||||||
}
|
}
|
||||||
|
|
||||||
// size_t written = stream_write_string(stream, payload);
|
// size_t written = stream_write_string(stream, payload);
|
||||||
@@ -386,7 +386,12 @@ int32_t subbrute_worker_thread(void* context) {
|
|||||||
instance->two_bytes);
|
instance->two_bytes);
|
||||||
} else {
|
} else {
|
||||||
subbrute_protocol_default_payload(
|
subbrute_protocol_default_payload(
|
||||||
stream, instance->step, instance->bits, instance->te, instance->repeat);
|
stream,
|
||||||
|
instance->file,
|
||||||
|
instance->step,
|
||||||
|
instance->bits,
|
||||||
|
instance->te,
|
||||||
|
instance->repeat);
|
||||||
}
|
}
|
||||||
#ifdef FURI_DEBUG
|
#ifdef FURI_DEBUG
|
||||||
//FURI_LOG_I(TAG, "Payload: %s", furi_string_get_cstr(payload));
|
//FURI_LOG_I(TAG, "Payload: %s", furi_string_get_cstr(payload));
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ struct SubBruteWorker {
|
|||||||
FuriHalSubGhzPreset preset;
|
FuriHalSubGhzPreset preset;
|
||||||
SubBruteFileProtocol file;
|
SubBruteFileProtocol file;
|
||||||
uint8_t bits;
|
uint8_t bits;
|
||||||
uint8_t te;
|
uint32_t te;
|
||||||
uint8_t repeat;
|
uint8_t repeat;
|
||||||
uint8_t load_index; // Index of group to bruteforce in loaded file
|
uint8_t load_index; // Index of group to bruteforce in loaded file
|
||||||
uint64_t file_key;
|
uint64_t file_key;
|
||||||
|
|||||||
@@ -159,7 +159,7 @@ SubBruteFileResult subbrute_device_attack_set(
|
|||||||
uint8_t protocol_check_result = SubBruteFileResultProtocolNotFound;
|
uint8_t protocol_check_result = SubBruteFileResultProtocolNotFound;
|
||||||
#ifdef FURI_DEBUG
|
#ifdef FURI_DEBUG
|
||||||
uint8_t bits;
|
uint8_t bits;
|
||||||
uint8_t te;
|
uint32_t te;
|
||||||
uint8_t repeat;
|
uint8_t repeat;
|
||||||
FuriHalSubGhzPreset preset;
|
FuriHalSubGhzPreset preset;
|
||||||
SubBruteFileProtocol file;
|
SubBruteFileProtocol file;
|
||||||
@@ -211,7 +211,7 @@ SubBruteFileResult subbrute_device_attack_set(
|
|||||||
#ifdef FURI_DEBUG
|
#ifdef FURI_DEBUG
|
||||||
FURI_LOG_I(
|
FURI_LOG_I(
|
||||||
TAG,
|
TAG,
|
||||||
"subbrute_device_attack_set: %s, bits: %d, preset: %s, file: %s, te: %d, repeat: %d, max_value: %lld",
|
"subbrute_device_attack_set: %s, bits: %d, preset: %s, file: %s, te: %ld, repeat: %d, max_value: %lld",
|
||||||
subbrute_protocol_name(instance->attack),
|
subbrute_protocol_name(instance->attack),
|
||||||
bits,
|
bits,
|
||||||
subbrute_protocol_preset(preset),
|
subbrute_protocol_preset(preset),
|
||||||
@@ -320,25 +320,6 @@ uint8_t subbrute_device_load_from_file(SubBruteDevice* instance, const char* fil
|
|||||||
FURI_LOG_D(TAG, "Bit: %d", instance->file_protocol_info->bits);
|
FURI_LOG_D(TAG, "Bit: %d", instance->file_protocol_info->bits);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// TODO: Delete this
|
|
||||||
// Key
|
|
||||||
// if(!flipper_format_read_string(fff_data_file, "Key", temp_str)) {
|
|
||||||
// FURI_LOG_E(TAG, "Missing or incorrect Key");
|
|
||||||
// result = SubBruteFileResultMissingOrIncorrectKey;
|
|
||||||
// break;
|
|
||||||
// } else {
|
|
||||||
// snprintf(
|
|
||||||
// instance->current_key_from_file,
|
|
||||||
// sizeof(instance->current_key_from_file),
|
|
||||||
// "%s",
|
|
||||||
// furi_string_get_cstr(temp_str));
|
|
||||||
// #ifdef FURI_DEBUG
|
|
||||||
// FURI_LOG_D(TAG, "Key: %s", instance->current_key_from_file);
|
|
||||||
// #endif
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// flipper_format_rewind(fff_data_file);
|
|
||||||
|
|
||||||
uint8_t key_data[sizeof(uint64_t)] = {0};
|
uint8_t key_data[sizeof(uint64_t)] = {0};
|
||||||
if(!flipper_format_read_hex(fff_data_file, "Key", key_data, sizeof(uint64_t))) {
|
if(!flipper_format_read_hex(fff_data_file, "Key", key_data, sizeof(uint64_t))) {
|
||||||
FURI_LOG_E(TAG, "Missing Key");
|
FURI_LOG_E(TAG, "Missing Key");
|
||||||
@@ -354,81 +335,6 @@ uint8_t subbrute_device_load_from_file(SubBruteDevice* instance, const char* fil
|
|||||||
#endif
|
#endif
|
||||||
instance->key_from_file = data;
|
instance->key_from_file = data;
|
||||||
|
|
||||||
// uint16_t add_value = 0x0001;
|
|
||||||
// uint8_t bit_index = 7;
|
|
||||||
// bool two_bytes = true;
|
|
||||||
// uint8_t p[8];
|
|
||||||
// for(int i = 0; i < 8; i++) {
|
|
||||||
// p[i] = (uint8_t)(instance->key_from_file >> 8 * (7 - i)) & 0xFF;
|
|
||||||
// }
|
|
||||||
// uint16_t num = two_bytes ? (p[bit_index - 1] << 8) | p[bit_index] : p[bit_index];
|
|
||||||
// FURI_LOG_D(TAG, "num: 0x%04X", num);
|
|
||||||
// num += add_value;
|
|
||||||
// FURI_LOG_D(TAG, "num added: 0x%04X", num);
|
|
||||||
// uint8_t low_byte = num & (0xff);
|
|
||||||
// uint8_t high_byte = (num >> 8) & 0xff;
|
|
||||||
|
|
||||||
// data = 0;
|
|
||||||
// for(uint8_t i = 0; i < sizeof(uint64_t); i++) {
|
|
||||||
// if(i == bit_index - 1 && two_bytes) {
|
|
||||||
// data = (data << 8) | high_byte;
|
|
||||||
// data = (data << 8) | low_byte;
|
|
||||||
// i++;
|
|
||||||
// } else if(i == bit_index) {
|
|
||||||
// data = (data << 8) | low_byte;
|
|
||||||
// } else {
|
|
||||||
// data = (data << 8) | p[i];
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// #if FURI_DEBUG
|
|
||||||
// furi_string_printf(temp_str, "Key: %lX", (uint32_t)(data & 0xFFFFFFFF));
|
|
||||||
// FURI_LOG_D(
|
|
||||||
// TAG, "H: 0x%02X, L: 0x%02X, %s", high_byte, low_byte, furi_string_get_cstr(temp_str));
|
|
||||||
// #endif
|
|
||||||
// uint8_t key_data[sizeof(uint64_t)] = {0};
|
|
||||||
// if(!flipper_format_read_hex(fff_data_file, "Key", key_data, sizeof(uint64_t))) {
|
|
||||||
// FURI_LOG_E(TAG, "Missing Key");
|
|
||||||
// result = SubBruteFileResultMissingOrIncorrectKey;
|
|
||||||
// break;
|
|
||||||
// }
|
|
||||||
// uint64_t data = 0;
|
|
||||||
// for(uint8_t i = 0; i < sizeof(uint64_t); i++) {
|
|
||||||
// data = (data << 8) | key_data[i];
|
|
||||||
// }
|
|
||||||
// instance->key_from_file = data;
|
|
||||||
|
|
||||||
// uint16_t add_value = 0x0001;
|
|
||||||
// uint8_t bit_index = 7;
|
|
||||||
// bool two_bytes = true;
|
|
||||||
|
|
||||||
// uint8_t p[8];
|
|
||||||
// for(int i = 0; i < 8; i++) {
|
|
||||||
// p[i] = (uint8_t)(instance->key_from_file >> 8 * (7 - i)) & 0xFF;
|
|
||||||
// }
|
|
||||||
// uint16_t num = two_bytes ? (p[bit_index - 1] << 8) | p[bit_index] : p[bit_index];
|
|
||||||
// FURI_LOG_D(TAG, "num: 0x%04X", num);
|
|
||||||
// num += add_value;
|
|
||||||
// FURI_LOG_D(TAG, "num added: 0x%04X", num);
|
|
||||||
// uint8_t low_byte = num & (0xff);
|
|
||||||
// uint8_t high_byte = (num >> 8) & 0xff;
|
|
||||||
|
|
||||||
// data = 0;
|
|
||||||
// for(uint8_t i = 0; i < sizeof(uint64_t); i++) {
|
|
||||||
// if(i == bit_index - 1 && two_bytes) {
|
|
||||||
// data = (data << 8) | high_byte;
|
|
||||||
// data = (data << 8) | low_byte;
|
|
||||||
// i++;
|
|
||||||
// } else if(i == bit_index) {
|
|
||||||
// data = (data << 8) | low_byte;
|
|
||||||
// } else {
|
|
||||||
// data = (data << 8) | p[i];
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
|
|
||||||
// furi_string_printf(temp_str, "Key: %lX", (uint32_t)(data & 0xFFFFFFFF));
|
|
||||||
// FURI_LOG_D(
|
|
||||||
// TAG, "H: 0x%02X, L: 0x%02X, %s", high_byte, low_byte, furi_string_get_cstr(temp_str));
|
|
||||||
|
|
||||||
// TE
|
// TE
|
||||||
if(!flipper_format_read_uint32(fff_data_file, "TE", &temp_data32, 1)) {
|
if(!flipper_format_read_uint32(fff_data_file, "TE", &temp_data32, 1)) {
|
||||||
FURI_LOG_E(TAG, "Missing or incorrect TE");
|
FURI_LOG_E(TAG, "Missing or incorrect TE");
|
||||||
@@ -487,7 +393,6 @@ void subbrute_device_attack_set_default_values(
|
|||||||
instance->bit_index = 0x00;
|
instance->bit_index = 0x00;
|
||||||
instance->extra_repeats = 0;
|
instance->extra_repeats = 0;
|
||||||
instance->two_bytes = false;
|
instance->two_bytes = false;
|
||||||
memset(instance->current_key, 0, sizeof(instance->current_key));
|
|
||||||
|
|
||||||
if(default_attack != SubBruteAttackLoadFile) {
|
if(default_attack != SubBruteAttackLoadFile) {
|
||||||
instance->max_value = subbrute_protocol_calc_max_value(
|
instance->max_value = subbrute_protocol_calc_max_value(
|
||||||
|
|||||||
@@ -49,7 +49,6 @@ typedef struct {
|
|||||||
uint8_t extra_repeats;
|
uint8_t extra_repeats;
|
||||||
|
|
||||||
// Loaded info for attack type
|
// Loaded info for attack type
|
||||||
char current_key[SUBBRUTE_PAYLOAD_SIZE];
|
|
||||||
uint64_t key_from_file;
|
uint64_t key_from_file;
|
||||||
uint64_t current_key_from_file;
|
uint64_t current_key_from_file;
|
||||||
bool two_bytes;
|
bool two_bytes;
|
||||||
|
|||||||
@@ -29,6 +29,8 @@
|
|||||||
#include "views/subbrute_attack_view.h"
|
#include "views/subbrute_attack_view.h"
|
||||||
#include "views/subbrute_main_view.h"
|
#include "views/subbrute_main_view.h"
|
||||||
|
|
||||||
|
#define SUBBRUTEFORCER_VER "Sub-GHz BruteForcer 3.4"
|
||||||
|
|
||||||
#ifdef FURI_DEBUG
|
#ifdef FURI_DEBUG
|
||||||
//#define SUBBRUTE_FAST_TRACK false
|
//#define SUBBRUTE_FAST_TRACK false
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
#include "subbrute_protocols.h"
|
#include "subbrute_protocols.h"
|
||||||
|
#include "math.h"
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
#define TAG "SubBruteProtocols"
|
#define TAG "SubBruteProtocols"
|
||||||
@@ -245,6 +246,94 @@ const SubBruteProtocol subbrute_protocol_linear_10bit_310 = {
|
|||||||
.preset = FuriHalSubGhzPresetOok650Async,
|
.preset = FuriHalSubGhzPresetOok650Async,
|
||||||
.file = LinearFileProtocol};
|
.file = LinearFileProtocol};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* UNILARM 24bit 330MHz
|
||||||
|
*/
|
||||||
|
const SubBruteProtocol subbrute_protocol_unilarm_24bit_330 = {
|
||||||
|
.frequency = 330000000,
|
||||||
|
.bits = 25,
|
||||||
|
.te = 209,
|
||||||
|
.repeat = 5,
|
||||||
|
.preset = FuriHalSubGhzPresetOok650Async,
|
||||||
|
.file = UNILARMFileProtocol};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* UNILARM 24bit 433MHz
|
||||||
|
*/
|
||||||
|
const SubBruteProtocol subbrute_protocol_unilarm_24bit_433 = {
|
||||||
|
.frequency = 433920000,
|
||||||
|
.bits = 25,
|
||||||
|
.te = 209,
|
||||||
|
.repeat = 5,
|
||||||
|
.preset = FuriHalSubGhzPresetOok650Async,
|
||||||
|
.file = UNILARMFileProtocol};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* SMC5326 24bit 330MHz
|
||||||
|
*/
|
||||||
|
const SubBruteProtocol subbrute_protocol_smc5326_24bit_330 = {
|
||||||
|
.frequency = 330000000,
|
||||||
|
.bits = 25,
|
||||||
|
.te = 320,
|
||||||
|
.repeat = 5,
|
||||||
|
.preset = FuriHalSubGhzPresetOok650Async,
|
||||||
|
.file = SMC5326FileProtocol};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* SMC5326 24bit 433MHz
|
||||||
|
*/
|
||||||
|
const SubBruteProtocol subbrute_protocol_smc5326_24bit_433 = {
|
||||||
|
.frequency = 433920000,
|
||||||
|
.bits = 25,
|
||||||
|
.te = 320,
|
||||||
|
.repeat = 5,
|
||||||
|
.preset = FuriHalSubGhzPresetOok650Async,
|
||||||
|
.file = SMC5326FileProtocol};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* PT2260 (Princeton) 24bit 315MHz
|
||||||
|
*/
|
||||||
|
const SubBruteProtocol subbrute_protocol_pt2260_24bit_315 = {
|
||||||
|
.frequency = 315000000,
|
||||||
|
.bits = 24,
|
||||||
|
.te = 286,
|
||||||
|
.repeat = 5,
|
||||||
|
.preset = FuriHalSubGhzPresetOok650Async,
|
||||||
|
.file = PT2260FileProtocol};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* PT2260 (Princeton) 24bit 330MHz
|
||||||
|
*/
|
||||||
|
const SubBruteProtocol subbrute_protocol_pt2260_24bit_330 = {
|
||||||
|
.frequency = 330000000,
|
||||||
|
.bits = 24,
|
||||||
|
.te = 286,
|
||||||
|
.repeat = 5,
|
||||||
|
.preset = FuriHalSubGhzPresetOok650Async,
|
||||||
|
.file = PT2260FileProtocol};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* PT2260 (Princeton) 24bit 390MHz
|
||||||
|
*/
|
||||||
|
const SubBruteProtocol subbrute_protocol_pt2260_24bit_390 = {
|
||||||
|
.frequency = 390000000,
|
||||||
|
.bits = 24,
|
||||||
|
.te = 286,
|
||||||
|
.repeat = 5,
|
||||||
|
.preset = FuriHalSubGhzPresetOok650Async,
|
||||||
|
.file = PT2260FileProtocol};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* PT2260 (Princeton) 24bit 433MHz
|
||||||
|
*/
|
||||||
|
const SubBruteProtocol subbrute_protocol_pt2260_24bit_433 = {
|
||||||
|
.frequency = 433920000,
|
||||||
|
.bits = 24,
|
||||||
|
.te = 286,
|
||||||
|
.repeat = 5,
|
||||||
|
.preset = FuriHalSubGhzPresetOok650Async,
|
||||||
|
.file = PT2260FileProtocol};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* BF existing dump
|
* BF existing dump
|
||||||
*/
|
*/
|
||||||
@@ -274,6 +363,14 @@ static const char* subbrute_protocol_names[] = {
|
|||||||
[SubBruteAttackChamberlain7bit390] = "Chamberlain 7bit 390MHz",
|
[SubBruteAttackChamberlain7bit390] = "Chamberlain 7bit 390MHz",
|
||||||
[SubBruteAttackLinear10bit300] = "Linear 10bit 300MHz",
|
[SubBruteAttackLinear10bit300] = "Linear 10bit 300MHz",
|
||||||
[SubBruteAttackLinear10bit310] = "Linear 10bit 310MHz",
|
[SubBruteAttackLinear10bit310] = "Linear 10bit 310MHz",
|
||||||
|
[SubBruteAttackUNILARM24bit330] = "UNILARM 25bit 330MHz",
|
||||||
|
[SubBruteAttackUNILARM24bit433] = "UNILARM 25bit 433MHz",
|
||||||
|
[SubBruteAttackSMC532624bit330] = "SMC5326 25bit 330MHz",
|
||||||
|
[SubBruteAttackSMC532624bit433] = "SMC5326 25bit 433MHz",
|
||||||
|
[SubBruteAttackPT226024bit315] = "PT2260 24bit 315MHz",
|
||||||
|
[SubBruteAttackPT226024bit330] = "PT2260 24bit 330MHz",
|
||||||
|
[SubBruteAttackPT226024bit390] = "PT2260 24bit 390MHz",
|
||||||
|
[SubBruteAttackPT226024bit433] = "PT2260 24bit 433MHz",
|
||||||
[SubBruteAttackLoadFile] = "BF existing dump",
|
[SubBruteAttackLoadFile] = "BF existing dump",
|
||||||
[SubBruteAttackTotalCount] = "Total Count",
|
[SubBruteAttackTotalCount] = "Total Count",
|
||||||
};
|
};
|
||||||
@@ -311,6 +408,14 @@ const SubBruteProtocol* subbrute_protocol_registry[] = {
|
|||||||
[SubBruteAttackChamberlain7bit390] = &subbrute_protocol_chamberlain_7bit_390,
|
[SubBruteAttackChamberlain7bit390] = &subbrute_protocol_chamberlain_7bit_390,
|
||||||
[SubBruteAttackLinear10bit300] = &subbrute_protocol_linear_10bit_300,
|
[SubBruteAttackLinear10bit300] = &subbrute_protocol_linear_10bit_300,
|
||||||
[SubBruteAttackLinear10bit310] = &subbrute_protocol_linear_10bit_310,
|
[SubBruteAttackLinear10bit310] = &subbrute_protocol_linear_10bit_310,
|
||||||
|
[SubBruteAttackUNILARM24bit330] = &subbrute_protocol_unilarm_24bit_330,
|
||||||
|
[SubBruteAttackUNILARM24bit433] = &subbrute_protocol_unilarm_24bit_433,
|
||||||
|
[SubBruteAttackSMC532624bit330] = &subbrute_protocol_smc5326_24bit_330,
|
||||||
|
[SubBruteAttackSMC532624bit433] = &subbrute_protocol_smc5326_24bit_433,
|
||||||
|
[SubBruteAttackPT226024bit315] = &subbrute_protocol_pt2260_24bit_315,
|
||||||
|
[SubBruteAttackPT226024bit330] = &subbrute_protocol_pt2260_24bit_330,
|
||||||
|
[SubBruteAttackPT226024bit390] = &subbrute_protocol_pt2260_24bit_390,
|
||||||
|
[SubBruteAttackPT226024bit433] = &subbrute_protocol_pt2260_24bit_433,
|
||||||
[SubBruteAttackLoadFile] = &subbrute_protocol_load_file};
|
[SubBruteAttackLoadFile] = &subbrute_protocol_load_file};
|
||||||
|
|
||||||
static const char* subbrute_protocol_file_types[] = {
|
static const char* subbrute_protocol_file_types[] = {
|
||||||
@@ -327,6 +432,9 @@ static const char* subbrute_protocol_file_types[] = {
|
|||||||
[MagellanFileProtocol] = "Magellan",
|
[MagellanFileProtocol] = "Magellan",
|
||||||
[IntertechnoV3FileProtocol] = "Intertechno_V3",
|
[IntertechnoV3FileProtocol] = "Intertechno_V3",
|
||||||
[AnsonicFileProtocol] = "Ansonic",
|
[AnsonicFileProtocol] = "Ansonic",
|
||||||
|
[SMC5326FileProtocol] = "SMC5326",
|
||||||
|
[UNILARMFileProtocol] = "SMC5326",
|
||||||
|
[PT2260FileProtocol] = "Princeton",
|
||||||
[HoneywellFileProtocol] = "Honeywell",
|
[HoneywellFileProtocol] = "Honeywell",
|
||||||
[UnknownFileProtocol] = "Unknown"};
|
[UnknownFileProtocol] = "Unknown"};
|
||||||
|
|
||||||
@@ -338,6 +446,8 @@ static const char* subbrute_key_file_start_no_tail =
|
|||||||
static const char* subbrute_key_file_start_with_tail =
|
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\nRepeat: %d\n";
|
||||||
static const char* subbrute_key_small_no_tail = "Bit: %d\nKey: %s\nRepeat: %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";
|
||||||
static const char* subbrute_key_small_with_tail = "Bit: %d\nKey: %s\nTE: %d\nRepeat: %d\n";
|
static const char* subbrute_key_small_with_tail = "Bit: %d\nKey: %s\nTE: %d\nRepeat: %d\n";
|
||||||
|
|
||||||
const char* subbrute_protocol_name(SubBruteAttacks index) {
|
const char* subbrute_protocol_name(SubBruteAttacks index) {
|
||||||
@@ -416,10 +526,68 @@ void subbrute_protocol_create_candidate_for_existing_file(
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
void subbrute_protocol_create_candidate_for_default(FuriString* candidate, uint64_t step) {
|
void subbrute_protocol_create_candidate_for_default(
|
||||||
|
FuriString* candidate,
|
||||||
|
SubBruteFileProtocol file,
|
||||||
|
uint64_t step) {
|
||||||
uint8_t p[8];
|
uint8_t p[8];
|
||||||
for(int i = 0; i < 8; i++) {
|
if(file == SMC5326FileProtocol) {
|
||||||
p[i] = (uint8_t)(step >> 8 * (7 - i)) & 0xFF;
|
const uint8_t lut[] = {0x00, 0x02, 0x03}; // 00, 10, 11
|
||||||
|
const uint64_t gate1 = 0x01D5; // 111010101
|
||||||
|
//const uint8_t gate2 = 0x0175; // 101110101
|
||||||
|
|
||||||
|
uint64_t total = 0;
|
||||||
|
for(size_t j = 0; j < 8; j++) {
|
||||||
|
total |= lut[step % 3] << (2 * j);
|
||||||
|
double sub_step = step / 3;
|
||||||
|
step = (uint64_t)floor(sub_step);
|
||||||
|
}
|
||||||
|
total <<= 9;
|
||||||
|
total |= gate1;
|
||||||
|
|
||||||
|
for(int i = 0; i < 8; i++) {
|
||||||
|
p[i] = (uint8_t)(total >> 8 * (7 - i)) & 0xFF;
|
||||||
|
}
|
||||||
|
} else if(file == UNILARMFileProtocol) {
|
||||||
|
const uint8_t lut[] = {0x00, 0x02, 0x03}; // 00, 10, 11
|
||||||
|
const uint64_t gate1 = 3 << 7;
|
||||||
|
//const uint8_t gate2 = 3 << 5;
|
||||||
|
|
||||||
|
uint64_t total = 0;
|
||||||
|
for(size_t j = 0; j < 8; j++) {
|
||||||
|
total |= lut[step % 3] << (2 * j);
|
||||||
|
double sub_step = step / 3;
|
||||||
|
step = (uint64_t)floor(sub_step);
|
||||||
|
}
|
||||||
|
total <<= 9;
|
||||||
|
total |= gate1;
|
||||||
|
|
||||||
|
for(int i = 0; i < 8; i++) {
|
||||||
|
p[i] = (uint8_t)(total >> 8 * (7 - i)) & 0xFF;
|
||||||
|
}
|
||||||
|
} else if(file == PT2260FileProtocol) {
|
||||||
|
const uint8_t lut[] = {0x00, 0x01, 0x03}; // 00, 01, 11
|
||||||
|
const uint64_t button_open = 0x03; // 11
|
||||||
|
//const uint8_t button_lock = 0x0C; // 1100
|
||||||
|
//const uint8_t button_stop = 0x30; // 110000
|
||||||
|
//const uint8_t button_close = 0xC0; // 11000000
|
||||||
|
|
||||||
|
uint64_t total = 0;
|
||||||
|
for(size_t j = 0; j < 8; j++) {
|
||||||
|
total |= lut[step % 3] << (2 * j);
|
||||||
|
double sub_step = step / 3;
|
||||||
|
step = (uint64_t)floor(sub_step);
|
||||||
|
}
|
||||||
|
total <<= 8;
|
||||||
|
total |= button_open;
|
||||||
|
|
||||||
|
for(int i = 0; i < 8; i++) {
|
||||||
|
p[i] = (uint8_t)(total >> 8 * (7 - i)) & 0xFF;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
for(int i = 0; i < 8; i++) {
|
||||||
|
p[i] = (uint8_t)(step >> 8 * (7 - i)) & 0xFF;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
size_t size = sizeof(uint64_t);
|
size_t size = sizeof(uint64_t);
|
||||||
@@ -442,12 +610,13 @@ void subbrute_protocol_create_candidate_for_default(FuriString* candidate, uint6
|
|||||||
|
|
||||||
void subbrute_protocol_default_payload(
|
void subbrute_protocol_default_payload(
|
||||||
Stream* stream,
|
Stream* stream,
|
||||||
|
SubBruteFileProtocol file,
|
||||||
uint64_t step,
|
uint64_t step,
|
||||||
uint8_t bits,
|
uint8_t bits,
|
||||||
uint8_t te,
|
uint32_t te,
|
||||||
uint8_t repeat) {
|
uint8_t repeat) {
|
||||||
FuriString* candidate = furi_string_alloc();
|
FuriString* candidate = furi_string_alloc();
|
||||||
subbrute_protocol_create_candidate_for_default(candidate, step);
|
subbrute_protocol_create_candidate_for_default(candidate, file, step);
|
||||||
|
|
||||||
#ifdef FURI_DEBUG
|
#ifdef FURI_DEBUG
|
||||||
FURI_LOG_D(
|
FURI_LOG_D(
|
||||||
@@ -479,7 +648,7 @@ void subbrute_protocol_file_payload(
|
|||||||
Stream* stream,
|
Stream* stream,
|
||||||
uint64_t step,
|
uint64_t step,
|
||||||
uint8_t bits,
|
uint8_t bits,
|
||||||
uint8_t te,
|
uint32_t te,
|
||||||
uint8_t repeat,
|
uint8_t repeat,
|
||||||
uint8_t bit_index,
|
uint8_t bit_index,
|
||||||
uint64_t file_key,
|
uint64_t file_key,
|
||||||
@@ -522,10 +691,10 @@ void subbrute_protocol_default_generate_file(
|
|||||||
SubBruteFileProtocol file,
|
SubBruteFileProtocol file,
|
||||||
uint64_t step,
|
uint64_t step,
|
||||||
uint8_t bits,
|
uint8_t bits,
|
||||||
uint8_t te,
|
uint32_t te,
|
||||||
uint8_t repeat) {
|
uint8_t repeat) {
|
||||||
FuriString* candidate = furi_string_alloc();
|
FuriString* candidate = furi_string_alloc();
|
||||||
subbrute_protocol_create_candidate_for_default(candidate, step);
|
subbrute_protocol_create_candidate_for_default(candidate, file, step);
|
||||||
|
|
||||||
#ifdef FURI_DEBUG
|
#ifdef FURI_DEBUG
|
||||||
FURI_LOG_D(TAG, "candidate: %s, step: %lld", furi_string_get_cstr(candidate), step);
|
FURI_LOG_D(TAG, "candidate: %s, step: %lld", furi_string_get_cstr(candidate), step);
|
||||||
@@ -565,7 +734,7 @@ void subbrute_protocol_file_generate_file(
|
|||||||
SubBruteFileProtocol file,
|
SubBruteFileProtocol file,
|
||||||
uint64_t step,
|
uint64_t step,
|
||||||
uint8_t bits,
|
uint8_t bits,
|
||||||
uint8_t te,
|
uint32_t te,
|
||||||
uint8_t repeat,
|
uint8_t repeat,
|
||||||
uint8_t bit_index,
|
uint8_t bit_index,
|
||||||
uint64_t file_key,
|
uint64_t file_key,
|
||||||
@@ -608,6 +777,16 @@ uint64_t
|
|||||||
uint64_t max_value;
|
uint64_t max_value;
|
||||||
if(attack_type == SubBruteAttackLoadFile) {
|
if(attack_type == SubBruteAttackLoadFile) {
|
||||||
max_value = two_bytes ? 0xFFFF : 0xFF;
|
max_value = two_bytes ? 0xFFFF : 0xFF;
|
||||||
|
} else if(
|
||||||
|
attack_type == SubBruteAttackSMC532624bit330 ||
|
||||||
|
attack_type == SubBruteAttackSMC532624bit433 ||
|
||||||
|
attack_type == SubBruteAttackUNILARM24bit330 ||
|
||||||
|
attack_type == SubBruteAttackUNILARM24bit433 ||
|
||||||
|
attack_type == SubBruteAttackPT226024bit315 ||
|
||||||
|
attack_type == SubBruteAttackPT226024bit330 ||
|
||||||
|
attack_type == SubBruteAttackPT226024bit390 ||
|
||||||
|
attack_type == SubBruteAttackPT226024bit433) {
|
||||||
|
max_value = 6561;
|
||||||
} else {
|
} else {
|
||||||
FuriString* max_value_s;
|
FuriString* max_value_s;
|
||||||
max_value_s = furi_string_alloc();
|
max_value_s = furi_string_alloc();
|
||||||
|
|||||||
@@ -19,6 +19,9 @@ typedef enum {
|
|||||||
MagellanFileProtocol,
|
MagellanFileProtocol,
|
||||||
IntertechnoV3FileProtocol,
|
IntertechnoV3FileProtocol,
|
||||||
AnsonicFileProtocol,
|
AnsonicFileProtocol,
|
||||||
|
SMC5326FileProtocol,
|
||||||
|
UNILARMFileProtocol,
|
||||||
|
PT2260FileProtocol,
|
||||||
HoneywellFileProtocol,
|
HoneywellFileProtocol,
|
||||||
UnknownFileProtocol,
|
UnknownFileProtocol,
|
||||||
TotalFileProtocol,
|
TotalFileProtocol,
|
||||||
@@ -47,6 +50,14 @@ typedef enum {
|
|||||||
SubBruteAttackChamberlain7bit390,
|
SubBruteAttackChamberlain7bit390,
|
||||||
SubBruteAttackLinear10bit300,
|
SubBruteAttackLinear10bit300,
|
||||||
SubBruteAttackLinear10bit310,
|
SubBruteAttackLinear10bit310,
|
||||||
|
SubBruteAttackUNILARM24bit330,
|
||||||
|
SubBruteAttackUNILARM24bit433,
|
||||||
|
SubBruteAttackSMC532624bit330,
|
||||||
|
SubBruteAttackSMC532624bit433,
|
||||||
|
SubBruteAttackPT226024bit315,
|
||||||
|
SubBruteAttackPT226024bit330,
|
||||||
|
SubBruteAttackPT226024bit390,
|
||||||
|
SubBruteAttackPT226024bit433,
|
||||||
SubBruteAttackLoadFile,
|
SubBruteAttackLoadFile,
|
||||||
SubBruteAttackTotalCount,
|
SubBruteAttackTotalCount,
|
||||||
} SubBruteAttacks;
|
} SubBruteAttacks;
|
||||||
@@ -54,7 +65,7 @@ typedef enum {
|
|||||||
typedef struct {
|
typedef struct {
|
||||||
uint32_t frequency;
|
uint32_t frequency;
|
||||||
uint8_t bits;
|
uint8_t bits;
|
||||||
uint8_t te;
|
uint32_t te;
|
||||||
uint8_t repeat;
|
uint8_t repeat;
|
||||||
FuriHalSubGhzPreset preset;
|
FuriHalSubGhzPreset preset;
|
||||||
SubBruteFileProtocol file;
|
SubBruteFileProtocol file;
|
||||||
@@ -70,15 +81,16 @@ const char* subbrute_protocol_name(SubBruteAttacks index);
|
|||||||
|
|
||||||
void subbrute_protocol_default_payload(
|
void subbrute_protocol_default_payload(
|
||||||
Stream* stream,
|
Stream* stream,
|
||||||
|
SubBruteFileProtocol file,
|
||||||
uint64_t step,
|
uint64_t step,
|
||||||
uint8_t bits,
|
uint8_t bits,
|
||||||
uint8_t te,
|
uint32_t te,
|
||||||
uint8_t repeat);
|
uint8_t repeat);
|
||||||
void subbrute_protocol_file_payload(
|
void subbrute_protocol_file_payload(
|
||||||
Stream* stream,
|
Stream* stream,
|
||||||
uint64_t step,
|
uint64_t step,
|
||||||
uint8_t bits,
|
uint8_t bits,
|
||||||
uint8_t te,
|
uint32_t te,
|
||||||
uint8_t repeat,
|
uint8_t repeat,
|
||||||
uint8_t bit_index,
|
uint8_t bit_index,
|
||||||
uint64_t file_key,
|
uint64_t file_key,
|
||||||
@@ -90,7 +102,7 @@ void subbrute_protocol_default_generate_file(
|
|||||||
SubBruteFileProtocol file,
|
SubBruteFileProtocol file,
|
||||||
uint64_t step,
|
uint64_t step,
|
||||||
uint8_t bits,
|
uint8_t bits,
|
||||||
uint8_t te,
|
uint32_t te,
|
||||||
uint8_t repeat);
|
uint8_t repeat);
|
||||||
void subbrute_protocol_file_generate_file(
|
void subbrute_protocol_file_generate_file(
|
||||||
Stream* stream,
|
Stream* stream,
|
||||||
@@ -99,7 +111,7 @@ void subbrute_protocol_file_generate_file(
|
|||||||
SubBruteFileProtocol file,
|
SubBruteFileProtocol file,
|
||||||
uint64_t step,
|
uint64_t step,
|
||||||
uint8_t bits,
|
uint8_t bits,
|
||||||
uint8_t te,
|
uint32_t te,
|
||||||
uint8_t repeat,
|
uint8_t repeat,
|
||||||
uint8_t bit_index,
|
uint8_t bit_index,
|
||||||
uint64_t file_key,
|
uint64_t file_key,
|
||||||
|
|||||||
@@ -149,7 +149,7 @@ void subbrute_main_view_draw(Canvas* canvas, SubBruteMainViewModel* model) {
|
|||||||
canvas_set_font(canvas, FontPrimary);
|
canvas_set_font(canvas, FontPrimary);
|
||||||
canvas_draw_box(canvas, 0, 0, canvas_width(canvas), STATUS_BAR_Y_SHIFT);
|
canvas_draw_box(canvas, 0, 0, canvas_width(canvas), STATUS_BAR_Y_SHIFT);
|
||||||
canvas_invert_color(canvas);
|
canvas_invert_color(canvas);
|
||||||
canvas_draw_str_aligned(canvas, 64, 3, AlignCenter, AlignTop, "Sub-GHz BruteForcer 3.3");
|
canvas_draw_str_aligned(canvas, 64, 3, AlignCenter, AlignTop, SUBBRUTEFORCER_VER);
|
||||||
canvas_invert_color(canvas);
|
canvas_invert_color(canvas);
|
||||||
|
|
||||||
// Menu
|
// Menu
|
||||||
|
|||||||
Reference in New Issue
Block a user