Parcourir la source

Merge mfkey32 from https://github.com/flipperdevices/flipperzero-good-faps

Willy-JL il y a 2 ans
Parent
commit
59e4bea4c1
3 fichiers modifiés avec 13 ajouts et 4 suppressions
  1. 4 0
      mfkey32/.catalog/changelog.md
  2. 1 1
      mfkey32/application.fam
  3. 8 3
      mfkey32/mfkey32.c

+ 4 - 0
mfkey32/.catalog/changelog.md

@@ -0,0 +1,4 @@
+## 1.1
+ - Rework application with new NFC API
+## 1.0
+ - Initial release

+ 1 - 1
mfkey32/application.fam

@@ -10,7 +10,7 @@ App(
     ],
     ],
     stack_size=1 * 1024,
     stack_size=1 * 1024,
     fap_description="Mf Classic key finder",
     fap_description="Mf Classic key finder",
-    fap_version="1.0",
+    fap_version="1.1",
     fap_icon="mfkey.png",
     fap_icon="mfkey.png",
     fap_category="NFC",
     fap_category="NFC",
     fap_author="@noproto",
     fap_author="@noproto",

+ 8 - 3
mfkey32/mfkey32.c

@@ -19,7 +19,7 @@
 #include <stdint.h>
 #include <stdint.h>
 #include <unistd.h>
 #include <unistd.h>
 #include <storage/storage.h>
 #include <storage/storage.h>
-#include <lib/nfc/helpers/mf_classic_dict.h>
+#include <toolbox/stream/buffered_file_stream.h>
 #include <lib/toolbox/args.h>
 #include <lib/toolbox/args.h>
 #include <lib/flipper_format/flipper_format.h>
 #include <lib/flipper_format/flipper_format.h>
 #include <dolphin/dolphin.h>
 #include <dolphin/dolphin.h>
@@ -123,10 +123,15 @@ typedef struct {
     size_t remaining_nonces;
     size_t remaining_nonces;
 } MfClassicNonceArray;
 } MfClassicNonceArray;
 
 
-struct MfClassicDict {
+typedef enum {
+    MfClassicDictTypeSystem,
+    MfClassicDictTypeUser,
+} MfClassicDictType;
+
+typedef struct {
     Stream* stream;
     Stream* stream;
     uint32_t total_keys;
     uint32_t total_keys;
-};
+} MfClassicDict;
 
 
 static const uint8_t table[256] = {
 static const uint8_t table[256] = {
     0, 1, 1, 2, 1, 2, 2, 3, 1, 2, 2, 3, 2, 3, 3, 4, 1, 2, 2, 3, 2, 3, 3, 4, 2, 3, 3, 4, 3,
     0, 1, 1, 2, 1, 2, 2, 3, 1, 2, 2, 3, 2, 3, 3, 4, 1, 2, 2, 3, 2, 3, 3, 4, 2, 3, 3, 4, 3,