|
|
@@ -1,41 +1,155 @@
|
|
|
#include "subbrute_protocols.h"
|
|
|
|
|
|
-static const SubBruteProtocol subbrute_protocols[SubBruteAttackTotalCount] = {
|
|
|
- [SubBruteAttackCAME12bit303] =
|
|
|
- {303875000, 12, 0, 3, FuriHalSubGhzPresetOok650Async, CAMEFileProtocol},
|
|
|
- [SubBruteAttackCAME12bit307] =
|
|
|
- {307800000, 12, 0, 3, FuriHalSubGhzPresetOok650Async, CAMEFileProtocol},
|
|
|
- [SubBruteAttackCAME12bit433] =
|
|
|
- {433920000, 12, 0, 3, FuriHalSubGhzPresetOok650Async, CAMEFileProtocol},
|
|
|
- [SubBruteAttackCAME12bit868] =
|
|
|
- {868350000, 12, 0, 3, FuriHalSubGhzPresetOok650Async, CAMEFileProtocol},
|
|
|
- [SubBruteAttackNICE12bit433] =
|
|
|
- {433920000, 12, 0, 3, FuriHalSubGhzPresetOok650Async, NICEFileProtocol},
|
|
|
- [SubBruteAttackNICE12bit868] =
|
|
|
- {868350000, 12, 0, 3, FuriHalSubGhzPresetOok650Async, NICEFileProtocol},
|
|
|
- [SubBruteAttackChamberlain9bit300] =
|
|
|
- {300000000, 9, 0, 3, FuriHalSubGhzPresetOok650Async, ChamberlainFileProtocol},
|
|
|
- [SubBruteAttackChamberlain9bit315] =
|
|
|
- {315000000, 9, 0, 3, FuriHalSubGhzPresetOok650Async, ChamberlainFileProtocol},
|
|
|
- [SubBruteAttackChamberlain9bit390] =
|
|
|
- {390000000, 9, 0, 3, FuriHalSubGhzPresetOok650Async, ChamberlainFileProtocol},
|
|
|
- [SubBruteAttackLinear10bit300] =
|
|
|
- {300000000, 10, 0, 5, FuriHalSubGhzPresetOok650Async, LinearFileProtocol},
|
|
|
- [SubBruteAttackLinear10bit310] =
|
|
|
- {300000000, 10, 0, 5, FuriHalSubGhzPresetOok650Async, LinearFileProtocol},
|
|
|
- [SubBruteAttackLoadFile] = {0, 0, 0, 3, FuriHalSubGhzPresetOok650Async, RAWFileProtocol},
|
|
|
-};
|
|
|
-//static const uint32_t subbrute_protocols[SubBruteAttackTotalCount][TotalProtocolFields] = {
|
|
|
-// [SubBruteAttackCAME12bit307] = {307800000, 12, 0, 3, FuriHalSubGhzPresetOok650Async, CAMEFileProtocol},
|
|
|
-// [SubBruteAttackCAME12bit433] = {433920000, 12, 0, 3, FuriHalSubGhzPresetOok650Async, CAMEFileProtocol},
|
|
|
-// [SubBruteAttackCAME12bit868] = {868350000, 12, 0, 3, FuriHalSubGhzPresetOok650Async, CAMEFileProtocol},
|
|
|
-// [SubBruteAttackNICE12bit433] = {433920000, 12, 0, 3, FuriHalSubGhzPresetOok650Async, NICEFileProtocol},
|
|
|
-// [SubBruteAttackNICE12bit868] = {868350000, 12, 0, 3, FuriHalSubGhzPresetOok650Async, NICEFileProtocol},
|
|
|
-// [SubBruteAttackChamberlain9bit300] = {300000000, 9, 0, 3, FuriHalSubGhzPresetOok650Async, ChamberlainFileProtocol},
|
|
|
-// [SubBruteAttackChamberlain9bit315] = {315000000, 9, 0, 3, FuriHalSubGhzPresetOok650Async, ChamberlainFileProtocol},
|
|
|
-// [SubBruteAttackChamberlain9bit390] = {390000000, 9, 0, 3, FuriHalSubGhzPresetOok650Async, ChamberlainFileProtocol},
|
|
|
-// [SubBruteAttackLinear10bit300] = {300000000, 10, 0, 5, FuriHalSubGhzPresetOok650Async, LinearFileProtocol},
|
|
|
-// [SubBruteAttackLinear10bit310] = {300000000, 10, 0, 5, FuriHalSubGhzPresetOok650Async, LinearFileProtocol},
|
|
|
+/**
|
|
|
+ * CAME 12bit 303MHz
|
|
|
+ */
|
|
|
+const SubBruteProtocol subbrute_protocol_came_12bit_303 = {
|
|
|
+ .frequency = 303875000,
|
|
|
+ .bits = 12,
|
|
|
+ .te = 0,
|
|
|
+ .repeat = 3,
|
|
|
+ .preset = FuriHalSubGhzPresetOok650Async,
|
|
|
+ .file = CAMEFileProtocol};
|
|
|
+
|
|
|
+/**
|
|
|
+ * CAME 12bit 307MHz
|
|
|
+ */
|
|
|
+const SubBruteProtocol subbrute_protocol_came_12bit_307 = {
|
|
|
+ .frequency = 307800000,
|
|
|
+ .bits = 12,
|
|
|
+ .te = 0,
|
|
|
+ .repeat = 3,
|
|
|
+ .preset = FuriHalSubGhzPresetOok650Async,
|
|
|
+ .file = CAMEFileProtocol};
|
|
|
+
|
|
|
+/**
|
|
|
+ * CAME 12bit 433MHz
|
|
|
+ */
|
|
|
+const SubBruteProtocol subbrute_protocol_came_12bit_433 = {
|
|
|
+ .frequency = 433920000,
|
|
|
+ .bits = 12,
|
|
|
+ .te = 0,
|
|
|
+ .repeat = 3,
|
|
|
+ .preset = FuriHalSubGhzPresetOok650Async,
|
|
|
+ .file = CAMEFileProtocol};
|
|
|
+
|
|
|
+/**
|
|
|
+ * CAME 12bit 868MHz
|
|
|
+ */
|
|
|
+const SubBruteProtocol subbrute_protocol_came_12bit_868 = {
|
|
|
+ .frequency = 868350000,
|
|
|
+ .bits = 12,
|
|
|
+ .te = 0,
|
|
|
+ .repeat = 3,
|
|
|
+ .preset = FuriHalSubGhzPresetOok650Async,
|
|
|
+ .file = CAMEFileProtocol};
|
|
|
+
|
|
|
+/**
|
|
|
+ * NICE 12bit 433MHz
|
|
|
+ */
|
|
|
+const SubBruteProtocol subbrute_protocol_nice_12bit_433 = {
|
|
|
+ .frequency = 433920000,
|
|
|
+ .bits = 12,
|
|
|
+ .te = 0,
|
|
|
+ .repeat = 3,
|
|
|
+ .preset = FuriHalSubGhzPresetOok650Async,
|
|
|
+ .file = NICEFileProtocol};
|
|
|
+
|
|
|
+/**
|
|
|
+ * NICE 12bit 868MHz
|
|
|
+ */
|
|
|
+const SubBruteProtocol subbrute_protocol_nice_12bit_868 = {
|
|
|
+ .frequency = 868350000,
|
|
|
+ .bits = 12,
|
|
|
+ .te = 0,
|
|
|
+ .repeat = 3,
|
|
|
+ .preset = FuriHalSubGhzPresetOok650Async,
|
|
|
+ .file = NICEFileProtocol};
|
|
|
+
|
|
|
+/**
|
|
|
+ * Chamberlain 9bit 300MHz
|
|
|
+ */
|
|
|
+const SubBruteProtocol subbrute_protocol_chamberlain_9bit_300 = {
|
|
|
+ .frequency = 300000000,
|
|
|
+ .bits = 9,
|
|
|
+ .te = 0,
|
|
|
+ .repeat = 3,
|
|
|
+ .preset = FuriHalSubGhzPresetOok650Async,
|
|
|
+ .file = ChamberlainFileProtocol};
|
|
|
+
|
|
|
+/**
|
|
|
+ * Chamberlain 9bit 315MHz
|
|
|
+ */
|
|
|
+const SubBruteProtocol subbrute_protocol_chamberlain_9bit_315 = {
|
|
|
+ .frequency = 315000000,
|
|
|
+ .bits = 9,
|
|
|
+ .te = 0,
|
|
|
+ .repeat = 3,
|
|
|
+ .preset = FuriHalSubGhzPresetOok650Async,
|
|
|
+ .file = ChamberlainFileProtocol};
|
|
|
+
|
|
|
+/**
|
|
|
+ * Chamberlain 9bit 390MHz
|
|
|
+ */
|
|
|
+const SubBruteProtocol subbrute_protocol_chamberlain_9bit_390 = {
|
|
|
+ .frequency = 390000000,
|
|
|
+ .bits = 9,
|
|
|
+ .te = 0,
|
|
|
+ .repeat = 3,
|
|
|
+ .preset = FuriHalSubGhzPresetOok650Async,
|
|
|
+ .file = ChamberlainFileProtocol};
|
|
|
+
|
|
|
+/**
|
|
|
+ * Linear 10bit 300MHz
|
|
|
+ */
|
|
|
+const SubBruteProtocol subbrute_protocol_linear_10bit_300 = {
|
|
|
+ .frequency = 300000000,
|
|
|
+ .bits = 10,
|
|
|
+ .te = 0,
|
|
|
+ .repeat = 5,
|
|
|
+ .preset = FuriHalSubGhzPresetOok650Async,
|
|
|
+ .file = LinearFileProtocol};
|
|
|
+
|
|
|
+/**
|
|
|
+ * Linear 10bit 310MHz
|
|
|
+ */
|
|
|
+const SubBruteProtocol subbrute_protocol_linear_10bit_310 = {
|
|
|
+ .frequency = 310000000,
|
|
|
+ .bits = 10,
|
|
|
+ .te = 0,
|
|
|
+ .repeat = 5,
|
|
|
+ .preset = FuriHalSubGhzPresetOok650Async,
|
|
|
+ .file = LinearFileProtocol};
|
|
|
+
|
|
|
+/**
|
|
|
+ * BF existing dump
|
|
|
+ */
|
|
|
+const SubBruteProtocol subbrute_protocol_load_file =
|
|
|
+ {0, 0, 0, 3, FuriHalSubGhzPresetOok650Async, RAWFileProtocol};
|
|
|
+
|
|
|
+//static const SubBruteProtocol subbrute_protocols[SubBruteAttackTotalCount] = {
|
|
|
+// [SubBruteAttackCAME12bit303] =
|
|
|
+// {303875000, 12, 0, 3, FuriHalSubGhzPresetOok650Async, CAMEFileProtocol},
|
|
|
+// [SubBruteAttackCAME12bit307] =
|
|
|
+// {307800000, 12, 0, 3, FuriHalSubGhzPresetOok650Async, CAMEFileProtocol},
|
|
|
+// [SubBruteAttackCAME12bit433] =
|
|
|
+// {433920000, 12, 0, 3, FuriHalSubGhzPresetOok650Async, CAMEFileProtocol},
|
|
|
+// [SubBruteAttackCAME12bit868] =
|
|
|
+// {868350000, 12, 0, 3, FuriHalSubGhzPresetOok650Async, CAMEFileProtocol},
|
|
|
+// [SubBruteAttackNICE12bit433] =
|
|
|
+// {433920000, 12, 0, 3, FuriHalSubGhzPresetOok650Async, NICEFileProtocol},
|
|
|
+// [SubBruteAttackNICE12bit868] =
|
|
|
+// {868350000, 12, 0, 3, FuriHalSubGhzPresetOok650Async, NICEFileProtocol},
|
|
|
+// [SubBruteAttackChamberlain9bit300] =
|
|
|
+// {300000000, 9, 0, 3, FuriHalSubGhzPresetOok650Async, ChamberlainFileProtocol},
|
|
|
+// [SubBruteAttackChamberlain9bit315] =
|
|
|
+// {315000000, 9, 0, 3, FuriHalSubGhzPresetOok650Async, ChamberlainFileProtocol},
|
|
|
+// [SubBruteAttackChamberlain9bit390] =
|
|
|
+// {390000000, 9, 0, 3, FuriHalSubGhzPresetOok650Async, ChamberlainFileProtocol},
|
|
|
+// [SubBruteAttackLinear10bit300] =
|
|
|
+// {300000000, 10, 0, 5, FuriHalSubGhzPresetOok650Async, LinearFileProtocol},
|
|
|
+// [SubBruteAttackLinear10bit310] =
|
|
|
+// {300000000, 10, 0, 5, FuriHalSubGhzPresetOok650Async, LinearFileProtocol},
|
|
|
// [SubBruteAttackLoadFile] = {0, 0, 0, 3, FuriHalSubGhzPresetOok650Async, RAWFileProtocol},
|
|
|
//};
|
|
|
|
|
|
@@ -65,7 +179,21 @@ static const char* subbrute_protocol_presets[] = {
|
|
|
[FuriHalSubGhzPresetGFSK9_99KbAsync] = "FuriHalSubGhzPresetGFSK9_99KbAsync",
|
|
|
};
|
|
|
|
|
|
-static const char* subbrute_protocol_file_types[TotalFileProtocol] = {
|
|
|
+const SubBruteProtocol* subbrute_protocol_registry[] = {
|
|
|
+ [SubBruteAttackCAME12bit303] = &subbrute_protocol_came_12bit_303,
|
|
|
+ [SubBruteAttackCAME12bit307] = &subbrute_protocol_came_12bit_307,
|
|
|
+ [SubBruteAttackCAME12bit433] = &subbrute_protocol_came_12bit_433,
|
|
|
+ [SubBruteAttackCAME12bit868] = &subbrute_protocol_came_12bit_868,
|
|
|
+ [SubBruteAttackNICE12bit433] = &subbrute_protocol_nice_12bit_433,
|
|
|
+ [SubBruteAttackNICE12bit868] = &subbrute_protocol_nice_12bit_868,
|
|
|
+ [SubBruteAttackChamberlain9bit300] = &subbrute_protocol_chamberlain_9bit_300,
|
|
|
+ [SubBruteAttackChamberlain9bit315] = &subbrute_protocol_chamberlain_9bit_315,
|
|
|
+ [SubBruteAttackChamberlain9bit390] = &subbrute_protocol_chamberlain_9bit_390,
|
|
|
+ [SubBruteAttackLinear10bit300] = &subbrute_protocol_linear_10bit_300,
|
|
|
+ [SubBruteAttackLinear10bit310] = &subbrute_protocol_linear_10bit_310,
|
|
|
+ [SubBruteAttackLoadFile] = &subbrute_protocol_load_file};
|
|
|
+
|
|
|
+static const char* subbrute_protocol_file_types[] = {
|
|
|
[CAMEFileProtocol] = "CAME",
|
|
|
[NICEFileProtocol] = "Nice FLO",
|
|
|
[ChamberlainFileProtocol] = "Cham_Code",
|
|
|
@@ -73,32 +201,12 @@ static const char* subbrute_protocol_file_types[TotalFileProtocol] = {
|
|
|
[PrincetonFileProtocol] = "Princeton",
|
|
|
[RAWFileProtocol] = "RAW"};
|
|
|
|
|
|
-SubBruteProtocol* subbrute_protocol_alloc(void) {
|
|
|
- SubBruteProtocol* protocol = malloc(sizeof(SubBruteProtocol));
|
|
|
- protocol->frequency = subbrute_protocols[SubBruteAttackLoadFile].frequency;
|
|
|
- protocol->repeat = subbrute_protocols[SubBruteAttackLoadFile].repeat;
|
|
|
- protocol->preset = subbrute_protocols[SubBruteAttackLoadFile].preset;
|
|
|
- protocol->file = subbrute_protocols[SubBruteAttackLoadFile].file;
|
|
|
- protocol->te = subbrute_protocols[SubBruteAttackLoadFile].te;
|
|
|
- protocol->bits = subbrute_protocols[SubBruteAttackLoadFile].bits;
|
|
|
-
|
|
|
- return protocol;
|
|
|
-}
|
|
|
-
|
|
|
const char* subbrute_protocol_name(SubBruteAttacks index) {
|
|
|
return subbrute_protocol_names[index];
|
|
|
}
|
|
|
|
|
|
-SubBruteProtocol* subbrute_protocol(SubBruteAttacks index) {
|
|
|
- SubBruteProtocol* protocol = subbrute_protocol_alloc();
|
|
|
- protocol->frequency = subbrute_protocols[index].frequency;
|
|
|
- protocol->repeat = subbrute_protocols[index].repeat;
|
|
|
- protocol->preset = subbrute_protocols[index].preset;
|
|
|
- protocol->file = subbrute_protocols[index].file;
|
|
|
- protocol->te = subbrute_protocols[index].te;
|
|
|
- protocol->bits = subbrute_protocols[index].bits;
|
|
|
-
|
|
|
- return protocol;
|
|
|
+const SubBruteProtocol* subbrute_protocol(SubBruteAttacks index) {
|
|
|
+ return subbrute_protocol_registry[index];
|
|
|
}
|
|
|
|
|
|
const char* subbrute_protocol_preset(FuriHalSubGhzPreset preset) {
|