Keeloq: Centurion Nova support

This commit is contained in:
MX 2023-07-06 00:49:54 +03:00
parent 550edc3666
commit e6ae2c03ca
No known key found for this signature in database
GPG key ID: 7CCC66B7DBDD1C83
5 changed files with 117 additions and 60 deletions

View file

@ -93,6 +93,7 @@ Encoders or sending made by @xMasterX:
- Keeloq: Stilmatic
- Keeloq: CAME Space
- Keeloq: Aprimatic (model TR and similar)
- Keeloq: Centurion Nova (thanks Carlos !)
Encoders or sending made by @Eng1n33r(first implementation in Q2 2022) & @xMasterX (current version):
- CAME Atomo -> Update! check out new [instructions](https://github.com/DarkFlippers/unleashed-firmware/blob/dev/documentation/SubGHzRemoteProg.md)

View file

@ -15,6 +15,7 @@ typedef enum {
SubmenuIndexBeninca868,
SubmenuIndexAllmatic433,
SubmenuIndexAllmatic868,
SubmenuIndexCenturion433,
SubmenuIndexIronLogic,
SubmenuIndexElmesElectronic,
SubmenuIndexSommer_FM_434,

View file

@ -91,6 +91,12 @@ void subghz_scene_set_type_on_enter(void* context) {
SubmenuIndexAllmatic868,
subghz_scene_set_type_submenu_callback,
subghz);
submenu_add_item(
subghz->submenu,
"KL: Centurion 433MHz",
SubmenuIndexCenturion433,
subghz_scene_set_type_submenu_callback,
subghz);
submenu_add_item(
subghz->submenu,
"KL: Sommer 434MHz",
@ -444,6 +450,15 @@ bool subghz_scene_set_type_on_event(void* context, SceneManagerEvent event) {
scene_manager_next_scene(subghz->scene_manager, SubGhzSceneShowError);
}
break;
case SubmenuIndexCenturion433:
generated_protocol = subghz_txrx_gen_keeloq_protocol(
subghz->txrx, "AM650", 433920000, (key & 0x0000FFFF), 0x2, 0x0003, "Centurion");
if(!generated_protocol) {
furi_string_set(
subghz->error_str, "Function requires\nan SD card with\nfresh databases.");
scene_manager_next_scene(subghz->scene_manager, SubGhzSceneShowError);
}
break;
case SubmenuIndexElmesElectronic:
generated_protocol = subghz_txrx_gen_keeloq_protocol(
subghz->txrx,

View file

@ -1,58 +1,59 @@
Filetype: Flipper SubGhz Keystore File
Version: 0
Encryption: 1
IV: AF 0B A3 13 56 FA F7 46 76 78 25 28 34 16 3D 62
77995F096640A6CA8735DE839975FA3573145DDB995E45F58AECCD6A6F2D6FCB
A062DD58F9957EC098075344DFF69FB3B2A3C9893D4240C74BE32299F330290B
2AD2CCC4FB760D772001A903A995435260F442152BDCD5B075FBC61015BEC7E1
34AE78CF87A10211C8E6F6E2EE18C4F0BBE3B677094B7118E03AD9E89AF70E28
41943E7507D37A344F56EDF4BBDCDA75FAA10A6E97DF801ACF2A0E97E41782053CA74E31E3488EA1AFE29369E7A542C7
9FA67B118BC1FE289F38A78DA4E1FFBAEB4498404B49CBD9690B9421FC05564D
3A872E97A668C644D3827273ADDA6B1BC689A3AD09F5980EC7461E40624653BE
5E1F4D865E5F4176DBF7832992B60947812E05701E647CF36427C2EE04F97FE2
7FCF6E437D0DA231A2937C46622C4939F0045AEF5CF7FCF5D97E24B67995F0D3
D09F230FEDB9CB690B5AC7C6BCE86B0779D9C233D2823562EABE340FF06C819D
84F0A81ABB7857438BF52BE8988C1A471EFEDFE16EC11851BFC39F34EB26236F318CFAAEC9A53AD5500D48CAE21E777A
F3FDDDD5DB6038D0E2FC02750530325976ADA2600DE19BF736AF6CB7E810D7627B4F396963F0288F486182228B9AAE22
87E07B23B3B2740D93C82696C020057CC7F3864ABD6E6967656F44427C529DD1
20C35809F7F5161C21E643A606DC48A5CC85BCEB546A03023DF778C4499426E3
81CCF1CA68E2B6663DA9D12FEE241307A2E449440901793A955CB5D5915819DD
1B66D0664451153D0124364834E1543960A756351330523C3FFE83DA4EE7F0E6
7025D550A40466B472BA71F3248C37E6DE1FD59ED5C11CBB26238795DD44F4B21BD447F3CA72AED6A25B977982100A1E
99F38C3F7C89D2805FB36F931AC5D1B248A56838AC29E13B1255CAE706B68216
D138C616E4E1F6053177118C94F65C0BA6B155286CE63E0728E3F2D2BF6C6A98
276E646DBF54B341F93AB4E1C36525AF983879F7251D84BB02DD54F4A5E0FA85A3278891F7ADA9ADE2F8AAD010F6F6D4
3F3598143FE40E04FE25EADE1EC2B4CDAE339AF7730AE9DC45C97C0E44B299DBCC0E9DA6F4B0EE00F25D2FDD9E1C6BF5
20FA8F62628FEA51A584CE298F22E60FF85BFE193AF1C5DE57605FF02E90739C
B14B4896088EF58E0CE659511C93782FB5F94BC69B64E5011EBD10DF18FFB3B1
90BBE045FFEA06A77B55B0B6D0CFA8F12C4E1B35FB0111DD0C2CF1637AE8924A
04B87BC1D09E8EE3C8A91CE75169546D37868B2D87BF2D712623F84937ACE974
B8C5B04070FFB27B4686057C57F762FA3CAF2BBD3E5BEBE462C1C2FC283AE118
A40B154CEC2F5F989CA6F30703A0133217530D41F12739B25E2C1BEF54E6AC7C
4F5B9A68E8DEDB00410F5AD7FB7F7CA8F43B75F0457DA2AFAA8279A8C4AF34AB
9A7B185F6A157B1886DC6AA98B1F3D6899331D8BDDBAAC9620321E16BB4CC7E8
4A710E11F1C7A7138065801BDB4E72B07608220BBCF7455111FDD41DC0290B94
3A5B715089F926049077172755B0C48B4A4420031787D7DB113CF402C7D3D0AE
EE0B90EC27EC0F4A8DCD3C747E17594E0A27A92E05F2DE7B0457873C7154E075
0B9B201C209072676A47225BE4E43B4631B080A85F9FCFAA5683A4F9A727187A
13A15C606AA2EA40F2DCDE7F44217F02D2D9796CAC9164100B211D7A22CF333B
DF5292BBF35AB1408956D439A81EF12F53573F985489727A10FB652B7BD8B10D
50E59C9DD3A08EA8752656B753B8D9D2BFD674EB4C5F0DCAE9870E81D7F00F6AAC133FA7C7307FA197D551EE877F8CD7
E173C1798596A31F697D63E0CCDDFAB14B1B1E299DD642102A7858ECC795CF1B
92D3326A93AA6B37041F219C8035F37A057C1B69BECA7881098BED2A49C58751
27D17F007115734FA0F55F2BDF016ECE8DFA703FA6D61729456E95B78FC8AC29
4FF7306A426B7DE021D59968FAEF3453F555A9A952D81C4008D5000513799DEA
660CB0D4634EABC6CAA9E321CB08FC0C8C8F6BAE0FAF0C10C1FCCBA93B68D9B4
86D84C91BFBF0DE22088C0F5A8598A2C2807033E60BC11333E8D1A6188F043D5
F3E0E8566E12ADBA44974A3CA1D6D60456649031DCAD4365D0AE80FEDBC80AAA106A9BAB39448CD62EF916A59ECA9579
F4D6EB6D241B17CA0A9E73E93DA3B58B6B257CC0484FC92E285984A09FD4CEA9
094265CB574E0C9B8954B3130A2017492B1149C3FB9239A6B690A9C7B6635E5A
BE67B61B2F99BAA4AF94B71CB5F2386417D5F3B187899222D2671B1147BA9932
74840B34C9F27A76FCB593629C8114BCABD1B1CE96E22CC378DC9E7BEEF263FB
2511F44F0A13D94B55D7FF3297194E47D6987890F9170BCBC14A7607C5A38E01
FD0CF9314CB9B949CEFE1DA3FA05A18FBEEF751B4DC900DBAE068EE211C4492C
22ECD6934472760CF806E7C9E86885D0C0AAE501EDBF9DCB7ADC7AE53F3B73C38F2B6FB3FD0F867C5B5BFD00440CB43A
325CA78241AE4EE784CC867815403E342F77BB428EB1FE189AD569F10170CB98
BF065D29EC8E2BB411F0131DF3A06BDF07B1436A14004D0E11E1261F0E232CB8
CE015802FCE9AFD9807F855D813FD06D5446A8953057A79BC4A452BDAB8E9DD7
C6B569EB172EC4609966E2C9426BE99A86529073A57824B1752392658C4E87F08ED8675A32F44E413CD6037CA4A0DE71
IV: AD 0B A4 A1 51 C0 C0 41 36 78 26 82 17 24 9D 62
0D18FF475E57A67CC5C0B430664E8EF6E07CB6AF72454995F17DE84E2E876D87
C9BC55E1E3A9B312E341D7E2663C66C2479D5C51AE2EB83BAE47D8C6C79DB8A0
776E01A7B4FCB929FA59CFE1F16D2D600F6FD9FD8BE1E9E41667144E61E023E4
C354F854F14AAC08C6A51606582CD73EECEED54779927DC1E04A0D72C4E6A58E
09BA4DC551CDB0141F4A053133DBF9B7B99CBAA402C7B6B2AC8ADB516CA2FCB29FF9744DD95FB009BED6A09AE3303317
675777F65042358100A9A2BE142C42E10CC5CF98CA6BFF82284FFD9BF7E7FB11
4739972DCC08EFF0E8547694A67E116F3EC8638F286E333E7D89F2D61218F65D
FE8D5A0A9ED36545004CEE70D3C1FE477F34212364CF7C9EBA0FDD4F6B8F1D3E
453D5C6FE0EA7FD779B54696E66DE6BD6AEF3B1EE347142A3DB7505609077219
A52339EE40D046E7DF6C130CEC7F9F686753A73A5F72EF344E01B00C3A3CF5F2
94029CE386CC0403984F7C9D80B40FF12BE6E50412891FD45B347742340D1E6E679102DEC6F7D36C36863701A2BBDA7B
793633A3D97D704779E2E841A5F616ED0BB0BD50740C0B196D72C6C6453124183CA93ADCAC1A5042EBD579AC238B9DBC
B1C6EBB7320CAE97E28A244228B288BEEA44C9FD262E2C448219DAC6E194CB14
A6C374B3FB7E8BB6F3052ED9DB67E5BCFA6CCC42F5A0D7F20BEDB7C0B58592A5
DF4FCBDCA3414B7551797A856048625186B2EC7B836EB35B4B080CEE4A72C39F
4127F58BDEB18D79EA8317B1858F7575CF4B648E3C53338975B4A093FA9730C0
294659EBD39D7CC01DC4E0E3B0B90A3555704E736D3BE4485BAAACBC58A84652CF3A7DA3C271E3198C72561332F2A141
9E2CC77756BE7AB3D500C0B4A91271C0A4DED5BCB78484217EA922B7878AA8F5
BF13D9949C783CF6B2F0E489A6912E56DDD9183D651D7F36FD0342981596A85C
8441C62006E1334FC31F53DAFF5281260C463AF3E92B1E797CB67882C49566846825606804C14C49FFD440F4E05CE692
BE7E62E9CFA1C703CCB971F2B0C6C0F339C78A951CA8DB287B40C3BA76EA7179E8B62C29EAC8293FD218CF981BB84BEF
DA53C52101FAC8FD8F9545768CF1DB59F3B31C9249A2FC64B66DB259C721ABE1
C9842AD0A8A8E94FCE94F46BDE89DAA8D11C41F9C83A7F6394D595028829AB92
904A94542BCD85F72D470640A220FD28EBC337C0673C189C96BFB8CE373B4F84
EEEE187B03FE77B955F22214707017DB8A60B2E3979D5C2F6BED61D0623D4D50
CEF91BE6EBD8F331E2422B6B948053E8DA143F3DD907C922E0328D49B0ADA8A6
A6F0F8A4F03B45062CEA86B291E80EE15906C0B226ABDB77E222EB95B026952D
62280870E48A2E8B8A18AD5DFF0089E927BEACE1F81A8BB1A8A2BE8EB0E92BFD
C9A3DE8165D47D1D41715F00192313755226C1B0A3D04BCD7A121B1CB4999FBD
3CAEEB62FCF601F34D3320E3EACE9EFC5D627BF69FEE965F8B84A258A765B6FE
8D83CC36514CE5CC46B181AE28089BE5BC99CE3096C569751B4E07A7D956AFA3
0F81DDB18F60E238C7FF751E70431AA5328EFDBBDFF03D5F360A524AA968CEE9
1F1E498A279E9BA15CB6BB836E90FEE522F2BE16572A4D057DF9C2B104487458
68C60FF95056BE4D814CE9B8A4175625DB3E365712C2D3E42CEEBA2E0977CDB9
D95FB21943FCAD5A21F157E629314986D92F568FD3067B65911135E6335FB7E8
17908EF142C4B6740CBE7DCA43DA3C23C7912739299786473A994E5752E7E9459B23653EE0D7775FCECB7B7608CB0495
6D17B6BA17DBFFAA4E90953CE6A73AB967076B8FBC14A9361D93A01C0850CC38
8723740BCC0A5CCEE52B6EF73DD441672FB6728965CC588044C78D495AB0675F
CA548FA44A444C8F45490A11DBC8FB24E6DB38F910EC60520A3890C8B45664FE
591356440344AAFEC21FAA0C85B6A8F354D45074932E37E0972F851E08937469
DE3A54CAAC8014625EE502F547A93754AFAD0A7EB6028599D03CCB0473BC8D5C
B2C2F6F971034E1591AD374793D6D17A595D6544DF5A9585780C6B2E3505BCFF
54447BE6C626D1CA37FD799B76B35ED266D12757B5DA1AB9277F671BBF7F07B461D0CE26593F1372354979E836972F85
45FBD88AA7C26B967BC3638F6083A6B83AA82D5B974B37DF1C3F52839DDA020C
33B9890FBE46FDB7AEE404B71C893DC20059F96224CF48F284A66D3A8D91918E
CCEA5BC148BC84DB4825320A2B8D39A30BAB4641FFEE33BD4B8700339F15892D
4BC4E0D1263E9B02DA401C884923778D1A6FACACFFE7F660381ECD64CCA5CCD2
0284EA911FB1B37F623F92B1662E10D79AEBD0009C107A9C554D417F7553B28E
FE48F26C44FA4C3EB3B2F3497FE99AC30A0A7BF9FF261740E177D7A2A5BD7880
1EA96FEBB62543A8731D19BBDD1C7FE323CADBAB7242E5A8F4B1D706964B4C32
4AB7EEF02FD59EA5D16837A50282A6254B93A34F31FE9335DA9FABEF76EA714591029C64967506B99860358E5CBF4EDA
A0F25C5387FE9B871E246F33FE64396A5DC0A9BC9AD9DF9E219F3482ADD6497E
0130F99FA395F4364491E6718B53E9D6983B68E29A70035B158CA7629C31C33E
3CDAEDA88534C2E31D1235C99DEC466221C89F63E1F8F59C9CE224573E39E2D4
F5ED2863D8B51DA620484CDE23D590F4A208DA6D155E645FCD6BCF5FEB39EE551EAE9C0366F7FFD4CBF1DCA063D154E1

View file

@ -231,6 +231,9 @@ static bool subghz_protocol_keeloq_gen_data(
} else if(strcmp(instance->manufacture_name, "Beninca") == 0) {
decrypt = btn << 28 | (0x000) << 16 | instance->generic.cnt;
// Beninca / Allmatic -> no serial - simple XOR
} else if(strcmp(instance->manufacture_name, "Centurion") == 0) {
decrypt = btn << 28 | (0x1CE) << 16 | instance->generic.cnt;
// Centurion -> no serial in hop, uses fixed value 0x1CE - normal learning
}
uint8_t kl_type_en = instance->keystore->kl_type;
for
@ -302,7 +305,7 @@ static bool subghz_protocol_keeloq_gen_data(
uint64_t yek = (uint64_t)fix << 32 | hop;
instance->generic.data =
subghz_protocol_blocks_reverse_key(yek, instance->generic.data_count_bit);
} // What should happen if seed = 0 in bft programming mode
} // What should happen if seed = 0 in bft programming mode -> collapse of the universe I think :)
return true; // Always return true
}
@ -693,6 +696,33 @@ static inline bool subghz_protocol_keeloq_check_decrypt(
if((decrypt >> 28 == btn) && (((((uint16_t)(decrypt >> 16)) & 0xFF) == end_serial) ||
((((uint16_t)(decrypt >> 16)) & 0xFF) == 0))) {
instance->cnt = decrypt & 0x0000FFFF;
/*FURI_LOG_I(
"KL",
"decrypt: 0x%08lX, btn: %d, end_serial: 0x%03lX, cnt: %ld",
decrypt,
btn,
end_serial,
instance->cnt);*/
return true;
}
return false;
}
// Centurion specific check
static inline bool subghz_protocol_keeloq_check_decrypt_centurion(
SubGhzBlockGeneric* instance,
uint32_t decrypt,
uint8_t btn) {
furi_assert(instance);
if((decrypt >> 28 == btn) && (((((uint16_t)(decrypt >> 16)) & 0x3FF) == 0x1CE))) {
instance->cnt = decrypt & 0x0000FFFF;
/*FURI_LOG_I(
"KL",
"decrypt: 0x%08lX, btn: %d, end_serial: 0x%03lX, cnt: %ld",
decrypt,
btn,
end_serial,
instance->cnt);*/
return true;
}
return false;
@ -753,10 +783,19 @@ static uint8_t subghz_protocol_keeloq_check_remote_controller_selector(
man =
subghz_protocol_keeloq_common_normal_learning(fix, manufacture_code->key);
decrypt = subghz_protocol_keeloq_common_decrypt(hop, man);
if(subghz_protocol_keeloq_check_decrypt(instance, decrypt, btn, end_serial)) {
*manufacture_name = furi_string_get_cstr(manufacture_code->name);
keystore->mfname = *manufacture_name;
return 1;
if((strcmp(furi_string_get_cstr(manufacture_code->name), "Centurion") == 0)) {
if(subghz_protocol_keeloq_check_decrypt_centurion(instance, decrypt, btn)) {
*manufacture_name = furi_string_get_cstr(manufacture_code->name);
keystore->mfname = *manufacture_name;
return 1;
}
} else {
if(subghz_protocol_keeloq_check_decrypt(
instance, decrypt, btn, end_serial)) {
*manufacture_name = furi_string_get_cstr(manufacture_code->name);
keystore->mfname = *manufacture_name;
return 1;
}
}
break;
case KEELOQ_LEARNING_SECURE: