mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-08-21 13:53:55 -07:00
Merge pull request #1655 from wh201906/standalone_14b
Add flashmem support for HF_14BSNIFF standalone mode
This commit is contained in:
commit
c52e6bbc53
2 changed files with 53 additions and 1 deletions
|
@ -65,7 +65,8 @@ define KNOWN_STANDALONE_DEFINITIONS
|
||||||
| HF_14ASNIFF | 14a sniff to flashmem |
|
| HF_14ASNIFF | 14a sniff to flashmem |
|
||||||
| (RDV4 only) | |
|
| (RDV4 only) | |
|
||||||
+----------------------------------------------------------+
|
+----------------------------------------------------------+
|
||||||
| HF_14BSNIFF | 14b sniff |
|
| HF_14BSNIFF | 14b sniff to flashmem (rdv4) or ram |
|
||||||
|
| | |
|
||||||
+----------------------------------------------------------+
|
+----------------------------------------------------------+
|
||||||
| HF_15SNIFF | 15693 sniff to flashmem (rdv4) or ram |
|
| HF_15SNIFF | 15693 sniff to flashmem (rdv4) or ram |
|
||||||
| | |
|
| | |
|
||||||
|
|
|
@ -12,6 +12,7 @@
|
||||||
* - LED1: sniffing
|
* - LED1: sniffing
|
||||||
* - LED2: sniffed tag command, turns off when finished sniffing reader command
|
* - LED2: sniffed tag command, turns off when finished sniffing reader command
|
||||||
* - LED3: sniffed reader command, turns off when finished sniffing tag command
|
* - LED3: sniffed reader command, turns off when finished sniffing tag command
|
||||||
|
* - LED4: unmounting/sync'ing flash (normally < 100ms)
|
||||||
*
|
*
|
||||||
* This module emits debug strings during normal operation -- so try it out in
|
* This module emits debug strings during normal operation -- so try it out in
|
||||||
* the lab connected to PM3 client before taking it into the field.
|
* the lab connected to PM3 client before taking it into the field.
|
||||||
|
@ -27,25 +28,75 @@
|
||||||
#include "proxmark3_arm.h"
|
#include "proxmark3_arm.h"
|
||||||
#include "iso14443b.h"
|
#include "iso14443b.h"
|
||||||
#include "util.h"
|
#include "util.h"
|
||||||
|
#include "spiffs.h"
|
||||||
#include "appmain.h"
|
#include "appmain.h"
|
||||||
#include "dbprint.h"
|
#include "dbprint.h"
|
||||||
#include "ticks.h"
|
#include "ticks.h"
|
||||||
#include "BigBuf.h"
|
#include "BigBuf.h"
|
||||||
|
|
||||||
|
#define HF_14BSNIFF_LOGFILE "hf_14bsniff.trace"
|
||||||
|
|
||||||
|
static void DownloadTraceInstructions(void) {
|
||||||
|
Dbprintf("");
|
||||||
|
Dbprintf("To get the trace from flash and display it:");
|
||||||
|
Dbprintf("1. mem spiffs dump -s "HF_14BSNIFF_LOGFILE" -d hf_14bsniff.trace");
|
||||||
|
Dbprintf("2. trace load -f hf_14bsniff.trace");
|
||||||
|
Dbprintf("3. trace list -t 14b -1");
|
||||||
|
}
|
||||||
|
|
||||||
void ModInfo(void) {
|
void ModInfo(void) {
|
||||||
DbpString(" HF 14B SNIFF, a ISO14443b sniffer");
|
DbpString(" HF 14B SNIFF, a ISO14443b sniffer");
|
||||||
|
DownloadTraceInstructions();
|
||||||
}
|
}
|
||||||
|
|
||||||
void RunMod(void) {
|
void RunMod(void) {
|
||||||
StandAloneMode();
|
StandAloneMode();
|
||||||
|
|
||||||
Dbprintf(_YELLOW_("HF 14B SNIFF started"));
|
Dbprintf(_YELLOW_("HF 14B SNIFF started"));
|
||||||
|
#ifdef WITH_FLASH
|
||||||
|
rdv40_spiffs_lazy_mount();
|
||||||
|
#endif
|
||||||
|
|
||||||
SniffIso14443b();
|
SniffIso14443b();
|
||||||
|
|
||||||
Dbprintf("Stopped sniffing");
|
Dbprintf("Stopped sniffing");
|
||||||
SpinDelay(200);
|
SpinDelay(200);
|
||||||
|
|
||||||
|
uint32_t trace_len = BigBuf_get_traceLen();
|
||||||
|
#ifndef WITH_FLASH
|
||||||
|
// Keep stuff in BigBuf for USB/BT dumping
|
||||||
|
if (trace_len > 0)
|
||||||
|
Dbprintf("[!] Trace length (bytes) = %u", trace_len);
|
||||||
|
#else
|
||||||
|
// Write stuff to spiffs logfile
|
||||||
|
if (trace_len > 0) {
|
||||||
|
Dbprintf("[!] Trace length (bytes) = %u", trace_len);
|
||||||
|
|
||||||
|
uint8_t *trace_buffer = BigBuf_get_addr();
|
||||||
|
if (!exists_in_spiffs(HF_14BSNIFF_LOGFILE)) {
|
||||||
|
rdv40_spiffs_write(
|
||||||
|
HF_14BSNIFF_LOGFILE, trace_buffer, trace_len, RDV40_SPIFFS_SAFETY_SAFE);
|
||||||
|
Dbprintf("[!] Wrote trace to "HF_14BSNIFF_LOGFILE);
|
||||||
|
} else {
|
||||||
|
rdv40_spiffs_append(
|
||||||
|
HF_14BSNIFF_LOGFILE, trace_buffer, trace_len, RDV40_SPIFFS_SAFETY_SAFE);
|
||||||
|
Dbprintf("[!] Appended trace to "HF_14BSNIFF_LOGFILE);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
Dbprintf("[!] Trace buffer is empty, nothing to write!");
|
||||||
|
}
|
||||||
|
|
||||||
|
LED_D_ON();
|
||||||
|
rdv40_spiffs_lazy_unmount();
|
||||||
|
LED_D_OFF();
|
||||||
|
|
||||||
|
SpinErr(LED_A, 200, 5);
|
||||||
|
SpinDelay(100);
|
||||||
|
#endif
|
||||||
|
|
||||||
Dbprintf("-=[ exit ]=-");
|
Dbprintf("-=[ exit ]=-");
|
||||||
LEDsoff();
|
LEDsoff();
|
||||||
|
#ifdef WITH_FLASH
|
||||||
|
DownloadTraceInstructions();
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue