Add lf em 4x70 autorecover

Also:
* common.h: Increase safety of some of the macros.
  Parenthesizing the macro parameters ... a best practice.
* firmware: partially-tracked source of "extra bits" messages.
  Add a TODO comment for further study.
* Improve reliability of `lf em 4x70 writekey`
  Authenticate w/new key after it is written.
  Particularly important for glass modules,
  or other tags with weaker coupling.
This commit is contained in:
Henry Gabryjelski 2024-03-11 17:12:45 -07:00
commit 160d61682b
4 changed files with 940 additions and 324 deletions

View file

@ -39,6 +39,7 @@ typedef struct {
// Used for writing address
uint8_t address;
// ISSUE: Presumes target is little-endian
uint16_t word;
// PIN to unlock
@ -53,6 +54,7 @@ typedef struct {
uint8_t crypt_key[12];
// used for bruteforce the partial key
// ISSUE: Presumes target is little-endian
uint16_t start_key;
} em4x70_data_t;