mirror of
https://github.com/DarkFlippers/unleashed-firmware.git
synced 2024-12-25 06:13:14 +03:00
never sleep
This commit is contained in:
parent
3c1cec9d64
commit
a26dcd7bf7
@ -483,7 +483,7 @@ static uint8_t subghz_protocol_keeloq_check_remote_controller_selector(
|
||||
case KEELOQ_LEARNING_SIMPLE:
|
||||
// Simple Learning
|
||||
decrypt = subghz_protocol_keeloq_common_decrypt(hop, manufacture_code->key);
|
||||
FURI_LOG_I(TAG, "mfkey: %016lX", manufacture_code->key);
|
||||
FURI_LOG_I(TAG, "mfkey: %016lX", (uint64_t)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 +493,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: %016lX", manufacture_code->key);
|
||||
FURI_LOG_I(TAG, "mfkey: %016lX", (uint64_t)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 +503,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: %016lX", manufacture_code->key);
|
||||
FURI_LOG_I(TAG, "mfkey: %016lX", (uint64_t)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 +513,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: %016lX", manufacture_code->key);
|
||||
FURI_LOG_I(TAG, "mfkey: %016lX", (uint64_t)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 +523,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: %016lX", manufacture_code->key);
|
||||
FURI_LOG_I(TAG, "mfkey: %016lX", (uint64_t)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 +544,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: %016lX", manufacture_code->key);
|
||||
FURI_LOG_I(TAG, "mfkey: %016lX", (uint64_t)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 +562,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: %016lX", manufacture_code->key);
|
||||
FURI_LOG_I(TAG, "mfkey: %016lX", (uint64_t)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 +580,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: %016lX", manufacture_code->key);
|
||||
FURI_LOG_I(TAG, "mfkey: %016lX", (uint64_t)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);
|
||||
|
@ -132,9 +132,9 @@ static bool
|
||||
FURI_LOG_I(TAG, "counter = %04lX", instance->generic.cnt);
|
||||
FURI_LOG_I(TAG, "button = %01lX", btn);
|
||||
uint64_t decrypt = ((uint64_t)instance->generic.serial << 16) | instance->generic.cnt;
|
||||
FURI_LOG_I(TAG, "decrypt = %011lX", decrypt);
|
||||
FURI_LOG_I(TAG, "decrypt = %011lX", (uint64_t)decrypt);
|
||||
uint64_t enc_part = subghz_protocol_nice_flor_s_encrypt(decrypt, file_name);
|
||||
FURI_LOG_I(TAG, "enc_part = %011lX", enc_part);
|
||||
FURI_LOG_I(TAG, "enc_part = %011lX", (uint64_t)enc_part);
|
||||
|
||||
for (int i = 0; i < 16; i++) {
|
||||
|
||||
@ -170,7 +170,7 @@ static bool
|
||||
//Button 4
|
||||
instance->generic.data = ((uint64_t)btn << 4) | (0xF ^ btn ^ loops[3][i]) << 44 | enc_part;
|
||||
}
|
||||
FURI_LOG_I(TAG, "key = %013lX", instance->generic.data);
|
||||
FURI_LOG_I(TAG, "key = %013lX", (uint64_t)instance->generic.data);
|
||||
|
||||
//Send header
|
||||
for(uint8_t i = 35; i > 0; i--) {
|
||||
@ -323,7 +323,7 @@ uint64_t subghz_protocol_nice_flor_s_encrypt(uint64_t data, const char* file_nam
|
||||
k = ~p[3];
|
||||
p[3] = ~p[1];
|
||||
p[1] = k;
|
||||
FURI_LOG_I(TAG, "encrypted_data = %011lX", data);
|
||||
FURI_LOG_I(TAG, "encrypted_data = %011lX", (uint64_t)data);
|
||||
return data;
|
||||
}
|
||||
|
||||
@ -362,7 +362,7 @@ static uint64_t
|
||||
p[1] = k;
|
||||
}
|
||||
}
|
||||
FURI_LOG_I(TAG, "decrypted_data = %011lX", data);
|
||||
FURI_LOG_I(TAG, "decrypted_data = %011lX", (uint64_t)data);
|
||||
return data;
|
||||
}
|
||||
|
||||
@ -507,7 +507,7 @@ static void subghz_protocol_nice_flor_s_remote_controller(
|
||||
instance->btn = 0;
|
||||
} else {
|
||||
uint64_t decrypt = subghz_protocol_nice_flor_s_decrypt(instance, file_name);
|
||||
FURI_LOG_I(TAG, "init_decrypted_data = %013lX", decrypt);
|
||||
FURI_LOG_I(TAG, "init_decrypted_data = %013lX", (uint64_t)decrypt);
|
||||
instance->cnt = decrypt & 0xFFFF;
|
||||
instance->serial = (decrypt >> 16) & 0xFFFFFFF;
|
||||
instance->btn = (decrypt >> 48) & 0xF;
|
||||
|
@ -461,7 +461,7 @@ static uint8_t subghz_protocol_star_line_check_remote_controller_selector(
|
||||
case KEELOQ_LEARNING_SIMPLE:
|
||||
//Simple Learning
|
||||
decrypt = subghz_protocol_keeloq_common_decrypt(hop, manufacture_code->key);
|
||||
FURI_LOG_I(TAG, "mfkey: %016lX", manufacture_code->key);
|
||||
FURI_LOG_I(TAG, "mfkey: %016lX", (uint64_t)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 +472,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: %016lX", manufacture_code->key);
|
||||
FURI_LOG_I(TAG, "mfkey: %016lX", (uint64_t)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 +482,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: %016lX", manufacture_code->key);
|
||||
FURI_LOG_I(TAG, "mfkey: %016lX", (uint64_t)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 +504,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: %016lX", manufacture_code->key);
|
||||
FURI_LOG_I(TAG, "mfkey: %016lX", (uint64_t)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);
|
||||
|
@ -139,7 +139,7 @@ static bool subghz_keystore_read_file(SubGhzKeystore* instance, Stream* stream,
|
||||
if(furi_hal_crypto_decrypt(
|
||||
(uint8_t*)encrypted_line, (uint8_t*)decrypted_line, len)) {
|
||||
subghz_keystore_process_line(instance, decrypted_line);
|
||||
FURI_LOG_I(TAG, "decrypted line: %016lX", decrypted_line);
|
||||
FURI_LOG_I(TAG, "decrypted line: %016lX", (uint64_t)decrypted_line);
|
||||
} else {
|
||||
FURI_LOG_E(TAG, "Decryption failed");
|
||||
result = false;
|
||||
@ -579,9 +579,9 @@ bool subghz_keystore_raw_get_data(const char* file_name, size_t offset, uint8_t*
|
||||
buffer[i / 2] = (hi_nibble << 4) | lo_nibble;
|
||||
}
|
||||
|
||||
FURI_LOG_I(TAG, "decrypted line: %016lX", decrypted_line);
|
||||
FURI_LOG_I(TAG, "decrypted line: %016lX", (uint64_t)decrypted_line);
|
||||
memset(decrypted_line, 0, SUBGHZ_KEYSTORE_FILE_DECRYPTED_LINE_SIZE);
|
||||
FURI_LOG_I(TAG, "decrypted line: %016lX", decrypted_line);
|
||||
FURI_LOG_I(TAG, "decrypted line: %016lX", (uint64_t)decrypted_line);
|
||||
|
||||
if(!furi_hal_crypto_decrypt(
|
||||
(uint8_t*)buffer, (uint8_t*)decrypted_line, bufer_size / 2)) {
|
||||
@ -590,7 +590,7 @@ bool subghz_keystore_raw_get_data(const char* file_name, size_t offset, uint8_t*
|
||||
break;
|
||||
}
|
||||
memcpy(data, (uint8_t*)decrypted_line + (offset - (offset / 16) * 16), len);
|
||||
FURI_LOG_I(TAG, "decrypted line: %016lX", decrypted_line);
|
||||
FURI_LOG_I(TAG, "decrypted line: %016lX", (uint64_t)decrypted_line);
|
||||
|
||||
} while(0);
|
||||
furi_hal_crypto_store_unload_key(SUBGHZ_KEYSTORE_FILE_ENCRYPTION_KEY_SLOT);
|
||||
|
Loading…
Reference in New Issue
Block a user