Merge branch 'ofw-dev' into dev

This commit is contained in:
MX
2023-07-10 16:55:28 +03:00
44 changed files with 275 additions and 109 deletions
+5
View File
@@ -6,6 +6,11 @@ env.Append(
],
SDK_HEADERS=[
File("nfc_device.h"),
File("nfc_worker.h"),
File("nfc_types.h"),
File("helpers/mfkey32.h"),
File("parsers/nfc_supported_card.h"),
File("helpers/nfc_generators.h"),
File("protocols/nfc_util.h"),
],
)
+8
View File
@@ -6,6 +6,10 @@
#include <lib/toolbox/stream/file_stream.h>
#include <lib/toolbox/stream/buffered_file_stream.h>
#ifdef __cplusplus
extern "C" {
#endif
typedef enum {
MfClassicDictTypeUser,
MfClassicDictTypeSystem,
@@ -97,3 +101,7 @@ bool mf_classic_dict_find_index_str(MfClassicDict* dict, FuriString* key, uint32
* @return true on success
*/
bool mf_classic_dict_delete_index(MfClassicDict* dict, uint32_t target);
#ifdef __cplusplus
}
#endif
+8
View File
@@ -2,6 +2,10 @@
#include <lib/nfc/protocols/mifare_classic.h>
#ifdef __cplusplus
extern "C" {
#endif
typedef struct Mfkey32 Mfkey32;
typedef enum {
@@ -24,3 +28,7 @@ void mfkey32_process_data(
void mfkey32_set_callback(Mfkey32* instance, Mfkey32ParseDataCallback callback, void* context);
uint16_t mfkey32_get_auth_sectors(FuriString* string);
#ifdef __cplusplus
}
#endif
+8
View File
@@ -2,6 +2,10 @@
#include "nfc_device.h"
#ifdef __cplusplus
extern "C" {
#endif
const char* nfc_get_dev_type(FuriHalNfcType type);
const char* nfc_guess_protocol(NfcProtocol protocol);
@@ -9,3 +13,7 @@ const char* nfc_guess_protocol(NfcProtocol protocol);
const char* nfc_mf_ul_type(MfUltralightType type, bool full_name);
const char* nfc_mf_classic_type(MfClassicType type);
#ifdef __cplusplus
}
#endif
+9 -1
View File
@@ -2,6 +2,10 @@
#include "nfc_device.h"
#ifdef __cplusplus
extern "C" {
#endif
typedef struct NfcWorker NfcWorker;
typedef enum {
@@ -98,4 +102,8 @@ void nfc_worker_start(
void nfc_worker_stop(NfcWorker* nfc_worker);
void nfc_worker_nfcv_unlock(NfcWorker* nfc_worker);
void nfc_worker_nfcv_emulate(NfcWorker* nfc_worker);
void nfc_worker_nfcv_sniff(NfcWorker* nfc_worker);
void nfc_worker_nfcv_sniff(NfcWorker* nfc_worker);
#ifdef __cplusplus
}
#endif
+8
View File
@@ -4,6 +4,10 @@
#include "../nfc_worker.h"
#include "../nfc_device.h"
#ifdef __cplusplus
extern "C" {
#endif
typedef enum {
NfcSupportedCardTypePlantain,
NfcSupportedCardTypeTroika,
@@ -37,3 +41,7 @@ bool nfc_supported_card_verify_and_parse(NfcDeviceData* dev_data);
// support the card. This is needed for DESFire card parsers which can't
// provide keys, and only use NfcSupportedCard->parse.
bool stub_parser_verify_read(NfcWorker* nfc_worker, FuriHalNfcTxRxContext* tx_rx);
#ifdef __cplusplus
}
#endif
+8
View File
@@ -3,6 +3,10 @@
#include <stdint.h>
#include <stdbool.h>
#ifdef __cplusplus
extern "C" {
#endif
typedef struct {
uint32_t odd;
uint32_t even;
@@ -35,3 +39,7 @@ void crypto1_encrypt(
uint16_t plain_data_bits,
uint8_t* encrypted_data,
uint8_t* encrypted_parity);
#ifdef __cplusplus
}
#endif
+8
View File
@@ -4,6 +4,10 @@
#include "crypto1.h"
#ifdef __cplusplus
extern "C" {
#endif
#define MF_CLASSIC_BLOCK_SIZE (16)
#define MF_CLASSIC_TOTAL_BLOCKS_MAX (256)
#define MF_MINI_TOTAL_SECTORS_NUM (5)
@@ -241,3 +245,7 @@ bool mf_classic_write_sector(
MfClassicData* dest_data,
MfClassicData* src_data,
uint8_t sec_num);
#ifdef __cplusplus
}
#endif
+8
View File
@@ -5,6 +5,10 @@
#include <furi_hal_nfc.h>
#ifdef __cplusplus
extern "C" {
#endif
#define MF_DF_GET_VERSION (0x60)
#define MF_DF_GET_FREE_MEMORY (0x6E)
#define MF_DF_GET_KEY_SETTINGS (0x45)
@@ -169,3 +173,7 @@ uint16_t mf_df_prepare_read_records(uint8_t* dest, uint8_t file_id, uint32_t off
bool mf_df_parse_read_data_response(uint8_t* buf, uint16_t len, MifareDesfireFile* out);
bool mf_df_read_card(FuriHalNfcTxRxContext* tx_rx, MifareDesfireData* data);
#ifdef __cplusplus
}
#endif
+8
View File
@@ -2,6 +2,10 @@
#include <furi_hal_nfc.h>
#ifdef __cplusplus
extern "C" {
#endif
// Largest tag is NTAG I2C Plus 2K, both data sectors plus SRAM
#define MF_UL_MAX_DUMP_SIZE ((238 + 256 + 16) * 4)
@@ -259,3 +263,7 @@ uint32_t mf_ul_pwdgen_amiibo(FuriHalNfcDevData* data);
uint32_t mf_ul_pwdgen_xiaomi(FuriHalNfcDevData* data);
bool mf_ul_is_full_capture(MfUltralightData* data);
#ifdef __cplusplus
}
#endif