From ceee551befa0cb8fd8514a4f8a1250fd9e0997ee Mon Sep 17 00:00:00 2001 From: HTotoo Date: Sun, 29 Oct 2023 21:32:46 +0100 Subject: [PATCH 01/12] Honeywell test version. RX only --- lib/subghz/protocols/honeywell.c | 214 ++++++++++++++++++++++++++ lib/subghz/protocols/honeywell.h | 60 ++++++++ lib/subghz/protocols/protocol_items.c | 1 + lib/subghz/protocols/protocol_items.h | 1 + 4 files changed, 276 insertions(+) create mode 100644 lib/subghz/protocols/honeywell.c create mode 100644 lib/subghz/protocols/honeywell.h diff --git a/lib/subghz/protocols/honeywell.c b/lib/subghz/protocols/honeywell.c new file mode 100644 index 000000000..35a3cab5e --- /dev/null +++ b/lib/subghz/protocols/honeywell.c @@ -0,0 +1,214 @@ +#include "honeywell.h" +#include + +#define TAG "SubGhzProtocolHoneywell" + +uint16_t subghz_protocol_honeywell_crc16( + uint8_t const message[], + unsigned nBytes, + uint16_t polynomial, + uint16_t init) { + uint16_t remainder = init; + unsigned byte, bit; + + for(byte = 0; byte < nBytes; ++byte) { + remainder ^= message[byte] << 8; + for(bit = 0; bit < 8; ++bit) { + if(remainder & 0x8000) { + remainder = (remainder << 1) ^ polynomial; + } else { + remainder = (remainder << 1); + } + } + } + return remainder; +} + +void subghz_protocol_decoder_honeywell_free(void* context) { + furi_assert(context); + SubGhzProtocolDecoderHoneywell* instance = context; + free(instance); +} + +void subghz_protocol_decoder_honeywell_reset(void* context) { + furi_assert(context); + SubGhzProtocolDecoderHoneywell* instance = context; + instance->decoder.decode_data = 0; + instance->decoder.decode_count_bit = 0; +} + +void subghz_protocol_decoder_honeywell_addbit(void* context, bool data) { + SubGhzProtocolDecoderHoneywell* instance = context; + instance->decoder.decode_data = (instance->decoder.decode_data << 1) | data; + instance->decoder.decode_count_bit++; + + uint16_t preamble = (instance->decoder.decode_data >> 48) & 0xFFFF; + //if (preamble == 0x7fff) instance->decoder.decode_data = (instance->decoder.decode_data << 1); //shifted by 1 bit. flipper fault... + + preamble = (instance->decoder.decode_data >> 48) & 0xFFFF; //recalc it + if(preamble == 0b0011111111111110 || preamble == 0b0111111111111110 || + preamble == 0b1111111111111110) { + uint8_t datatocrc[4]; + datatocrc[0] = (instance->decoder.decode_data >> 40) & 0xFFFF; + datatocrc[1] = (instance->decoder.decode_data >> 32) & 0xFFFF; + datatocrc[2] = (instance->decoder.decode_data >> 24) & 0xFFFF; + datatocrc[3] = (instance->decoder.decode_data >> 16) & 0xFFFF; + + uint8_t channel = (instance->decoder.decode_data >> 44) & 0xF; + uint16_t crc_calc = 0; + + if(channel == 0x2 || channel == 0x4 || channel == 0xA) { + // 2GIG brand + crc_calc = subghz_protocol_honeywell_crc16(datatocrc, 4, 0x8050, 0); + } else { // channel == 0x8 + crc_calc = subghz_protocol_honeywell_crc16(datatocrc, 4, 0x8005, 0); + } + uint16_t crc = instance->decoder.decode_data & 0xFFFF; + if(crc == crc_calc) { + //the data is good. process it. + instance->generic.data = instance->decoder.decode_data; + instance->generic.data_count_bit = + instance->decoder + .decode_count_bit; //maybe set it to 64, and hack the first 2 bits to 1! will see if replay needs it + instance->generic.serial = (instance->decoder.decode_data >> 24) & 0xFFFFF; + instance->generic.btn = (instance->decoder.decode_data >> 16) & + 0xFF; //not exactly button, but can contain btn data too. + if(instance->base.callback) + instance->base.callback(&instance->base, instance->base.context); + instance->decoder.decode_data = 0; + instance->decoder.decode_count_bit = 0; + } else { + return; + } + } +} + +void subghz_protocol_decoder_honeywell_feed(void* context, bool level, uint32_t duration) { + furi_assert(context); + SubGhzProtocolDecoderHoneywell* instance = context; + + ManchesterEvent event = ManchesterEventReset; + if(!level) { + if(DURATION_DIFF(duration, subghz_protocol_honeywell_const.te_short) < + subghz_protocol_honeywell_const.te_delta) { + event = ManchesterEventShortLow; + } else if( + DURATION_DIFF(duration, subghz_protocol_honeywell_const.te_long) < + subghz_protocol_honeywell_const.te_delta * 2) { + event = ManchesterEventLongLow; + } + } else { + if(DURATION_DIFF(duration, subghz_protocol_honeywell_const.te_short) < + subghz_protocol_honeywell_const.te_delta) { + event = ManchesterEventShortHigh; + } else if( + DURATION_DIFF(duration, subghz_protocol_honeywell_const.te_long) < + subghz_protocol_honeywell_const.te_delta * 2) { + event = ManchesterEventLongHigh; + } + } + if(event != ManchesterEventReset) { + bool data; + bool data_ok = manchester_advance( + instance->manchester_saved_state, event, &instance->manchester_saved_state, &data); + if(data_ok) { + subghz_protocol_decoder_honeywell_addbit(instance, data); + } + } else { + instance->decoder.decode_data = 0; + instance->decoder.decode_count_bit = 0; + } +} + +uint8_t subghz_protocol_decoder_honeywell_get_hash_data(void* context) { + furi_assert(context); + SubGhzProtocolDecoderHoneywell* instance = context; + return subghz_protocol_blocks_get_hash_data( + &instance->decoder, (instance->decoder.decode_count_bit / 8) + 1); +} + +SubGhzProtocolStatus subghz_protocol_decoder_honeywell_serialize( + void* context, + FlipperFormat* flipper_format, + SubGhzRadioPreset* preset) { + furi_assert(context); + SubGhzProtocolDecoderHoneywell* instance = context; + return subghz_block_generic_serialize(&instance->generic, flipper_format, preset); +} + +SubGhzProtocolStatus + subghz_protocol_decoder_honeywell_deserialize(void* context, FlipperFormat* flipper_format) { + furi_assert(context); + SubGhzProtocolDecoderHoneywell* instance = context; + return subghz_block_generic_deserialize_check_count_bit( + &instance->generic, + flipper_format, + subghz_protocol_honeywell_const.min_count_bit_for_found); +} + +void subghz_protocol_decoder_honeywell_get_string(void* context, FuriString* output) { + furi_assert(context); + SubGhzProtocolDecoderHoneywell* instance = context; + + uint8_t channel = (instance->generic.data >> 44) & 0xF; + uint8_t contact = (instance->generic.btn & 0x80) >> 7; + uint8_t tamper = (instance->generic.btn & 0x40) >> 6; + uint8_t reed = (instance->generic.btn & 0x20) >> 5; + uint8_t alarm = (instance->generic.btn & 0x10) >> 4; + uint8_t battery_low = (instance->generic.btn & 0x08) >> 3; + uint8_t heartbeat = (instance->generic.btn & 0x04) >> 2; + + furi_string_cat_printf( + output, + "%s\r\n%dbit\r\n" + "Sn:%07lu Ch:%u Bat:%d Hb: %d\r\n" + "L1: %u, L2: %u, L3: %u, L4: %u\r\n", + instance->generic.protocol_name, + instance->generic.data_count_bit, + instance->generic.serial, + channel, + battery_low, + heartbeat, + contact, + reed, + alarm, + tamper); +} + +void* subghz_protocol_decoder_honeywell_alloc(SubGhzEnvironment* environment) { + UNUSED(environment); + SubGhzProtocolDecoderHoneywell* instance = malloc(sizeof(SubGhzProtocolDecoderHoneywell)); + instance->base.protocol = &subghz_protocol_honeywell; + instance->generic.protocol_name = instance->base.protocol->name; + return instance; +} + +const SubGhzProtocolDecoder subghz_protocol_honeywell_decoder = { + .alloc = subghz_protocol_decoder_honeywell_alloc, + .free = subghz_protocol_decoder_honeywell_free, + .feed = subghz_protocol_decoder_honeywell_feed, + .reset = subghz_protocol_decoder_honeywell_reset, + .get_hash_data = subghz_protocol_decoder_honeywell_get_hash_data, + .serialize = subghz_protocol_decoder_honeywell_serialize, + .deserialize = subghz_protocol_decoder_honeywell_deserialize, + .get_string = subghz_protocol_decoder_honeywell_get_string, +}; + +const SubGhzProtocolEncoder subghz_protocol_honeywell_encoder = { + .alloc = NULL, + .free = NULL, + .deserialize = NULL, + .stop = NULL, + .yield = NULL, +}; + +const SubGhzProtocol subghz_protocol_honeywell = { + .name = SUBGHZ_PROTOCOL_HONEYWELL_NAME, + .type = SubGhzProtocolTypeStatic, + .flag = SubGhzProtocolFlag_433 | SubGhzProtocolFlag_315 | SubGhzProtocolFlag_868 | + SubGhzProtocolFlag_AM | SubGhzProtocolFlag_Decodable | SubGhzProtocolFlag_Load | + SubGhzProtocolFlag_Save, + .encoder = &subghz_protocol_honeywell_encoder, + .decoder = &subghz_protocol_honeywell_decoder, + +}; diff --git a/lib/subghz/protocols/honeywell.h b/lib/subghz/protocols/honeywell.h new file mode 100644 index 000000000..20586b9b7 --- /dev/null +++ b/lib/subghz/protocols/honeywell.h @@ -0,0 +1,60 @@ +#pragma once + +#include + +#include +#include +#include +#include "base.h" +#include "../blocks/generic.h" +#include +#include + +#define SUBGHZ_PROTOCOL_HONEYWELL_NAME "Honeywell" + +typedef struct SubGhzProtocolDecoderHoneywell SubGhzProtocolDecoderHoneywell; +typedef struct SubGhzProtocolEncoderHoneywell SubGhzProtocolEncoderHoneywell; + +extern const SubGhzProtocolDecoder subghz_protocol_honeywell_decoder; +extern const SubGhzProtocolEncoder subghz_protocol_honeywell_encoder; +extern const SubGhzProtocol subghz_protocol_honeywell; + +void* subghz_protocol_decoder_honeywell_alloc(SubGhzEnvironment* environment); + +void subghz_protocol_decoder_honeywell_free(void* context); + +void subghz_protocol_decoder_honeywell_reset(void* context); + +void subghz_protocol_decoder_honeywell_feed(void* context, bool level, uint32_t duration); + +uint8_t subghz_protocol_decoder_honeywell_get_hash_data(void* context); + +SubGhzProtocolStatus subghz_protocol_decoder_honeywell_serialize( + void* context, + FlipperFormat* flipper_format, + SubGhzRadioPreset* preset); + +SubGhzProtocolStatus + subghz_protocol_decoder_honeywell_deserialize(void* context, FlipperFormat* flipper_format); + +void subghz_protocol_decoder_honeywell_get_string(void* context, FuriString* output); + +static const SubGhzBlockConst subghz_protocol_honeywell_const = { + .te_long = 280, + .te_short = 143, + .te_delta = 51, + .min_count_bit_for_found = 62, +}; + +struct SubGhzProtocolDecoderHoneywell { + SubGhzProtocolDecoderBase base; + SubGhzBlockGeneric generic; + SubGhzBlockDecoder decoder; + ManchesterState manchester_saved_state; +}; + +struct SubGhzProtocolEncoderHoneywell { + SubGhzProtocolEncoderBase base; + SubGhzBlockGeneric generic; + SubGhzProtocolBlockEncoder encoder; +}; diff --git a/lib/subghz/protocols/protocol_items.c b/lib/subghz/protocols/protocol_items.c index 644f5f68e..3678b5d05 100644 --- a/lib/subghz/protocols/protocol_items.c +++ b/lib/subghz/protocols/protocol_items.c @@ -62,6 +62,7 @@ const SubGhzProtocol* subghz_protocol_registry_items[] = { &ws_protocol_auriol_ahfl, &subghz_protocol_pocsag, &tpms_protocol_schrader_gg4, + &subghz_protocol_honeywell, &subghz_protocol_bin_raw, }; diff --git a/lib/subghz/protocols/protocol_items.h b/lib/subghz/protocols/protocol_items.h index 74a4e4d6e..5802aa57e 100644 --- a/lib/subghz/protocols/protocol_items.h +++ b/lib/subghz/protocols/protocol_items.h @@ -63,4 +63,5 @@ #include "auriol_ahfl.h" #include "pocsag.h" #include "schrader_gg4.h" +#include "honeywell.h" #include "bin_raw.h" From 86bbbaaa3d3b15ad31c0b79e8b4c7c82c81296cf Mon Sep 17 00:00:00 2001 From: HTotoo Date: Sun, 29 Oct 2023 22:20:58 +0100 Subject: [PATCH 02/12] Fixes. --- lib/subghz/protocols/honeywell.c | 4 ++-- lib/subghz/protocols/honeywell.h | 2 +- lib/subghz/protocols/protocol_items.c | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/subghz/protocols/honeywell.c b/lib/subghz/protocols/honeywell.c index 35a3cab5e..09cbaedfd 100644 --- a/lib/subghz/protocols/honeywell.c +++ b/lib/subghz/protocols/honeywell.c @@ -160,8 +160,8 @@ void subghz_protocol_decoder_honeywell_get_string(void* context, FuriString* out furi_string_cat_printf( output, - "%s\r\n%dbit\r\n" - "Sn:%07lu Ch:%u Bat:%d Hb: %d\r\n" + "%s\r\n%dbit " + "Sn:%07lu\r\nCh:%u Bat:%d Hb: %d\r\n" "L1: %u, L2: %u, L3: %u, L4: %u\r\n", instance->generic.protocol_name, instance->generic.data_count_bit, diff --git a/lib/subghz/protocols/honeywell.h b/lib/subghz/protocols/honeywell.h index 20586b9b7..aae0817c9 100644 --- a/lib/subghz/protocols/honeywell.h +++ b/lib/subghz/protocols/honeywell.h @@ -10,7 +10,7 @@ #include #include -#define SUBGHZ_PROTOCOL_HONEYWELL_NAME "Honeywell" +#define SUBGHZ_PROTOCOL_HONEYWELL_NAME "Honeywell(Ad)" typedef struct SubGhzProtocolDecoderHoneywell SubGhzProtocolDecoderHoneywell; typedef struct SubGhzProtocolEncoderHoneywell SubGhzProtocolEncoderHoneywell; diff --git a/lib/subghz/protocols/protocol_items.c b/lib/subghz/protocols/protocol_items.c index 3678b5d05..ff63bf8da 100644 --- a/lib/subghz/protocols/protocol_items.c +++ b/lib/subghz/protocols/protocol_items.c @@ -31,6 +31,7 @@ const SubGhzProtocol* subghz_protocol_registry_items[] = { &subghz_protocol_bett, &subghz_protocol_doitrand, &subghz_protocol_phoenix_v2, + &subghz_protocol_honeywell, &subghz_protocol_honeywell_wdb, &subghz_protocol_magellan, &subghz_protocol_intertechno_v3, @@ -62,7 +63,6 @@ const SubGhzProtocol* subghz_protocol_registry_items[] = { &ws_protocol_auriol_ahfl, &subghz_protocol_pocsag, &tpms_protocol_schrader_gg4, - &subghz_protocol_honeywell, &subghz_protocol_bin_raw, }; From d41187ff799d44c8554e38e41a14e00d9b538393 Mon Sep 17 00:00:00 2001 From: HTotoo Date: Sun, 29 Oct 2023 23:33:19 +0100 Subject: [PATCH 03/12] Send test --- lib/subghz/protocols/honeywell.c | 173 ++++++++++++++++++++++++++++--- lib/subghz/protocols/honeywell.h | 1 + 2 files changed, 159 insertions(+), 15 deletions(-) diff --git a/lib/subghz/protocols/honeywell.c b/lib/subghz/protocols/honeywell.c index 09cbaedfd..7742b096f 100644 --- a/lib/subghz/protocols/honeywell.c +++ b/lib/subghz/protocols/honeywell.c @@ -1,6 +1,26 @@ #include "honeywell.h" #include +//Created by HTotoo 2023-10-30 +//Got a lot of help from LiQuiDz. +//Protocol decoding help from: https://github.com/merbanan/rtl_433/blob/master/src/devices/honeywell.c + +/* +64 bit packets, repeated multiple times per open/close event. + +Protocol whitepaper: "DEFCON 22: Home Insecurity" by Logan Lamb. + +Data layout: + + PP PP C IIIII EE SS SS + +- P: 16bit Preamble and sync bit (always ff fe) +- C: 4bit Channel +- I: 20bit Device serial number / or counter value +- E: 8bit Event, where 0x80 = Open/Close, 0x04 = Heartbeat / or id +- S: 16bit CRC +*/ + #define TAG "SubGhzProtocolHoneywell" uint16_t subghz_protocol_honeywell_crc16( @@ -43,9 +63,7 @@ void subghz_protocol_decoder_honeywell_addbit(void* context, bool data) { instance->decoder.decode_count_bit++; uint16_t preamble = (instance->decoder.decode_data >> 48) & 0xFFFF; - //if (preamble == 0x7fff) instance->decoder.decode_data = (instance->decoder.decode_data << 1); //shifted by 1 bit. flipper fault... - - preamble = (instance->decoder.decode_data >> 48) & 0xFFFF; //recalc it + //can be multiple, since flipper can't read it well.. if(preamble == 0b0011111111111110 || preamble == 0b0111111111111110 || preamble == 0b1111111111111110) { uint8_t datatocrc[4]; @@ -53,10 +71,8 @@ void subghz_protocol_decoder_honeywell_addbit(void* context, bool data) { datatocrc[1] = (instance->decoder.decode_data >> 32) & 0xFFFF; datatocrc[2] = (instance->decoder.decode_data >> 24) & 0xFFFF; datatocrc[3] = (instance->decoder.decode_data >> 16) & 0xFFFF; - uint8_t channel = (instance->decoder.decode_data >> 44) & 0xF; uint16_t crc_calc = 0; - if(channel == 0x2 || channel == 0x4 || channel == 0xA) { // 2GIG brand crc_calc = subghz_protocol_honeywell_crc16(datatocrc, 4, 0x8050, 0); @@ -132,14 +148,14 @@ SubGhzProtocolStatus subghz_protocol_decoder_honeywell_serialize( FlipperFormat* flipper_format, SubGhzRadioPreset* preset) { furi_assert(context); - SubGhzProtocolDecoderHoneywell* instance = context; + SubGhzProtocolEncoderHoneywell* instance = context; return subghz_block_generic_serialize(&instance->generic, flipper_format, preset); } SubGhzProtocolStatus subghz_protocol_decoder_honeywell_deserialize(void* context, FlipperFormat* flipper_format) { furi_assert(context); - SubGhzProtocolDecoderHoneywell* instance = context; + SubGhzProtocolEncoderHoneywell* instance = context; return subghz_block_generic_deserialize_check_count_bit( &instance->generic, flipper_format, @@ -148,7 +164,7 @@ SubGhzProtocolStatus void subghz_protocol_decoder_honeywell_get_string(void* context, FuriString* output) { furi_assert(context); - SubGhzProtocolDecoderHoneywell* instance = context; + SubGhzProtocolEncoderHoneywell* instance = context; uint8_t channel = (instance->generic.data >> 44) & 0xF; uint8_t contact = (instance->generic.btn & 0x80) >> 7; @@ -177,12 +193,139 @@ void subghz_protocol_decoder_honeywell_get_string(void* context, FuriString* out void* subghz_protocol_decoder_honeywell_alloc(SubGhzEnvironment* environment) { UNUSED(environment); - SubGhzProtocolDecoderHoneywell* instance = malloc(sizeof(SubGhzProtocolDecoderHoneywell)); + SubGhzProtocolEncoderHoneywell* instance = malloc(sizeof(SubGhzProtocolEncoderHoneywell)); instance->base.protocol = &subghz_protocol_honeywell; instance->generic.protocol_name = instance->base.protocol->name; return instance; } +void* subghz_protocol_encoder_honeywell_alloc(SubGhzEnvironment* environment) { + UNUSED(environment); + SubGhzProtocolEncoderHoneywell* instance = malloc(sizeof(SubGhzProtocolEncoderHoneywell)); + + instance->base.protocol = &subghz_protocol_honeywell; + instance->generic.protocol_name = instance->base.protocol->name; + + instance->encoder.repeat = 3; + instance->encoder.size_upload = 64 * 2 + 10; + instance->encoder.upload = malloc(instance->encoder.size_upload * sizeof(LevelDuration)); + instance->encoder.is_running = false; + return instance; +} + +void subghz_protocol_encoder_honeywell_free(void* context) { + furi_assert(context); + SubGhzProtocolEncoderHoneywell* instance = context; + free(instance->encoder.upload); + free(instance); +} +static LevelDuration + subghz_protocol_encoder_honeywell_add_duration_to_upload(ManchesterEncoderResult result) { + LevelDuration data = {.duration = 0, .level = 0}; + switch(result) { + case ManchesterEncoderResultShortLow: + data.duration = subghz_protocol_honeywell_const.te_short; + data.level = false; + break; + case ManchesterEncoderResultLongLow: + data.duration = subghz_protocol_honeywell_const.te_long; + data.level = false; + break; + case ManchesterEncoderResultLongHigh: + data.duration = subghz_protocol_honeywell_const.te_long; + data.level = true; + break; + case ManchesterEncoderResultShortHigh: + data.duration = subghz_protocol_honeywell_const.te_short; + data.level = true; + break; + + default: + furi_crash("SubGhz: ManchesterEncoderResult is incorrect."); + break; + } + return level_duration_make(data.level, data.duration); +} + +static void + subghz_protocol_encoder_honeywell_get_upload(SubGhzProtocolEncoderHoneywell* instance) { + furi_assert(instance); + size_t index = 0; + + ManchesterEncoderState enc_state; + manchester_encoder_reset(&enc_state); + ManchesterEncoderResult result; + + for(uint8_t i = 0; i < 64; i++) { + if(!manchester_encoder_advance( + &enc_state, bit_read(instance->generic.data, i - 1), &result)) { + instance->encoder.upload[index++] = + subghz_protocol_encoder_honeywell_add_duration_to_upload(result); + manchester_encoder_advance( + &enc_state, bit_read(instance->generic.data, i - 1), &result); + } + instance->encoder.upload[index++] = + subghz_protocol_encoder_honeywell_add_duration_to_upload(result); + } + instance->encoder.upload[index] = subghz_protocol_encoder_honeywell_add_duration_to_upload( + manchester_encoder_finish(&enc_state)); + if(level_duration_get_level(instance->encoder.upload[index])) { + index++; + } + instance->encoder.size_upload = index; +} + +SubGhzProtocolStatus + subghz_protocol_encoder_honeywell_deserialize(void* context, FlipperFormat* flipper_format) { + furi_assert(context); + SubGhzProtocolEncoderHoneywell* instance = context; + SubGhzProtocolStatus res = SubGhzProtocolStatusError; + do { + if(SubGhzProtocolStatusOk != + subghz_block_generic_deserialize(&instance->generic, flipper_format)) { + FURI_LOG_E(TAG, "Deserialize error"); + break; + } + + //optional parameter parameter + flipper_format_read_uint32( + flipper_format, "Repeat", (uint32_t*)&instance->encoder.repeat, 1); + + subghz_protocol_encoder_honeywell_get_upload(instance); + + if(!flipper_format_rewind(flipper_format)) { + FURI_LOG_E(TAG, "Rewind error"); + break; + } + + instance->encoder.is_running = true; + + res = SubGhzProtocolStatusOk; + } while(false); + + return res; +} + +void subghz_protocol_encoder_honeywell_stop(void* context) { + SubGhzProtocolEncoderHoneywell* instance = context; + instance->encoder.is_running = false; +} + +LevelDuration subghz_protocol_encoder_honeywell_yield(void* context) { + SubGhzProtocolEncoderHoneywell* instance = context; + + if(instance->encoder.repeat == 0 || !instance->encoder.is_running) { + instance->encoder.is_running = false; + return level_duration_reset(); + } + LevelDuration ret = instance->encoder.upload[instance->encoder.front]; + if(++instance->encoder.front == instance->encoder.size_upload) { + instance->encoder.repeat--; + instance->encoder.front = 0; + } + return ret; +} + const SubGhzProtocolDecoder subghz_protocol_honeywell_decoder = { .alloc = subghz_protocol_decoder_honeywell_alloc, .free = subghz_protocol_decoder_honeywell_free, @@ -195,11 +338,11 @@ const SubGhzProtocolDecoder subghz_protocol_honeywell_decoder = { }; const SubGhzProtocolEncoder subghz_protocol_honeywell_encoder = { - .alloc = NULL, - .free = NULL, - .deserialize = NULL, - .stop = NULL, - .yield = NULL, + .alloc = subghz_protocol_encoder_honeywell_alloc, + .free = subghz_protocol_encoder_honeywell_free, + .deserialize = subghz_protocol_encoder_honeywell_deserialize, + .stop = subghz_protocol_encoder_honeywell_stop, + .yield = subghz_protocol_encoder_honeywell_yield, }; const SubGhzProtocol subghz_protocol_honeywell = { @@ -207,7 +350,7 @@ const SubGhzProtocol subghz_protocol_honeywell = { .type = SubGhzProtocolTypeStatic, .flag = SubGhzProtocolFlag_433 | SubGhzProtocolFlag_315 | SubGhzProtocolFlag_868 | SubGhzProtocolFlag_AM | SubGhzProtocolFlag_Decodable | SubGhzProtocolFlag_Load | - SubGhzProtocolFlag_Save, + SubGhzProtocolFlag_Save | SubGhzProtocolFlag_Send, .encoder = &subghz_protocol_honeywell_encoder, .decoder = &subghz_protocol_honeywell_decoder, diff --git a/lib/subghz/protocols/honeywell.h b/lib/subghz/protocols/honeywell.h index aae0817c9..0b15de9e3 100644 --- a/lib/subghz/protocols/honeywell.h +++ b/lib/subghz/protocols/honeywell.h @@ -9,6 +9,7 @@ #include "../blocks/generic.h" #include #include +#include #define SUBGHZ_PROTOCOL_HONEYWELL_NAME "Honeywell(Ad)" From f5a0d657b7b4886074ff07a0d90f3a24e7633b49 Mon Sep 17 00:00:00 2001 From: HTotoo Date: Mon, 30 Oct 2023 08:13:47 +0100 Subject: [PATCH 04/12] Fix sending, fix crash caused by clipboard use.. --- lib/subghz/protocols/honeywell.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/subghz/protocols/honeywell.c b/lib/subghz/protocols/honeywell.c index 7742b096f..5fdc7f45c 100644 --- a/lib/subghz/protocols/honeywell.c +++ b/lib/subghz/protocols/honeywell.c @@ -148,14 +148,14 @@ SubGhzProtocolStatus subghz_protocol_decoder_honeywell_serialize( FlipperFormat* flipper_format, SubGhzRadioPreset* preset) { furi_assert(context); - SubGhzProtocolEncoderHoneywell* instance = context; + SubGhzProtocolDecoderHoneywell* instance = context; return subghz_block_generic_serialize(&instance->generic, flipper_format, preset); } SubGhzProtocolStatus subghz_protocol_decoder_honeywell_deserialize(void* context, FlipperFormat* flipper_format) { furi_assert(context); - SubGhzProtocolEncoderHoneywell* instance = context; + SubGhzProtocolDecoderHoneywell* instance = context; return subghz_block_generic_deserialize_check_count_bit( &instance->generic, flipper_format, @@ -164,7 +164,7 @@ SubGhzProtocolStatus void subghz_protocol_decoder_honeywell_get_string(void* context, FuriString* output) { furi_assert(context); - SubGhzProtocolEncoderHoneywell* instance = context; + SubGhzProtocolDecoderHoneywell* instance = context; uint8_t channel = (instance->generic.data >> 44) & 0xF; uint8_t contact = (instance->generic.btn & 0x80) >> 7; @@ -193,7 +193,7 @@ void subghz_protocol_decoder_honeywell_get_string(void* context, FuriString* out void* subghz_protocol_decoder_honeywell_alloc(SubGhzEnvironment* environment) { UNUSED(environment); - SubGhzProtocolEncoderHoneywell* instance = malloc(sizeof(SubGhzProtocolEncoderHoneywell)); + SubGhzProtocolDecoderHoneywell* instance = malloc(sizeof(SubGhzProtocolDecoderHoneywell)); instance->base.protocol = &subghz_protocol_honeywell; instance->generic.protocol_name = instance->base.protocol->name; return instance; @@ -256,7 +256,7 @@ static void manchester_encoder_reset(&enc_state); ManchesterEncoderResult result; - for(uint8_t i = 0; i < 64; i++) { + for(uint8_t i = 63; i > 0; i--) { if(!manchester_encoder_advance( &enc_state, bit_read(instance->generic.data, i - 1), &result)) { instance->encoder.upload[index++] = From f99ae215d0b84d75df5d775d0a74bdd6510f1368 Mon Sep 17 00:00:00 2001 From: HTotoo Date: Mon, 30 Oct 2023 08:16:32 +0100 Subject: [PATCH 05/12] got better neme (Honeywell sec-urity) --- lib/subghz/protocols/honeywell.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/subghz/protocols/honeywell.h b/lib/subghz/protocols/honeywell.h index 0b15de9e3..8aa35ce6c 100644 --- a/lib/subghz/protocols/honeywell.h +++ b/lib/subghz/protocols/honeywell.h @@ -11,7 +11,7 @@ #include #include -#define SUBGHZ_PROTOCOL_HONEYWELL_NAME "Honeywell(Ad)" +#define SUBGHZ_PROTOCOL_HONEYWELL_NAME "Honeywell Sec" typedef struct SubGhzProtocolDecoderHoneywell SubGhzProtocolDecoderHoneywell; typedef struct SubGhzProtocolEncoderHoneywell SubGhzProtocolEncoderHoneywell; From e1790c69ff2090859f5f1d3124aa5b45d780a35d Mon Sep 17 00:00:00 2001 From: Willy-JL <49810075+Willy-JL@users.noreply.github.com> Date: Tue, 31 Oct 2023 05:18:10 +0000 Subject: [PATCH 06/12] 168 more mfc keys from @Stepzor11's repo, thanks! --- .../resources/nfc/assets/mf_classic_dict.nfc | 169 ++++++++++++++++++ 1 file changed, 169 insertions(+) diff --git a/assets/resources/nfc/assets/mf_classic_dict.nfc b/assets/resources/nfc/assets/mf_classic_dict.nfc index a6f1ea9d3..b4b55b2f8 100644 --- a/assets/resources/nfc/assets/mf_classic_dict.nfc +++ b/assets/resources/nfc/assets/mf_classic_dict.nfc @@ -3843,3 +3843,172 @@ C670A9AD6066 722538817225 # 1k millenium hotels 132F641C948B +############### from https://github.com/Stepzor11/NFC_keys ############### +CCCE24102003 +49414556EF4D +1ABC15934F5A +0AD6B7E37183 +C27F5C1A9C2B +7C9FB8474242 +4663ACD2FFFF +FF75AFDA5A3C +4C44200BC9C5 +3A4C47757B07 +18AB07270506 +A2CA48CA4C05 +7B173A4E4976 +8A55194F6587 +4844426F6E69 +6A0D531DA1A7 +9B7C25052FC3 +193DFE0FA18E +6CA761AB6CA7 +4BB29463DC29 +00B70875AF1D +20525276F443 +3515AE068CAD +5A7D87876EA8 +81CC25EBBB6A +9A677289564D +0A1B6C50E04E +F3A524B7A7B3 +B133A4D48757 +558AAD64EB5B +260480290483 +1417E5671417 +32F093536677 +C9BE49675FE4 +57A18BFEC381 +AC37E76385F5 +18E887D625B4 +6686FADE5566 +3D6F823FFFFF +427553754D47 +9089B668FFFF +6C273F431564 +34635A313344 +353038383134 +EDC317193709 +75FAB77E2E5B +A1AB3A08712C +8DFACF11E778 +6B3B7AF45777 +45524DACC5E9 +B1C4A8F7F6E3 +6A6C80423226 +537930363139 +529CF51F05C5 +374521A38BCC +EAB8066C7479 +576DCFFF2F25 +505209016A1F +186C59E6AFC9 +8AC04C1A4E15 +05597810D63D +453857395635 +A1670589B2AF +552049EFF3F4 +FCDDF7767C10 +4149206E9BAE +54546255CDE9 +C1F6C7B55F5E +3F3A534B7B7B +204C0D3DCD9A +5A2050DA7E3F +6B0454D5D3C3 +2E0F00700000 +0AD0956DF6EE +65B6C3200736 +4F0E4AE8051A +8C187E78EE9C +544954CBB2C4 +97D77FAE77D3 +64CBADC7A313 +4B92DF1BF25D +AB91BDA25F00 +3A524B7A7B37 +A58AB5619631 +7F796F60FFFF +195DC63DB3A3 +4752533E1965 +FFF011223358 +7213B13D02E0 +76E450094393 +202011F918A2 +B793ADA6DB0C +F0A3C5182007 +5A4920FD6F87 +2900AAC52BC3 +3C4ABB877EAF +80BB8436024C +48C8852D15F9 +45450AC8DCA8 +A5BB18152EF1 +A514B797B373 +C0AA2BBD27CD +9D56D83658AC +514B797B2F3A +0000FFFFFFFF +A777B233A4F4 +F0FE56621A42 +5044068C5183 +494446555455 +336E34CC2177 +5AF445D2B87A +CDE668FDCDBA +1AF66F83F5BE +52B26C199862 +593367486137 +164EE10EFFFF +F4CE4AF888AE +3351916B5A77 +E5519E1CC92B +04B787B2F3A5 +EA0CA627FD06 +2910AFE15C99 +9D0D0A829F49 +9AFEE1F65742 +AE98BA1E6F2C +AB19BC885A29 +E9AE90885C39 +518108E061E2 +066F5AF3CCEE +B95BFDEBA7E4 +4B787B273A50 +0F3A4D48757B +8627C10A7014 +4E4F584D2105 +707B11FC1481 +DEDD7688BC38 +81504133B13C +A71E80EA35E1 +50D4C54FCDF5 +2612C6DE84CA +FF9F11223358 +738385948494 +D23A31A4AAB9 +9FAC23197904 +AEF617B3D040 +485242F22BE0 +DDDAA35A9749 +05412723F1B6 +AEF617B3D004 +7ADD3D735725 +05C301C8795A +001122334455 +B6803136F5AF +FE2A42E85CA8 +43204334546F +16901CB400BC +307448829EBC +8FD6D76742DC +826576A1AB68 +B3A4C47757B0 +A6B3F6C8F1D4 +702C1BF025DD +6BE9314930D8 +777B1F3A4F4A +AA4DDA458EBB +CA80E51FA52B +C2A0105EB028 +67B1B3A4E497 From 632a0c69dc7dd75b098a2353b9cc768e2ab149a7 Mon Sep 17 00:00:00 2001 From: SkeletonMan03 Date: Wed, 1 Nov 2023 18:52:08 -0500 Subject: [PATCH 07/12] Add IoProxXSF to RFID Fuzzer --- .../multi_fuzzer/lib/worker/protocol.c | 31 +++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/applications/external/multi_fuzzer/lib/worker/protocol.c b/applications/external/multi_fuzzer/lib/worker/protocol.c index 5284f87f1..086f60b0a 100644 --- a/applications/external/multi_fuzzer/lib/worker/protocol.c +++ b/applications/external/multi_fuzzer/lib/worker/protocol.c @@ -75,6 +75,7 @@ const uint8_t uid_list_cyfral[][Cyfral_DATA_SIZE] = { #define HIDProx_DATA_SIZE (6) #define PAC_DATA_SIZE (4) #define H10301_DATA_SIZE (3) +#define IOPROXXSF_DATA_SIZE (4) const uint8_t uid_list_em4100[][EM4100_DATA_SIZE] = { {0x00, 0x00, 0x00, 0x00, 0x00}, // Null bytes @@ -150,6 +151,26 @@ const uint8_t uid_list_h10301[][H10301_DATA_SIZE] = { {0xCA, 0xCA, 0xCA}, // From arha }; +const uint8_t uid_list_ioproxxsf[][IOPROXXSF_DATA_SIZE] = { + {0x00, 0x00, 0x00, 0x00}, // Null bytes + {0xFF, 0xFF, 0xFF, 0xFF}, // Only FF + {0x11, 0x11, 0x11, 0x11}, // Only 11 + {0x22, 0x22, 0x22, 0x22}, // Only 22 + {0x33, 0x33, 0x33, 0x33}, // Only 33 + {0x44, 0x44, 0x44, 0x44}, // Only 44 + {0x55, 0x55, 0x55, 0x55}, // Only 55 + {0x66, 0x66, 0x66, 0x66}, // Only 66 + {0x77, 0x77, 0x77, 0x77}, // Only 77 + {0x88, 0x88, 0x88, 0x88}, // Only 88 + {0x99, 0x99, 0x99, 0x99}, // Only 99 + {0x12, 0x34, 0x56, 0x78}, // Incremental UID + {0x9A, 0x78, 0x56, 0x34}, // Decremental UID + {0x04, 0xd0, 0x9b, 0x0d}, // From arha + {0x34, 0x00, 0x29, 0x3d}, // From arha + {0x04, 0xdf, 0x00, 0x00}, // From arha + {0xCA, 0xCA, 0xCA, 0xCA}, // From arha +}; + #if defined(RFID_125_PROTOCOL) const FuzzerProtocol fuzzer_proto_items[] = { // EM4100 @@ -192,6 +213,16 @@ const FuzzerProtocol fuzzer_proto_items[] = { .len = COUNT_OF(uid_list_h10301), }, }, + // IoProxXSF + { + .name = "IoProxXSF", + .data_size = IOPROXXSF_DATA_SIZE, + .dict = + { + .val = (const uint8_t*)&uid_list_ioproxxsf, + .len = COUNT_OF(uid_list_ioproxxsf), + }, + }, }; #else const FuzzerProtocol fuzzer_proto_items[] = { From 189ac5e44d609cf66a733feed0787bd5ad5f49a4 Mon Sep 17 00:00:00 2001 From: HTotoo Date: Thu, 2 Nov 2023 14:25:35 +0100 Subject: [PATCH 08/12] Better pocsag receiver. --- lib/subghz/protocols/pocsag.c | 68 +++++++++++++++++++++++++++++++---- 1 file changed, 62 insertions(+), 6 deletions(-) diff --git a/lib/subghz/protocols/pocsag.c b/lib/subghz/protocols/pocsag.c index e5cec9068..d9dfd3fa1 100644 --- a/lib/subghz/protocols/pocsag.c +++ b/lib/subghz/protocols/pocsag.c @@ -10,9 +10,19 @@ static const SubGhzBlockConst pocsag_const = { .te_short = 833, .te_delta = 100, }; +static const SubGhzBlockConst pocsag512_const = { + .te_short = 1950, + .te_long = 1950, + .te_delta = 120, +}; +static const SubGhzBlockConst pocsag2400_const = { + .te_short = 410, + .te_long = 410, + .te_delta = 60, +}; // Minimal amount of sync bits (interleaving zeros and ones) -#define POCSAG_MIN_SYNC_BITS 32 +#define POCSAG_MIN_SYNC_BITS 24 #define POCSAG_CW_BITS 32 #define POCSAG_CW_MASK 0xFFFFFFFF #define POCSAG_FRAME_SYNC_CODE 0x7CD215D8 @@ -45,6 +55,9 @@ struct SubGhzProtocolDecoderPocsag { // Done messages, ready to be serialized/deserialized FuriString* done_msg; + + SubGhzBlockConst* pocsag_timing; + uint32_t version; }; typedef struct SubGhzProtocolDecoderPocsag SubGhzProtocolDecoderPocsag; @@ -64,6 +77,7 @@ void* subghz_protocol_decoder_pocsag_alloc(SubGhzEnvironment* environment) { instance->generic.protocol_name = instance->base.protocol->name; instance->msg = furi_string_alloc(); instance->done_msg = furi_string_alloc(); + instance->pocsag_timing = NULL; //not synced yet if(instance->generic.result_msg == NULL) { instance->generic.result_msg = furi_string_alloc(); } @@ -179,6 +193,38 @@ void subghz_protocol_decoder_pocsag_feed(void* context, bool level, uint32_t dur // reset state - waiting for 32 bits of interleaving 1s and 0s if(instance->decoder.parser_step == PocsagDecoderStepReset) { if(DURATION_DIFF(duration, pocsag_const.te_short) < pocsag_const.te_delta) { + if(instance->pocsag_timing != &pocsag_const) { + //timing changed, so reset before, and override + subghz_protocol_decoder_pocsag_reset(context); + instance->pocsag_timing = (SubGhzBlockConst*)&pocsag_const; + instance->version = 1200; + } + // POCSAG signals are inverted + subghz_protocol_blocks_add_bit(&instance->decoder, !level); + + if(instance->decoder.decode_count_bit == POCSAG_MIN_SYNC_BITS) { + instance->decoder.parser_step = PocsagDecoderStepFoundSync; + } + } else if(DURATION_DIFF(duration, pocsag512_const.te_short) < pocsag512_const.te_delta) { + if(instance->pocsag_timing != &pocsag512_const) { + //timing changed, so reset before, and override + subghz_protocol_decoder_pocsag_reset(context); + instance->pocsag_timing = (SubGhzBlockConst*)&pocsag512_const; + instance->version = 512; + } + // POCSAG signals are inverted + subghz_protocol_blocks_add_bit(&instance->decoder, !level); + + if(instance->decoder.decode_count_bit == POCSAG_MIN_SYNC_BITS) { + instance->decoder.parser_step = PocsagDecoderStepFoundSync; + } + } else if(DURATION_DIFF(duration, pocsag2400_const.te_short) < pocsag2400_const.te_delta) { + if(instance->pocsag_timing != &pocsag2400_const) { + //timing changed, so reset before, and override + subghz_protocol_decoder_pocsag_reset(context); + instance->pocsag_timing = (SubGhzBlockConst*)&pocsag2400_const; + instance->version = 2400; + } // POCSAG signals are inverted subghz_protocol_blocks_add_bit(&instance->decoder, !level); @@ -191,12 +237,12 @@ void subghz_protocol_decoder_pocsag_feed(void* context, bool level, uint32_t dur return; } - int bits_count = duration / pocsag_const.te_short; - uint32_t extra = duration - pocsag_const.te_short * bits_count; + int bits_count = duration / instance->pocsag_timing->te_short; + uint32_t extra = duration - instance->pocsag_timing->te_short * bits_count; - if(DURATION_DIFF(extra, pocsag_const.te_short) < pocsag_const.te_delta) + if(DURATION_DIFF(extra, instance->pocsag_timing->te_short) < instance->pocsag_timing->te_delta) bits_count++; - else if(extra > pocsag_const.te_delta) { + else if(extra > instance->pocsag_timing->te_delta) { // in non-reset state we faced the error signal - we reached the end of the packet, flush data if(furi_string_size(instance->done_msg) > 0) { if(instance->base.callback) @@ -305,6 +351,11 @@ SubGhzProtocolStatus subghz_protocol_decoder_pocsag_serialize( return SubGhzProtocolStatusError; } + if(!flipper_format_write_uint32(flipper_format, "PocsagVer", &instance->version, 1)) { + FURI_LOG_E(TAG, "Error adding PocsagVer"); + return SubGhzProtocolStatusError; + } + uint8_t* s = (uint8_t*)furi_string_get_cstr(instance->done_msg); if(!flipper_format_write_hex(flipper_format, "Msg", s, msg_len)) { FURI_LOG_E(TAG, "Error adding Msg"); @@ -331,6 +382,9 @@ SubGhzProtocolStatus FURI_LOG_E(TAG, "Missing MsgLen"); break; } + //optional, so compatible backwards + instance->version = 1200; + flipper_format_read_uint32(flipper_format, "PocsagVer", &instance->version, 1); buf = malloc(msg_len); if(!flipper_format_read_hex(flipper_format, "Msg", buf, msg_len)) { @@ -349,7 +403,9 @@ SubGhzProtocolStatus void subhz_protocol_decoder_pocsag_get_string(void* context, FuriString* output) { furi_assert(context); SubGhzProtocolDecoderPocsag* instance = context; - furi_string_cat_printf(output, "%s\r\n", instance->generic.protocol_name); + furi_string_cat_printf( + output, "%s %lu\r\n", instance->generic.protocol_name, instance->version); + furi_string_cat_printf(output, "Addr: %lu\r\n", instance->ric); furi_string_cat(output, instance->done_msg); } From ec4720d37695b029d709b59260d69fdf336e8d21 Mon Sep 17 00:00:00 2001 From: SkeletonMan03 Date: Thu, 2 Nov 2023 22:42:32 -0500 Subject: [PATCH 09/12] Added Paradox, Indala26, and Viking to RFID Fuzzer --- .../multi_fuzzer/lib/worker/protocol.c | 84 +++++++++++++++++++ 1 file changed, 84 insertions(+) diff --git a/applications/external/multi_fuzzer/lib/worker/protocol.c b/applications/external/multi_fuzzer/lib/worker/protocol.c index 086f60b0a..42df99e3f 100644 --- a/applications/external/multi_fuzzer/lib/worker/protocol.c +++ b/applications/external/multi_fuzzer/lib/worker/protocol.c @@ -76,6 +76,9 @@ const uint8_t uid_list_cyfral[][Cyfral_DATA_SIZE] = { #define PAC_DATA_SIZE (4) #define H10301_DATA_SIZE (3) #define IOPROXXSF_DATA_SIZE (4) +#define PARADOX_DATA_SIZE (6) +#define INDALA26_DATA_SIZE (4) +#define VIKING_DATA_SIZE (4) const uint8_t uid_list_em4100[][EM4100_DATA_SIZE] = { {0x00, 0x00, 0x00, 0x00, 0x00}, // Null bytes @@ -171,6 +174,57 @@ const uint8_t uid_list_ioproxxsf[][IOPROXXSF_DATA_SIZE] = { {0xCA, 0xCA, 0xCA, 0xCA}, // From arha }; +const uint8_t uid_list_paradox[][PARADOX_DATA_SIZE] = { + {0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, // Null bytes + {0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF}, //Only FF + {0x11, 0x11, 0x11, 0x11, 0x11, 0x11}, // Only 11 + {0x22, 0x22, 0x22, 0x22, 0x22, 0x22}, // Only 22 + {0x33, 0x33, 0x33, 0x33, 0x33, 0x33}, // Only 33 + {0x44, 0x44, 0x44, 0x44, 0x44, 0x44}, // Only 44 + {0x55, 0x55, 0x55, 0x55, 0x55, 0x55}, //Only 55 + {0x66, 0x66, 0x66, 0x66, 0x66, 0x66}, // Only 66 + {0x77, 0x77, 0x77, 0x77, 0x77, 0x77}, // Only 77 + {0x88, 0x88, 0x88, 0x88, 0x88, 0x88}, // Only 88 + {0x99, 0x99, 0x99, 0x99, 0x99, 0x99}, //Only 99 + {0x12, 0x34, 0x56, 0x78, 0x9A, 0xBC}, // Incremental UID + {0xFF, 0xDE, 0xBC, 0x9A, 0x78, 0x56}, // Decremental UID + {0xCA, 0xCA, 0xCA, 0xCA, 0xCA, 0xCA}, // From arha +}; + +const uint8_t uid_list_indala26[][INDALA26_DATA_SIZE] = { + {0x00, 0x00, 0x00, 0x00}, // Null bytes + {0xFF, 0xFF, 0xFF, 0xFF}, //Only FF + {0x11, 0x11, 0x11, 0x11}, // Only 11 + {0x22, 0x22, 0x22, 0x22}, // Only 22 + {0x33, 0x33, 0x33, 0x33}, // Only 33 + {0x44, 0x44, 0x44, 0x44}, // Only 44 + {0x55, 0x55, 0x55, 0x55}, //Only 55 + {0x66, 0x66, 0x66, 0x66}, // Only 66 + {0x77, 0x77, 0x77, 0x77}, // Only 77 + {0x88, 0x88, 0x88, 0x88}, // Only 88 + {0x99, 0x99, 0x99, 0x99}, //Only 99 + {0x12, 0x34, 0x56, 0x78}, // Incremental UID + {0xFF, 0xDE, 0xBC, 0x9A}, // Decremental UID + {0xCA, 0xCA, 0xCA, 0xCA}, // From arha +}; + +const uint8_t uid_list_viking[][VIKING_DATA_SIZE] = { + {0x00, 0x00, 0x00, 0x00}, // Null bytes + {0xFF, 0xFF, 0xFF, 0xFF}, //Only FF + {0x11, 0x11, 0x11, 0x11}, // Only 11 + {0x22, 0x22, 0x22, 0x22}, // Only 22 + {0x33, 0x33, 0x33, 0x33}, // Only 33 + {0x44, 0x44, 0x44, 0x44}, // Only 44 + {0x55, 0x55, 0x55, 0x55}, //Only 55 + {0x66, 0x66, 0x66, 0x66}, // Only 66 + {0x77, 0x77, 0x77, 0x77}, // Only 77 + {0x88, 0x88, 0x88, 0x88}, // Only 88 + {0x99, 0x99, 0x99, 0x99}, //Only 99 + {0x12, 0x34, 0x56, 0x78}, // Incremental UID + {0xFF, 0xDE, 0xBC, 0x9A}, // Decremental UID + {0xCA, 0xCA, 0xCA, 0xCA}, // From arha +}; + #if defined(RFID_125_PROTOCOL) const FuzzerProtocol fuzzer_proto_items[] = { // EM4100 @@ -223,6 +277,36 @@ const FuzzerProtocol fuzzer_proto_items[] = { .len = COUNT_OF(uid_list_ioproxxsf), }, }, + // Paradox + { + .name = "Paradox", + .data_size = PARADOX_DATA_SIZE, + .dict = + { + .val = (const uint8_t*)&uid_list_paradox, + .len = COUNT_OF(uid_list_paradox), + }, + }, + // Indala26 + { + .name = "Indala26", + .data_size = INDALA26_DATA_SIZE, + .dict = + { + .val = (const uint8_t*)&uid_list_indala26, + .len = COUNT_OF(uid_list_indala26), + }, + }, + // Viking + { + .name = "Viking", + .data_size = VIKING_DATA_SIZE, + .dict = + { + .val = (const uint8_t*)&uid_list_viking, + .len = COUNT_OF(uid_list_viking), + }, + }, }; #else const FuzzerProtocol fuzzer_proto_items[] = { From d15cedc1b1f2e75dc2d7446209eef6f4c477def4 Mon Sep 17 00:00:00 2001 From: Clara K Date: Fri, 3 Nov 2023 12:50:53 +0100 Subject: [PATCH 10/12] Thanks paypal <3 --nobuild --- ReadMe.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ReadMe.md b/ReadMe.md index 152eb56ab..af9305ecd 100644 --- a/ReadMe.md +++ b/ReadMe.md @@ -221,7 +221,7 @@ If you like what you're seeing, **please consider donating to us**. We won't eve - **[Patreon](https://patreon.com/crazyco)**: ❤️ Account needed, subscription with perks across my entire org. - **[Wire-transfer](https://bunq.me/ClaraK)**: No account needed, one-time -- **[Paypal](https://paypal.me/RdX2020)**: Account needed, one-time +- **[Paypal](https://paypal.me/ClaraCrazy)**: Account needed, one-time - **[ko-fi](https://ko-fi.com/cynthialabs)**: No account needed, one-time - **Monero**: `41kyWeeoVdK4quzQ4M9ikVGs6tCQCLfdx8jLExTNsAu2SF1QAyDqRdjfGM6EL8L9NpXwt89HJeAoGf1aoArk7nDr4AMMV4T` From b0a57b47e9c53241aade8b1bf552da892a553458 Mon Sep 17 00:00:00 2001 From: Willy-JL <49810075+Willy-JL@users.noreply.github.com> Date: Sat, 4 Nov 2023 00:11:13 +0000 Subject: [PATCH 11/12] Fix new subghz filter system bug!!!!! No wonder nothing was getting picked up, my bad! Thanks @htotoo for spotting this! --nobuild --- applications/main/subghz/scenes/subghz_scene_receiver.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/applications/main/subghz/scenes/subghz_scene_receiver.c b/applications/main/subghz/scenes/subghz_scene_receiver.c index 25267a6c4..3d570cc35 100644 --- a/applications/main/subghz/scenes/subghz_scene_receiver.c +++ b/applications/main/subghz/scenes/subghz_scene_receiver.c @@ -106,7 +106,7 @@ static void subghz_scene_add_to_history_callback( SubGhz* subghz = context; // The check can be moved to /lib/subghz/receiver.c, but may result in false positives - if((decoder_base->protocol->flag & subghz->ignore_filter) == 0) { + if((decoder_base->protocol->filter & subghz->ignore_filter) == 0) { SubGhzHistory* history = subghz->history; FuriString* item_name = furi_string_alloc(); FuriString* item_time = furi_string_alloc(); From e74847a40f012fc56c4588db83d8cef076583b10 Mon Sep 17 00:00:00 2001 From: SkeletonMan03 Date: Fri, 3 Nov 2023 20:16:22 -0500 Subject: [PATCH 12/12] Add Keri and Jablotron to RFID Fuzzer --- .../multi_fuzzer/lib/worker/protocol.c | 102 ++++++++++++++++-- 1 file changed, 93 insertions(+), 9 deletions(-) diff --git a/applications/external/multi_fuzzer/lib/worker/protocol.c b/applications/external/multi_fuzzer/lib/worker/protocol.c index 42df99e3f..0c8322e5c 100644 --- a/applications/external/multi_fuzzer/lib/worker/protocol.c +++ b/applications/external/multi_fuzzer/lib/worker/protocol.c @@ -79,6 +79,9 @@ const uint8_t uid_list_cyfral[][Cyfral_DATA_SIZE] = { #define PARADOX_DATA_SIZE (6) #define INDALA26_DATA_SIZE (4) #define VIKING_DATA_SIZE (4) +#define PYRAMID_DATA_SIZE (4) +#define KERI_DATA_SIZE (4) +#define JABLOTRON_DATA_SIZE (5) const uint8_t uid_list_em4100[][EM4100_DATA_SIZE] = { {0x00, 0x00, 0x00, 0x00, 0x00}, // Null bytes @@ -176,16 +179,16 @@ const uint8_t uid_list_ioproxxsf[][IOPROXXSF_DATA_SIZE] = { const uint8_t uid_list_paradox[][PARADOX_DATA_SIZE] = { {0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, // Null bytes - {0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF}, //Only FF + {0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF}, // Only FF {0x11, 0x11, 0x11, 0x11, 0x11, 0x11}, // Only 11 {0x22, 0x22, 0x22, 0x22, 0x22, 0x22}, // Only 22 {0x33, 0x33, 0x33, 0x33, 0x33, 0x33}, // Only 33 {0x44, 0x44, 0x44, 0x44, 0x44, 0x44}, // Only 44 - {0x55, 0x55, 0x55, 0x55, 0x55, 0x55}, //Only 55 + {0x55, 0x55, 0x55, 0x55, 0x55, 0x55}, // Only 55 {0x66, 0x66, 0x66, 0x66, 0x66, 0x66}, // Only 66 {0x77, 0x77, 0x77, 0x77, 0x77, 0x77}, // Only 77 {0x88, 0x88, 0x88, 0x88, 0x88, 0x88}, // Only 88 - {0x99, 0x99, 0x99, 0x99, 0x99, 0x99}, //Only 99 + {0x99, 0x99, 0x99, 0x99, 0x99, 0x99}, // Only 99 {0x12, 0x34, 0x56, 0x78, 0x9A, 0xBC}, // Incremental UID {0xFF, 0xDE, 0xBC, 0x9A, 0x78, 0x56}, // Decremental UID {0xCA, 0xCA, 0xCA, 0xCA, 0xCA, 0xCA}, // From arha @@ -193,16 +196,16 @@ const uint8_t uid_list_paradox[][PARADOX_DATA_SIZE] = { const uint8_t uid_list_indala26[][INDALA26_DATA_SIZE] = { {0x00, 0x00, 0x00, 0x00}, // Null bytes - {0xFF, 0xFF, 0xFF, 0xFF}, //Only FF + {0xFF, 0xFF, 0xFF, 0xFF}, // Only FF {0x11, 0x11, 0x11, 0x11}, // Only 11 {0x22, 0x22, 0x22, 0x22}, // Only 22 {0x33, 0x33, 0x33, 0x33}, // Only 33 {0x44, 0x44, 0x44, 0x44}, // Only 44 - {0x55, 0x55, 0x55, 0x55}, //Only 55 + {0x55, 0x55, 0x55, 0x55}, // Only 55 {0x66, 0x66, 0x66, 0x66}, // Only 66 {0x77, 0x77, 0x77, 0x77}, // Only 77 {0x88, 0x88, 0x88, 0x88}, // Only 88 - {0x99, 0x99, 0x99, 0x99}, //Only 99 + {0x99, 0x99, 0x99, 0x99}, // Only 99 {0x12, 0x34, 0x56, 0x78}, // Incremental UID {0xFF, 0xDE, 0xBC, 0x9A}, // Decremental UID {0xCA, 0xCA, 0xCA, 0xCA}, // From arha @@ -210,21 +213,72 @@ const uint8_t uid_list_indala26[][INDALA26_DATA_SIZE] = { const uint8_t uid_list_viking[][VIKING_DATA_SIZE] = { {0x00, 0x00, 0x00, 0x00}, // Null bytes - {0xFF, 0xFF, 0xFF, 0xFF}, //Only FF + {0xFF, 0xFF, 0xFF, 0xFF}, // Only FF {0x11, 0x11, 0x11, 0x11}, // Only 11 {0x22, 0x22, 0x22, 0x22}, // Only 22 {0x33, 0x33, 0x33, 0x33}, // Only 33 {0x44, 0x44, 0x44, 0x44}, // Only 44 - {0x55, 0x55, 0x55, 0x55}, //Only 55 + {0x55, 0x55, 0x55, 0x55}, // Only 55 {0x66, 0x66, 0x66, 0x66}, // Only 66 {0x77, 0x77, 0x77, 0x77}, // Only 77 {0x88, 0x88, 0x88, 0x88}, // Only 88 - {0x99, 0x99, 0x99, 0x99}, //Only 99 + {0x99, 0x99, 0x99, 0x99}, // Only 99 {0x12, 0x34, 0x56, 0x78}, // Incremental UID {0xFF, 0xDE, 0xBC, 0x9A}, // Decremental UID {0xCA, 0xCA, 0xCA, 0xCA}, // From arha }; +const uint8_t uid_list_pyramid[][PYRAMID_DATA_SIZE] = { + {0x00, 0x00, 0x00, 0x00}, // Null bytes + {0xFF, 0xFF, 0xFF, 0xFF}, // Only FF + {0x11, 0x11, 0x11, 0x11}, // Only 11 + {0x22, 0x22, 0x22, 0x22}, // Only 22 + {0x33, 0x33, 0x33, 0x33}, // Only 33 + {0x44, 0x44, 0x44, 0x44}, // Only 44 + {0x55, 0x55, 0x55, 0x55}, // Only 55 + {0x66, 0x66, 0x66, 0x66}, // Only 66 + {0x77, 0x77, 0x77, 0x77}, // Only 77 + {0x88, 0x88, 0x88, 0x88}, // Only 88 + {0x99, 0x99, 0x99, 0x99}, // Only 99 + {0x12, 0x34, 0x56, 0x78}, // Incremental UID + {0xFF, 0xDE, 0xBC, 0x9A}, // Decremental UID + {0xCA, 0xCA, 0xCA, 0xCA}, // From arha +}; + +const uint8_t uid_list_keri[][KERI_DATA_SIZE] = { + {0x00, 0x00, 0x00, 0x00}, // Null bytes + {0xFF, 0xFF, 0xFF, 0xFF}, // Only FF + {0x11, 0x11, 0x11, 0x11}, // Only 11 + {0x22, 0x22, 0x22, 0x22}, // Only 22 + {0x33, 0x33, 0x33, 0x33}, // Only 33 + {0x44, 0x44, 0x44, 0x44}, // Only 44 + {0x55, 0x55, 0x55, 0x55}, // Only 55 + {0x66, 0x66, 0x66, 0x66}, // Only 66 + {0x77, 0x77, 0x77, 0x77}, // Only 77 + {0x88, 0x88, 0x88, 0x88}, // Only 88 + {0x99, 0x99, 0x99, 0x99}, // Only 99 + {0x12, 0x34, 0x56, 0x78}, // Incremental UID + {0xFF, 0xDE, 0xBC, 0x9A}, // Decremental UID + {0xCA, 0xCA, 0xCA, 0xCA}, // From arha +}; + +const uint8_t uid_list_jablotron[][JABLOTRON_DATA_SIZE] = { + {0x00, 0x00, 0x00, 0x00, 0x00}, // Null bytes + {0xFF, 0xFF, 0xFF, 0xFF, 0xFF}, // Only FF + {0x11, 0x11, 0x11, 0x11, 0x11}, // Only 11 + {0x22, 0x22, 0x22, 0x22, 0x22}, // Only 22 + {0x33, 0x33, 0x33, 0x33, 0x33}, // Only 33 + {0x44, 0x44, 0x44, 0x44, 0x44}, // Only 44 + {0x55, 0x55, 0x55, 0x55, 0x55}, // Only 55 + {0x66, 0x66, 0x66, 0x66, 0x66}, // Only 66 + {0x77, 0x77, 0x77, 0x77, 0x77}, // Only 77 + {0x88, 0x88, 0x88, 0x88, 0x88}, // Only 88 + {0x99, 0x99, 0x99, 0x99, 0x99}, // Only 99 + {0x12, 0x34, 0x56, 0x78, 0x9A}, // Incremental UID + {0xFF, 0xDE, 0xBC, 0x9A, 0x78}, // Decremental UID + {0xCA, 0xCA, 0xCA, 0xCA, 0xCA}, // From arha +}; + #if defined(RFID_125_PROTOCOL) const FuzzerProtocol fuzzer_proto_items[] = { // EM4100 @@ -307,6 +361,36 @@ const FuzzerProtocol fuzzer_proto_items[] = { .len = COUNT_OF(uid_list_viking), }, }, + // Pyramid + { + .name = "Pyramid", + .data_size = PYRAMID_DATA_SIZE, + .dict = + { + .val = (const uint8_t*)&uid_list_pyramid, + .len = COUNT_OF(uid_list_pyramid), + }, + }, + // Keri + { + .name = "Keri", + .data_size = KERI_DATA_SIZE, + .dict = + { + .val = (const uint8_t*)&uid_list_keri, + .len = COUNT_OF(uid_list_keri), + }, + }, + // Jablotron + { + .name = "Jablotron", + .data_size = JABLOTRON_DATA_SIZE, + .dict = + { + .val = (const uint8_t*)&uid_list_jablotron, + .len = COUNT_OF(uid_list_jablotron), + }, + }, }; #else const FuzzerProtocol fuzzer_proto_items[] = {