From 02d44c32e2f098bf7e6c497a643549f0e3b72d2a Mon Sep 17 00:00:00 2001 From: r3df0xx Date: Sat, 2 Apr 2022 16:40:04 +0300 Subject: [PATCH] fix debug output --- lib/subghz/protocols/keeloq.c | 17 +++++++++-------- lib/subghz/protocols/star_line.c | 9 +++++---- 2 files changed, 14 insertions(+), 12 deletions(-) diff --git a/lib/subghz/protocols/keeloq.c b/lib/subghz/protocols/keeloq.c index ab24a8e7f..f484ebabd 100644 --- a/lib/subghz/protocols/keeloq.c +++ b/lib/subghz/protocols/keeloq.c @@ -479,11 +479,12 @@ static uint8_t subghz_protocol_keeloq_check_remote_controller_selector( for M_EACH(manufacture_code, *subghz_keystore_get_data(keystore), SubGhzKeyArray_t) { + uint32_t hi = manufacture_code->key >> 32; switch(manufacture_code->type) { case KEELOQ_LEARNING_SIMPLE: // Simple Learning decrypt = subghz_protocol_keeloq_common_decrypt(hop, manufacture_code->key); - FURI_LOG_I(TAG, "mfkey: %08lX%08lX", manufacture_code->key >> 32, manufacture_code->key); + FURI_LOG_I(TAG, "mfkey: %08lX%08lX", hi, manufacture_code->key); if(subghz_protocol_keeloq_check_decrypt(instance, decrypt, btn, end_serial)) { *manufacture_name = string_get_cstr(manufacture_code->name); return 1; @@ -493,7 +494,7 @@ static uint8_t subghz_protocol_keeloq_check_remote_controller_selector( // Normal Learning // https://phreakerclub.com/forum/showpost.php?p=43557&postcount=37 man = subghz_protocol_keeloq_common_normal_learning(fix, manufacture_code->key); - FURI_LOG_I(TAG, "mfkey: %08lX%08lX", manufacture_code->key >> 32, manufacture_code->key); + FURI_LOG_I(TAG, "mfkey: %08lX%08lX", hi, manufacture_code->key); decrypt = subghz_protocol_keeloq_common_decrypt(hop, man); if(subghz_protocol_keeloq_check_decrypt(instance, decrypt, btn, end_serial)) { *manufacture_name = string_get_cstr(manufacture_code->name); @@ -503,7 +504,7 @@ static uint8_t subghz_protocol_keeloq_check_remote_controller_selector( case KEELOQ_LEARNING_SECURE: man = subghz_protocol_keeloq_common_secure_learning( fix, seed, manufacture_code->key); - FURI_LOG_I(TAG, "mfkey: %08lX%08lX", manufacture_code->key >> 32, manufacture_code->key); + FURI_LOG_I(TAG, "mfkey: %08lX%08lX", hi, manufacture_code->key); decrypt = subghz_protocol_keeloq_common_decrypt(hop, man); if(subghz_protocol_keeloq_check_decrypt(instance, decrypt, btn, end_serial)) { *manufacture_name = string_get_cstr(manufacture_code->name); @@ -513,7 +514,7 @@ static uint8_t subghz_protocol_keeloq_check_remote_controller_selector( case KEELOQ_LEARNING_MAGIC_XOR_TYPE_1: man = subghz_protocol_keeloq_common_magic_xor_type1_learning( fix, manufacture_code->key); - FURI_LOG_I(TAG, "mfkey: %08lX%08lX", manufacture_code->key >> 32, manufacture_code->key); + FURI_LOG_I(TAG, "mfkey: %08lX%08lX", hi, manufacture_code->key); decrypt = subghz_protocol_keeloq_common_decrypt(hop, man); if(subghz_protocol_keeloq_check_decrypt(instance, decrypt, btn, end_serial)) { *manufacture_name = string_get_cstr(manufacture_code->name); @@ -523,7 +524,7 @@ static uint8_t subghz_protocol_keeloq_check_remote_controller_selector( case KEELOQ_LEARNING_UNKNOWN: // Simple Learning decrypt = subghz_protocol_keeloq_common_decrypt(hop, manufacture_code->key); - FURI_LOG_I(TAG, "mfkey: %08lX%08lX", manufacture_code->key >> 32, manufacture_code->key); + FURI_LOG_I(TAG, "mfkey: %08lX%08lX", hi, manufacture_code->key); if(subghz_protocol_keeloq_check_decrypt(instance, decrypt, btn, end_serial)) { *manufacture_name = string_get_cstr(manufacture_code->name); return 1; @@ -544,7 +545,7 @@ static uint8_t subghz_protocol_keeloq_check_remote_controller_selector( // Normal Learning // https://phreakerclub.com/forum/showpost.php?p=43557&postcount=37 man = subghz_protocol_keeloq_common_normal_learning(fix, manufacture_code->key); - FURI_LOG_I(TAG, "mfkey: %08lX%08lX", manufacture_code->key >> 32, manufacture_code->key); + FURI_LOG_I(TAG, "mfkey: %08lX%08lX", hi, manufacture_code->key); decrypt = subghz_protocol_keeloq_common_decrypt(hop, man); if(subghz_protocol_keeloq_check_decrypt(instance, decrypt, btn, end_serial)) { *manufacture_name = string_get_cstr(manufacture_code->name); @@ -562,7 +563,7 @@ static uint8_t subghz_protocol_keeloq_check_remote_controller_selector( // Secure Learning man = subghz_protocol_keeloq_common_secure_learning( fix, seed, manufacture_code->key); - FURI_LOG_I(TAG, "mfkey: %08lX%08lX", manufacture_code->key >> 32, manufacture_code->key); + FURI_LOG_I(TAG, "mfkey: %08lX%08lX", hi, manufacture_code->key); decrypt = subghz_protocol_keeloq_common_decrypt(hop, man); if(subghz_protocol_keeloq_check_decrypt(instance, decrypt, btn, end_serial)) { *manufacture_name = string_get_cstr(manufacture_code->name); @@ -580,7 +581,7 @@ static uint8_t subghz_protocol_keeloq_check_remote_controller_selector( // Magic xor type1 learning man = subghz_protocol_keeloq_common_magic_xor_type1_learning( fix, manufacture_code->key); - FURI_LOG_I(TAG, "mfkey: %08lX%08lX", manufacture_code->key >> 32, manufacture_code->key); + FURI_LOG_I(TAG, "mfkey: %08lX%08lX", hi, manufacture_code->key); decrypt = subghz_protocol_keeloq_common_decrypt(hop, man); if(subghz_protocol_keeloq_check_decrypt(instance, decrypt, btn, end_serial)) { *manufacture_name = string_get_cstr(manufacture_code->name); diff --git a/lib/subghz/protocols/star_line.c b/lib/subghz/protocols/star_line.c index e3acb120a..51d82ae0f 100644 --- a/lib/subghz/protocols/star_line.c +++ b/lib/subghz/protocols/star_line.c @@ -457,11 +457,12 @@ static uint8_t subghz_protocol_star_line_check_remote_controller_selector( for M_EACH(manufacture_code, *subghz_keystore_get_data(keystore), SubGhzKeyArray_t) { + uint32_t hi = manufacture_code->key >> 32; switch(manufacture_code->type) { case KEELOQ_LEARNING_SIMPLE: //Simple Learning decrypt = subghz_protocol_keeloq_common_decrypt(hop, manufacture_code->key); - FURI_LOG_I(TAG, "mfkey: %08lX%08lX", manufacture_code->key >> 32, manufacture_code->key); + FURI_LOG_I(TAG, "mfkey: %08lX%08lX", hi, manufacture_code->key); if(subghz_protocol_star_line_check_decrypt(instance, decrypt, btn, end_serial)) { *manufacture_name = string_get_cstr(manufacture_code->name); return 1; @@ -472,7 +473,7 @@ static uint8_t subghz_protocol_star_line_check_remote_controller_selector( // https://phreakerclub.com/forum/showpost.php?p=43557&postcount=37 man_normal_learning = subghz_protocol_keeloq_common_normal_learning(fix, manufacture_code->key); - FURI_LOG_I(TAG, "mfkey: %08lX%08lX", manufacture_code->key >> 32, manufacture_code->key); + FURI_LOG_I(TAG, "mfkey: %08lX%08lX", hi, manufacture_code->key); decrypt = subghz_protocol_keeloq_common_decrypt(hop, man_normal_learning); if(subghz_protocol_star_line_check_decrypt(instance, decrypt, btn, end_serial)) { *manufacture_name = string_get_cstr(manufacture_code->name); @@ -482,7 +483,7 @@ static uint8_t subghz_protocol_star_line_check_remote_controller_selector( case KEELOQ_LEARNING_UNKNOWN: // Simple Learning decrypt = subghz_protocol_keeloq_common_decrypt(hop, manufacture_code->key); - FURI_LOG_I(TAG, "mfkey: %08lX%08lX", manufacture_code->key >> 32, manufacture_code->key); + FURI_LOG_I(TAG, "mfkey: %08lX%08lX", hi, manufacture_code->key); if(subghz_protocol_star_line_check_decrypt(instance, decrypt, btn, end_serial)) { *manufacture_name = string_get_cstr(manufacture_code->name); return 1; @@ -504,7 +505,7 @@ static uint8_t subghz_protocol_star_line_check_remote_controller_selector( // https://phreakerclub.com/forum/showpost.php?p=43557&postcount=37 man_normal_learning = subghz_protocol_keeloq_common_normal_learning(fix, manufacture_code->key); - FURI_LOG_I(TAG, "mfkey: %08lX%08lX", manufacture_code->key >> 32, manufacture_code->key); + FURI_LOG_I(TAG, "mfkey: %08lX%08lX", hi, manufacture_code->key); decrypt = subghz_protocol_keeloq_common_decrypt(hop, man_normal_learning); if(subghz_protocol_star_line_check_decrypt(instance, decrypt, btn, end_serial)) { *manufacture_name = string_get_cstr(manufacture_code->name);