2022-09-30 17:36:56 +03:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <furi.h>
|
|
|
|
#include <furi_hal_subghz.h>
|
2022-10-08 01:24:19 +03:00
|
|
|
#include <core/string.h>
|
2022-10-10 01:52:32 +03:00
|
|
|
#include <toolbox/stream/stream.h>
|
2022-09-30 17:36:56 +03:00
|
|
|
//typedef enum {
|
|
|
|
// FrequencyProtocolField,
|
|
|
|
// BitsProtocolField,
|
|
|
|
// HasTeProtocolField,
|
|
|
|
// RepeatProtocolField,
|
|
|
|
// PresetProtocolField,
|
|
|
|
// FileProtocolField,
|
|
|
|
// TotalProtocolFields
|
|
|
|
//} ProtocolFields;
|
|
|
|
|
|
|
|
typedef enum {
|
|
|
|
CAMEFileProtocol,
|
|
|
|
NICEFileProtocol,
|
|
|
|
ChamberlainFileProtocol,
|
|
|
|
LinearFileProtocol,
|
|
|
|
PrincetonFileProtocol,
|
|
|
|
RAWFileProtocol,
|
|
|
|
TotalFileProtocol,
|
|
|
|
} SubBruteFileProtocol;
|
|
|
|
|
2022-10-08 01:24:19 +03:00
|
|
|
typedef enum {
|
|
|
|
SubBruteAttackCAME12bit303,
|
|
|
|
SubBruteAttackCAME12bit307,
|
|
|
|
SubBruteAttackCAME12bit433,
|
|
|
|
SubBruteAttackCAME12bit868,
|
|
|
|
SubBruteAttackNICE12bit433,
|
|
|
|
SubBruteAttackNICE12bit868,
|
|
|
|
SubBruteAttackChamberlain9bit300,
|
|
|
|
SubBruteAttackChamberlain9bit315,
|
|
|
|
SubBruteAttackChamberlain9bit390,
|
|
|
|
SubBruteAttackLinear10bit300,
|
|
|
|
SubBruteAttackLinear10bit310,
|
|
|
|
SubBruteAttackLoadFile,
|
|
|
|
SubBruteAttackTotalCount,
|
|
|
|
} SubBruteAttacks;
|
|
|
|
|
2022-09-30 17:36:56 +03:00
|
|
|
typedef struct {
|
|
|
|
uint32_t frequency;
|
|
|
|
uint8_t bits;
|
|
|
|
uint8_t te;
|
|
|
|
uint8_t repeat;
|
|
|
|
FuriHalSubGhzPreset preset;
|
|
|
|
SubBruteFileProtocol file;
|
|
|
|
} SubBruteProtocol;
|
|
|
|
|
2022-10-08 20:53:31 +03:00
|
|
|
const SubBruteProtocol* subbrute_protocol(SubBruteAttacks index);
|
2022-09-30 17:36:56 +03:00
|
|
|
const char* subbrute_protocol_preset(FuriHalSubGhzPreset preset);
|
|
|
|
const char* subbrute_protocol_file(SubBruteFileProtocol protocol);
|
2022-10-08 01:24:19 +03:00
|
|
|
FuriHalSubGhzPreset subbrute_protocol_convert_preset(FuriString* preset_name);
|
|
|
|
SubBruteFileProtocol subbrute_protocol_file_protocol_name(FuriString* name);
|
2022-10-09 23:35:44 +03:00
|
|
|
const char* subbrute_protocol_name(SubBruteAttacks index);
|
|
|
|
|
2022-10-10 01:52:32 +03:00
|
|
|
void subbrute_protocol_default_payload(
|
|
|
|
Stream* stream,
|
|
|
|
uint64_t step,
|
|
|
|
uint8_t bits,
|
|
|
|
uint8_t te,
|
|
|
|
uint8_t repeat);
|
|
|
|
void subbrute_protocol_file_payload(
|
|
|
|
Stream* stream,
|
2022-10-09 23:35:44 +03:00
|
|
|
uint64_t step,
|
|
|
|
uint8_t bits,
|
|
|
|
uint8_t te,
|
|
|
|
uint8_t repeat,
|
|
|
|
uint8_t load_index,
|
|
|
|
const char* file_key);
|
2022-10-10 01:52:32 +03:00
|
|
|
void subbrute_protocol_default_generate_file(
|
|
|
|
Stream* stream,
|
2022-10-09 23:35:44 +03:00
|
|
|
uint32_t frequency,
|
|
|
|
FuriHalSubGhzPreset preset,
|
|
|
|
SubBruteFileProtocol file,
|
|
|
|
uint64_t step,
|
|
|
|
uint8_t bits,
|
|
|
|
uint8_t te,
|
|
|
|
uint8_t repeat);
|
2022-10-10 01:52:32 +03:00
|
|
|
void subbrute_protocol_file_generate_file(
|
|
|
|
Stream* stream,
|
2022-10-09 23:35:44 +03:00
|
|
|
uint32_t frequency,
|
|
|
|
FuriHalSubGhzPreset preset,
|
|
|
|
SubBruteFileProtocol file,
|
|
|
|
uint64_t step,
|
|
|
|
uint8_t bits,
|
|
|
|
uint8_t te,
|
|
|
|
uint8_t repeat,
|
|
|
|
uint8_t load_index,
|
|
|
|
const char* file_key);
|
|
|
|
uint64_t subbrute_protocol_calc_max_value(SubBruteAttacks attack_type, uint8_t bits);
|