mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-08-20 13:23:51 -07:00
Fix overflow in SPI memory when writing default key dictionnaries.
Boundaries were defined in the memory layout but weren't enforced by the client, causing an overflow when trying to load a dictionnary that was too big. It's too hard to enforce it on the ARM side as the command is a generic write. Now that limits are defined, also outputs them as part of the `hw status` command.
This commit is contained in:
parent
6651cf48cf
commit
1adec4dfb2
3 changed files with 30 additions and 15 deletions
|
@ -65,17 +65,23 @@
|
|||
|
||||
// Reserved space for T55XX PWD = 4 kb
|
||||
#ifndef DEFAULT_T55XX_KEYS_OFFSET
|
||||
# define DEFAULT_T55XX_KEYS_OFFSET (FLASH_MEM_MAX_4K_SECTOR - 0x3000)
|
||||
# define DEFAULT_T55XX_KEYS_LEN (0x1000)
|
||||
# define DEFAULT_T55XX_KEYS_OFFSET (T55XX_CONFIG_OFFSET - DEFAULT_T55XX_KEYS_LEN)
|
||||
# define DEFAULT_T55XX_KEYS_MAX ((DEFAULT_T55XX_KEYS_LEN - 2) / 4)
|
||||
#endif
|
||||
|
||||
// Reserved space for iClass keys = 4 kb
|
||||
#ifndef DEFAULT_ICLASS_KEYS_OFFSET
|
||||
# define DEFAULT_ICLASS_KEYS_OFFSET (FLASH_MEM_MAX_4K_SECTOR - 0x4000)
|
||||
# define DEFAULT_ICLASS_KEYS_LEN (0x1000)
|
||||
# define DEFAULT_ICLASS_KEYS_OFFSET (DEFAULT_T55XX_KEYS_OFFSET - DEFAULT_ICLASS_KEYS_LEN)
|
||||
# define DEFAULT_ICLASS_KEYS_MAX ((DEFAULT_ICLASS_KEYS_LEN - 2) / 8)
|
||||
#endif
|
||||
|
||||
// Reserved space for MIFARE Keys = 8 kb
|
||||
#ifndef DEFAULT_MF_KEYS_OFFSET
|
||||
# define DEFAULT_MF_KEYS_OFFSET (FLASH_MEM_MAX_4K_SECTOR - 0x6000)
|
||||
# define DEFAULT_MF_KEYS_LEN (0x2000)
|
||||
# define DEFAULT_MF_KEYS_OFFSET (DEFAULT_ICLASS_KEYS_OFFSET - DEFAULT_MF_KEYS_LEN)
|
||||
# define DEFAULT_MF_KEYS_MAX ((DEFAULT_MF_KEYS_LEN - 2) / 6)
|
||||
#endif
|
||||
|
||||
// RDV40, validation structure to help identifying that client/firmware is talking with RDV40
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue