Переглянути джерело

Merge seader from https://github.com/bettse/seader

Willy-JL 1 рік тому
батько
коміт
1bec35bf6c
5 змінених файлів з 34 додано та 3 видалено
  1. 1 1
      seader/application.fam
  2. 17 0
      seader/readme.md
  3. 14 2
      seader/sam_api.c
  4. 1 0
      seader/seader_i.h
  5. 1 0
      seader/seader_worker_i.h

+ 1 - 1
seader/application.fam

@@ -20,7 +20,7 @@ App(
     ],
     fap_icon="icons/logo.png",
     fap_category="NFC",
-    fap_version="2.10",
+    fap_version="3.0",
     fap_author="bettse",
     #    fap_extbuild=(
     #        ExtFile(

+ 17 - 0
seader/readme.md

@@ -7,6 +7,21 @@ A [Flipper Zero](https://flipperzero.one/) application (aka "fap") to interface
 
 File issues in [GitHub](https://github.com/bettse/seader/issues).
 
+
+## Formats
+
+Seader can save from the Source(top) formats to the Destination(left) formats.
+
+| | Seos | Desfire Ev2 | Desfire Ev1 | MFC SE | MFC (legacy) | iClass SE | iClass SR | iClass (legacy) |
+| ----------- | ---- | ----------- | ----------- | ------ | ------------ | --------- | --------- | --------------- |
+| Seader (no SIO) | x | x | x | x | x | x | x | x |
+| LFRFID | x | x | x | x | x | x | x | x |
+| iClass (legacy) | X | x | x | X | X | x | x | X |
+| MFC (legacy) | X | x | x | X | X | x | x | X |
+| Seader (with SIO) | | x | x | | | x | x | |
+| iClass SR (emulation only) | | x | x | | | x | x | |
+
+
 ## Hardware
 
 ### Option 1: NARD flipper add-on
@@ -58,3 +73,5 @@ Optionally 3d print a [case designed by sean](https://www.printables.com/model/5
 - `arm-none-eabi-nm ~/.ufbt/build/seader.fap -CS --size-sort`
 - `arm-none-eabi-readelf ~/.ufbt/build/seader.fap -t`
 - `ufbt cli` -> `free_blocks`
+
+

+ 14 - 2
seader/sam_api.c

@@ -1,20 +1,23 @@
-
 #include "sam_api.h"
 #include <toolbox/path.h>
 #include <toolbox/version.h>
 #include <bit_lib/bit_lib.h>
 
+//#define ASN1_DEBUG                      true
+
 #define TAG "SAMAPI"
 
 #define ASN1_PREFIX                     6
-#define ASN1_DEBUG                      true
 #define SEADER_ICLASS_SR_SIO_BASE_BLOCK 10
 #define SEADER_SERIAL_FILE_NAME         "sam_serial"
 
 const uint8_t picopass_iclass_key[] = {0xaf, 0xa7, 0x85, 0xa7, 0xda, 0xb3, 0x33, 0x78};
 
 static char display[SEADER_UART_RX_BUF_SIZE * 2 + 1] = {0};
+
+#ifdef ASN1_DEBUG
 char asn1_log[SEADER_UART_RX_BUF_SIZE] = {0};
+#endif
 
 uint8_t read4Block6[] = {RFAL_PICOPASS_CMD_READ4, 0x06, 0x45, 0x56};
 uint8_t read4Block9[] = {RFAL_PICOPASS_CMD_READ4, 0x09, 0xB2, 0xAE};
@@ -195,6 +198,7 @@ bool seader_send_apdu(
     return true;
 }
 
+#ifdef ASN1_DEBUG
 static int seader_print_struct_callback(const void* buffer, size_t size, void* app_key) {
     if(app_key) {
         char* str = (char*)app_key;
@@ -206,6 +210,14 @@ static int seader_print_struct_callback(const void* buffer, size_t size, void* a
     }
     return 0;
 }
+#else
+static int seader_print_struct_callback(const void* buffer, size_t size, void* app_key) {
+    UNUSED(buffer);
+    UNUSED(size);
+    UNUSED(app_key);
+    return 0;
+}
+#endif
 
 void seader_send_payload(
     Seader* seader,

+ 1 - 0
seader/seader_i.h

@@ -1,4 +1,5 @@
 #pragma once
+#define ASN_EMIT_DEBUG 0
 
 #include <stdlib.h> // malloc
 #include <stdint.h> // uint32_t

+ 1 - 0
seader/seader_worker_i.h

@@ -1,4 +1,5 @@
 #pragma once
+#define ASN_EMIT_DEBUG 0
 
 #include "seader_i.h"
 #include "seader_worker.h"