|
|
@@ -366,6 +366,50 @@ const SubBruteProtocol subbrute_protocol_pt2260_24bit_433 = {
|
|
|
.preset = FuriHalSubGhzPresetOok650Async,
|
|
|
.file = PT2260FileProtocol};
|
|
|
|
|
|
+/**
|
|
|
+ * PT2262 (Princeton) 24bit 315MHz
|
|
|
+ */
|
|
|
+const SubBruteProtocol subbrute_protocol_pt2262_24bit_315 = {
|
|
|
+ .frequency = 315000000,
|
|
|
+ .bits = 24,
|
|
|
+ .te = 286,
|
|
|
+ .repeat = 4,
|
|
|
+ .preset = FuriHalSubGhzPresetOok650Async,
|
|
|
+ .file = PT2262FileProtocol};
|
|
|
+
|
|
|
+/**
|
|
|
+ * PT2262 (Princeton) 24bit 418MHz
|
|
|
+ */
|
|
|
+const SubBruteProtocol subbrute_protocol_pt2262_24bit_418 = {
|
|
|
+ .frequency = 418000000,
|
|
|
+ .bits = 24,
|
|
|
+ .te = 286,
|
|
|
+ .repeat = 4,
|
|
|
+ .preset = FuriHalSubGhzPresetOok650Async,
|
|
|
+ .file = PT2262FileProtocol};
|
|
|
+
|
|
|
+/**
|
|
|
+ * PT2262 (Princeton) 24bit 430MHz
|
|
|
+ */
|
|
|
+const SubBruteProtocol subbrute_protocol_pt2262_24bit_430 = {
|
|
|
+ .frequency = 430000000,
|
|
|
+ .bits = 24,
|
|
|
+ .te = 286,
|
|
|
+ .repeat = 4,
|
|
|
+ .preset = FuriHalSubGhzPresetOok650Async,
|
|
|
+ .file = PT2262FileProtocol};
|
|
|
+
|
|
|
+/**
|
|
|
+ * PT2262 (Princeton) 24bit 433MHz
|
|
|
+ */
|
|
|
+const SubBruteProtocol subbrute_protocol_pt2262_24bit_433 = {
|
|
|
+ .frequency = 433920000,
|
|
|
+ .bits = 24,
|
|
|
+ .te = 286,
|
|
|
+ .repeat = 4,
|
|
|
+ .preset = FuriHalSubGhzPresetOok650Async,
|
|
|
+ .file = PT2262FileProtocol};
|
|
|
+
|
|
|
/**
|
|
|
* Holtek FM 12bit 433MHz
|
|
|
*/
|
|
|
@@ -466,6 +510,10 @@ static const char* subbrute_protocol_names[] = {
|
|
|
[SubBruteAttackPT226024bit330] = "PT2260 24bit 330MHz",
|
|
|
[SubBruteAttackPT226024bit390] = "PT2260 24bit 390MHz",
|
|
|
[SubBruteAttackPT226024bit433] = "PT2260 24bit 433MHz",
|
|
|
+ [SubBruteAttackPT226224bit315] = "PT2262 24bit 315MHz",
|
|
|
+ [SubBruteAttackPT226224bit418] = "PT2262 24bit 418MHz",
|
|
|
+ [SubBruteAttackPT226224bit430] = "PT2262 24bit 430MHz",
|
|
|
+ [SubBruteAttackPT226224bit433] = "PT2262 24bit 433MHz",
|
|
|
[SubBruteAttackLoadFile] = "BF existing dump",
|
|
|
[SubBruteAttackTotalCount] = "Total Count",
|
|
|
};
|
|
|
@@ -519,6 +567,10 @@ const SubBruteProtocol* subbrute_protocol_registry[] = {
|
|
|
[SubBruteAttackPT226024bit330] = &subbrute_protocol_pt2260_24bit_330,
|
|
|
[SubBruteAttackPT226024bit390] = &subbrute_protocol_pt2260_24bit_390,
|
|
|
[SubBruteAttackPT226024bit433] = &subbrute_protocol_pt2260_24bit_433,
|
|
|
+ [SubBruteAttackPT226224bit315] = &subbrute_protocol_pt2262_24bit_315,
|
|
|
+ [SubBruteAttackPT226224bit418] = &subbrute_protocol_pt2262_24bit_418,
|
|
|
+ [SubBruteAttackPT226224bit430] = &subbrute_protocol_pt2262_24bit_430,
|
|
|
+ [SubBruteAttackPT226224bit433] = &subbrute_protocol_pt2262_24bit_433,
|
|
|
[SubBruteAttackLoadFile] = &subbrute_protocol_load_file};
|
|
|
|
|
|
static const char* subbrute_protocol_file_types[] = {
|
|
|
@@ -539,6 +591,7 @@ static const char* subbrute_protocol_file_types[] = {
|
|
|
[SMC5326FileProtocol] = "SMC5326",
|
|
|
[UNILARMFileProtocol] = "SMC5326",
|
|
|
[PT2260FileProtocol] = "Princeton",
|
|
|
+ [PT2262FileProtocol] = "Princeton",
|
|
|
[HoneywellFileProtocol] = "Honeywell",
|
|
|
[HoltekFileProtocol] = "Holtek_HT12X",
|
|
|
[LegrandFileProtocol] = "Legrand",
|
|
|
@@ -561,6 +614,7 @@ static const char* subbrute_key_small_with_tail = "Bit: %d\nKey: %s\nTE: %d\nRep
|
|
|
|
|
|
const uint8_t lut_uni_alarm_smsc[] = {0x00, 0x02, 0x03}; // 00, 10, 11
|
|
|
const uint8_t lut_pt2260[] = {0x00, 0x01, 0x03}; // 00, 01, 11
|
|
|
+const uint8_t lut_pt2262[] = {0x00, 0x01, 0x03}; // 00, 01, 11
|
|
|
|
|
|
const uint64_t gate_smsc = 0x01D5; // 111010101
|
|
|
//const uint8_t gate2 = 0x0175; // 101110101
|
|
|
@@ -570,6 +624,8 @@ const uint64_t gate_pt2260 = 0x03; // 11
|
|
|
//const uint8_t button_stop = 0x30; // 110000
|
|
|
//const uint8_t button_close = 0xC0; // 11000000
|
|
|
|
|
|
+uint64_t gate_pt2262 = 0x03; // 11
|
|
|
+
|
|
|
const uint64_t gate_uni_alarm = 3 << 7;
|
|
|
//const uint8_t gate2 = 3 << 5;
|
|
|
|
|
|
@@ -652,7 +708,8 @@ void subbrute_protocol_create_candidate_for_existing_file(
|
|
|
void subbrute_protocol_create_candidate_for_default(
|
|
|
FuriString* candidate,
|
|
|
SubBruteFileProtocol file,
|
|
|
- uint64_t step) {
|
|
|
+ uint64_t step,
|
|
|
+ uint8_t opencode) {
|
|
|
uint8_t p[8] = {0};
|
|
|
uint64_t total = 0;
|
|
|
|
|
|
@@ -689,6 +746,31 @@ void subbrute_protocol_create_candidate_for_default(
|
|
|
total <<= 8;
|
|
|
total |= gate_pt2260;
|
|
|
|
|
|
+ for(int i = 0; i < 8; i++) {
|
|
|
+ p[i] = (uint8_t)(total >> 8 * (7 - i)) & 0xFF;
|
|
|
+ }
|
|
|
+ } else if(file == PT2262FileProtocol) {
|
|
|
+ uint8_t opencode_var = opencode;
|
|
|
+ if(opencode_var == 0) {
|
|
|
+ gate_pt2262 = 0x03; // 0001 PT2262常见抬杆码3
|
|
|
+ }
|
|
|
+ if(opencode_var == 1) {
|
|
|
+ gate_pt2262 = 0x0C; // 0010 PT2262常见抬杆码12
|
|
|
+ }
|
|
|
+ if(opencode_var == 2) {
|
|
|
+ gate_pt2262 = 0x30; // 0100 PT2262常见抬杆码48
|
|
|
+ }
|
|
|
+ if(opencode_var == 3) {
|
|
|
+ gate_pt2262 = 0xC0; // 1000 PT2262常见抬杆码192
|
|
|
+ }
|
|
|
+ for(size_t j = 0; j < 8; j++) {
|
|
|
+ total |= lut_pt2262[step % 3] << (2 * j);
|
|
|
+ double sub_step = (double)step / 3;
|
|
|
+ step = (uint64_t)floor(sub_step);
|
|
|
+ }
|
|
|
+ total <<= 8;
|
|
|
+ total |= gate_pt2262;
|
|
|
+
|
|
|
for(int i = 0; i < 8; i++) {
|
|
|
p[i] = (uint8_t)(total >> 8 * (7 - i)) & 0xFF;
|
|
|
}
|
|
|
@@ -722,9 +804,10 @@ void subbrute_protocol_default_payload(
|
|
|
uint64_t step,
|
|
|
uint8_t bits,
|
|
|
uint32_t te,
|
|
|
- uint8_t repeat) {
|
|
|
+ uint8_t repeat,
|
|
|
+ uint8_t opencode) {
|
|
|
FuriString* candidate = furi_string_alloc();
|
|
|
- subbrute_protocol_create_candidate_for_default(candidate, file, step);
|
|
|
+ subbrute_protocol_create_candidate_for_default(candidate, file, step, opencode);
|
|
|
|
|
|
#ifdef FURI_DEBUG
|
|
|
FURI_LOG_D(
|
|
|
@@ -799,9 +882,10 @@ void subbrute_protocol_default_generate_file(
|
|
|
SubBruteFileProtocol file,
|
|
|
uint64_t step,
|
|
|
uint8_t bits,
|
|
|
- uint32_t te) {
|
|
|
+ uint32_t te,
|
|
|
+ uint8_t opencode) {
|
|
|
FuriString* candidate = furi_string_alloc();
|
|
|
- subbrute_protocol_create_candidate_for_default(candidate, file, step);
|
|
|
+ subbrute_protocol_create_candidate_for_default(candidate, file, step, opencode);
|
|
|
|
|
|
#ifdef FURI_DEBUG
|
|
|
FURI_LOG_D(TAG, "candidate: %s, step: %lld", furi_string_get_cstr(candidate), step);
|
|
|
@@ -886,7 +970,11 @@ uint64_t
|
|
|
attack_type == SubBruteAttackPT226024bit315 ||
|
|
|
attack_type == SubBruteAttackPT226024bit330 ||
|
|
|
attack_type == SubBruteAttackPT226024bit390 ||
|
|
|
- attack_type == SubBruteAttackPT226024bit433) {
|
|
|
+ attack_type == SubBruteAttackPT226024bit433 ||
|
|
|
+ attack_type == SubBruteAttackPT226224bit315 ||
|
|
|
+ attack_type == SubBruteAttackPT226224bit418 ||
|
|
|
+ attack_type == SubBruteAttackPT226224bit430 ||
|
|
|
+ attack_type == SubBruteAttackPT226224bit433) {
|
|
|
max_value = 6561;
|
|
|
} else {
|
|
|
FuriString* max_value_s;
|