@xMasterX --> Refactor key handling and add key loading function

Replaces obfuscated key macros and inline functions with external key variables and function declarations. Adds protopirate_keys_load to initialize keys using a SubGhzEnvironment. Updates includes to use subghz environment and keystore headers.
This commit is contained in:
RocketGod
2026-01-11 20:16:39 -08:00
parent a4937375ea
commit febddb088d
+10 -21
View File
@@ -2,28 +2,17 @@
#include <stdint.h>
// Mask - hint THEPIRAT
#define KEY_OBFUSCATION_MASK 0x5448455049524154ULL
#include <lib/subghz/environment.h>
#include <lib/subghz/subghz_keystore.h>
// Obfuscated keys
#define KIA_MF_KEY_OBF 0xFCBD9AACC4F81D8FULL
#define KIA_V6_KEYSTORE_A_OBF 0x37CE21F8C9F862A8ULL
#define KIA_V6_KEYSTORE_B_OBF 0x3FC629F0C1F06AA0ULL
extern uint64_t kia_mf_key;
extern uint64_t kia_v6_a_key;
extern uint64_t kia_v6_b_key;
static inline uint64_t get_kia_mf_key(void)
{
volatile uint64_t mask = KEY_OBFUSCATION_MASK;
return KIA_MF_KEY_OBF ^ mask;
}
uint64_t get_kia_mf_key();
static inline uint64_t get_kia_v6_keystore_a(void)
{
volatile uint64_t mask = KEY_OBFUSCATION_MASK;
return KIA_V6_KEYSTORE_A_OBF ^ mask;
}
uint64_t get_kia_v6_keystore_a();
static inline uint64_t get_kia_v6_keystore_b(void)
{
volatile uint64_t mask = KEY_OBFUSCATION_MASK;
return KIA_V6_KEYSTORE_B_OBF ^ mask;
}
uint64_t get_kia_v6_keystore_b();
void protopirate_keys_load(SubGhzEnvironment* environment);