mirror of
https://github.com/DarkFlippers/unleashed-firmware.git
synced 2024-11-28 11:26:32 +03:00
Merge pull request #69 from h4sh5/random_uid_reader_detect
random uid for detect reader each time NFC app exists and comes back
This commit is contained in:
commit
c28e4ea733
@ -3,6 +3,7 @@
|
|||||||
#include <lib/nfc/protocols/nfc_util.h>
|
#include <lib/nfc/protocols/nfc_util.h>
|
||||||
#include <lib/nfc/protocols/mifare_classic.h>
|
#include <lib/nfc/protocols/mifare_classic.h>
|
||||||
#include <m-array.h>
|
#include <m-array.h>
|
||||||
|
#include <furi_hal_random.h>
|
||||||
|
|
||||||
#include "mfkey32.h"
|
#include "mfkey32.h"
|
||||||
#include "nfc_debug_pcap.h"
|
#include "nfc_debug_pcap.h"
|
||||||
@ -38,7 +39,7 @@ struct ReaderAnalyzer {
|
|||||||
NfcDebugPcap* pcap;
|
NfcDebugPcap* pcap;
|
||||||
};
|
};
|
||||||
|
|
||||||
const FuriHalNfcDevData reader_analyzer_nfc_data[] = {
|
static FuriHalNfcDevData reader_analyzer_nfc_data[] = { //XXX
|
||||||
[ReaderAnalyzerNfcDataMfClassic] =
|
[ReaderAnalyzerNfcDataMfClassic] =
|
||||||
{.sak = 0x08,
|
{.sak = 0x08,
|
||||||
.atqa = {0x44, 0x00},
|
.atqa = {0x44, 0x00},
|
||||||
@ -99,7 +100,8 @@ int32_t reader_analyzer_thread(void* context) {
|
|||||||
|
|
||||||
ReaderAnalyzer* reader_analyzer_alloc() {
|
ReaderAnalyzer* reader_analyzer_alloc() {
|
||||||
ReaderAnalyzer* instance = malloc(sizeof(ReaderAnalyzer));
|
ReaderAnalyzer* instance = malloc(sizeof(ReaderAnalyzer));
|
||||||
|
reader_analyzer_nfc_data[ReaderAnalyzerNfcDataMfClassic].cuid = rand(); //XXX
|
||||||
|
furi_hal_random_fill_buf((uint8_t*) &reader_analyzer_nfc_data[ReaderAnalyzerNfcDataMfClassic].uid, 7);
|
||||||
instance->nfc_data = reader_analyzer_nfc_data[ReaderAnalyzerNfcDataMfClassic];
|
instance->nfc_data = reader_analyzer_nfc_data[ReaderAnalyzerNfcDataMfClassic];
|
||||||
instance->alive = false;
|
instance->alive = false;
|
||||||
instance->stream =
|
instance->stream =
|
||||||
|
Loading…
Reference in New Issue
Block a user