Merge pull request #3026 from henrygab/safer_safelok

Safer safelok routines
This commit is contained in:
Iceman authored and GitHub committed 2025-12-18 15:10:59 +01:00
commit bcf1b57ddd
6 files changed
+1549 -324

No files matched your search

+4 -4
View File
@@ -2631,15 +2631,15 @@ int CmdHF14BNdefRead(const char *Cmd) {
}
// take offset from response
uint8_t offset = response[1];
// Parse CC data
uint8_t cc_data[resplen - 2];
memcpy(cc_data, response, sizeof(cc_data));
uint8_t file_id[2] = {cc_data[9], cc_data[10]};
uint16_t max_rapdu_size = (cc_data[3] << 8 | cc_data[4]) - 2;
max_rapdu_size = max_rapdu_size < sizeof(response) - 2 ? max_rapdu_size : sizeof(response) - 2;
// --------------- NDEF file reading ----------------
uint8_t aSELECT_FILE_NDEF[30];
@@ -2739,7 +2739,7 @@ int CmdHF14BNdefRead(const char *Cmd) {
PrintAndLogEx(HINT, "Hint: Try " _YELLOW_("`hf 14b ndefread -v`") " for more details"); // So far this prints absolutely nothing
}
// get total NDEF length before save. If fails, we save it all
size_t n = 0;
if (NDEFGetTotalLength(response + 2, resplen - 4, &n) != PM3_SUCCESS)
+1 -1
View File
@@ -5008,7 +5008,7 @@ void printKeyTableEx(size_t sectorscnt, sector_t *e_sector, uint8_t start_sector
_YELLOW_("H") ":Hardnested / "
_YELLOW_("C") ":statiCnested / "
_YELLOW_("A") ":keyA "
" )"
" )"
);
if (sectorscnt == 18) {
PrintAndLogEx(INFO, "( " _MAGENTA_("*") " ) These sectors used for signature. Lays outside of user memory");
+1526 -283
View File
File diff suppressed because it is too large. Load diff
+2 -1
View File
@@ -359,7 +359,7 @@ const static vocabulary_t vocabulary[] = {
{ 0, "hf mf fchk" },
{ 1, "hf mf decrypt" },
{ 0, "hf mf supercard" },
{ 1, "hf mf bambukeys" },
{ 1, "hf mf keygen" },
{ 0, "hf mf auth4" },
{ 1, "hf mf acl" },
{ 0, "hf mf dump" },
@@ -511,6 +511,7 @@ const static vocabulary_t vocabulary[] = {
{ 1, "hf saflok decrypt" },
{ 0, "hf saflok interrogate" },
{ 0, "hf saflok cksum" },
{ 1, "hf saflok selftest" },
{ 1, "hf seos help" },
{ 1, "hf seos list" },
{ 0, "hf seos sam" },