Used HAL layer

in appmain.c and cmd added.
in cmd.c and add some code for test CEP
in em4x50.c(Do not timeout--)
in em4x70.c
in emvsim.c
in epa.c
in felica.c
in felicasim.c
in felicasim.c
in hfops.c
in hfsnoop.c
in hitag2.c
in hitag_common.c(Cross-platform implementation is incomplete.)
in hitagS.c
in hitagu.c
in i2c.c(Incomplete, continue to abstract.)
in i2c_direct.c
in iclass.c
in iso14443a.c(Sniff no finish yet)
in iso14443b.c and fixed bug for st25
in iso15693.c
in legicrf.c
in legicrfsim.c
in lfadc.c(lf_count_edge_periods_ex() improved)
in lfops.c(TI tag no finish yet)
in lfsampling.c
in lfzx.c
in mifarecmd.c
in mifaredesfire.c
in mifaresim.c
in mifaresniff_disabled.c
in mifareutil.c
in pcf7931.c
in sam_xxx
in secc & seos
in start.c
in thinfilm.c
in utils
This commit is contained in:
dxl
2026-08-19 15:32:39 +02:00
committed by Philippe Teuwen
parent e4fa411ae9
commit e3511c5350
88 changed files with 1770 additions and 1454 deletions
+3 -2
View File
@@ -19,8 +19,9 @@
#include "standalone.h" // standalone definitions
#include "proxmark3_arm.h"
#include "appmain.h"
#include "fpgaloader.h"
#include "ticks.h"
#include "fpga_apis.h"
#include "fpga_loader.h"
#include "ticks_apis.h"
#include "util.h"
#include "dbprint.h"
+1 -1
View File
@@ -73,7 +73,7 @@
#include "spiffs.h"
#include "appmain.h"
#include "dbprint.h"
#include "ticks.h"
#include "ticks_apis.h"
#include "BigBuf.h"
#define HF_14ASNIFF_LOGFILE "hf_14asniff.trace"
+1 -1
View File
@@ -46,7 +46,7 @@
#include "spiffs.h"
#include "appmain.h"
#include "dbprint.h"
#include "ticks.h"
#include "ticks_apis.h"
#include "BigBuf.h"
#define HF_14BSNIFF_LOGFILE "hf_14bsniff.trace"
+3 -2
View File
@@ -21,7 +21,8 @@
#include "standalone.h" // standalone definitions
#include "proxmark3_arm.h"
#include "fpgaloader.h"
#include "fpga_loader.h"
#include "fpga_apis.h"
#include "iso15693.h"
#include "iso15.h"
#include "protocols.h"
@@ -30,7 +31,7 @@
#include "spiffs.h"
#include "appmain.h"
#include "dbprint.h"
#include "ticks.h"
#include "ticks_apis.h"
#include "BigBuf.h"
#include "crc16.h"
+3 -2
View File
@@ -67,14 +67,15 @@
#include "standalone.h" // standalone definitions
#include "proxmark3_arm.h"
#include "fpgaloader.h"
#include "fpga_apis.h"
#include "fpga_loader.h"
#include "iso15693.h"
#include "iso15.h"
#include "util.h"
#include "spiffs.h"
#include "appmain.h"
#include "dbprint.h"
#include "ticks.h"
#include "ticks_apis.h"
#include "BigBuf.h"
+3 -2
View File
@@ -33,11 +33,12 @@
#include "standalone.h" // standalone definitions
#include "proxmark3_arm.h"
#include "appmain.h"
#include "fpgaloader.h"
#include "fpga_apis.h"
#include "fpga_loader.h"
#include "util.h"
#include "dbprint.h"
#include "ticks.h" // SpinDelay
#include "ticks_apis.h" // SpinDelay
#include "protocols.h" // MIFARE_ULEV1_VERSION, MIFARE_ULEV1_READSIG, MIFARE_ULEV1_READ_CNT, MIFARE_ULEV1_CHECKTEAR
#include <string.h> // memcmp
#include "mifareutil.h"
+9 -16
View File
@@ -37,9 +37,10 @@ from the client to view the stored quadlets.
#include "util.h"
#include "spiffs.h"
#include "appmain.h"
#include "fpgaloader.h"
#include "fpga_apis.h"
#include "fpga_loader.h"
#include "dbprint.h"
#include "ticks.h"
#include "ticks_apis.h"
#include "BigBuf.h"
#include "string.h"
@@ -89,9 +90,9 @@ static void RAMFUNC SniffAndStore(uint8_t param) {
Uart14aInit(receivedCmd, MAX_FRAME_SIZE, receivedCmdPar);
// Setup and start DMA.
if (FpgaSetupSscDma((uint8_t *)dmaBuf, DMA_BUFFER_SIZE) == false) {
if (FpgaSetupSscRxDmaRepeat((uint8_t *)dmaBuf, DMA_BUFFER_SIZE) == false) {
if (g_dbglevel > DBG_ERROR) {
Dbprintf("FpgaSetupSscDma failed. Exiting");
Dbprintf("FpgaSetupSscRxDmaRepeat failed. Exiting");
}
return;
}
@@ -118,7 +119,7 @@ static void RAMFUNC SniffAndStore(uint8_t param) {
LED_A_ON();
int register readBufDataP = data - dmaBuf;
int register dmaBufDataP = DMA_BUFFER_SIZE - AT91C_BASE_PDC_SSC->PDC_RCR;
int register dmaBufDataP = DMA_BUFFER_SIZE - FPGA_SSC_DMA_RX_Remaining_Count();
if (readBufDataP <= dmaBufDataP)
dataLen = dmaBufDataP - readBufDataP;
else
@@ -132,16 +133,8 @@ static void RAMFUNC SniffAndStore(uint8_t param) {
if (dataLen < 1)
continue;
// primary buffer was stopped( <-- we lost data!
if (AT91C_BASE_PDC_SSC->PDC_RCR == 0) {
AT91C_BASE_PDC_SSC->PDC_RPR = (uint32_t)dmaBuf;
AT91C_BASE_PDC_SSC->PDC_RCR = DMA_BUFFER_SIZE;
// Dbprintf("[-] RxEmpty ERROR | data length %d", dataLen); // temporary
}
// secondary buffer sets as primary, secondary buffer was stopped
if (AT91C_BASE_PDC_SSC->PDC_RNCR == 0) {
AT91C_BASE_PDC_SSC->PDC_RNPR = (uint32_t)dmaBuf;
AT91C_BASE_PDC_SSC->PDC_RNCR = DMA_BUFFER_SIZE;
if (FPGA_SSC_DMA_RX_Done()) {
FPGA_SSC_DMA_RX_Refresh_Repeat(dmaBuf, DMA_BUFFER_SIZE);
}
LED_A_OFF();
@@ -216,7 +209,7 @@ static void RAMFUNC SniffAndStore(uint8_t param) {
}
} // end main loop
FpgaDisableSscDma();
FPGA_SSC_DMA_RX_Disable();
set_tracing(false);
Dbprintf("Stopped sniffing");
+7 -6
View File
@@ -19,16 +19,17 @@
#include "appmain.h"
#include "BigBuf.h"
#include "dbprint.h"
#include "fpgaloader.h"
#include "fpga_apis.h"
#include "fpga_loader.h"
#include "iso14443a.h"
#include "protocols.h"
#include "proxmark3_arm.h"
#include "standalone.h"
#include "ticks.h"
#include "ticks_apis.h"
#include "util.h"
#include "usart.h"
#include "cmd.h"
#include "usb_cdc.h"
#include "usb_cdc_apis.h"
#ifdef CARDHOPPER_USB
#define cardhopper_write usb_write
@@ -535,7 +536,7 @@ static bool GetIso14443aCommandFromReaderInterruptible(uint8_t *received, uint16
Uart14aInit(received, received_max_len, par);
uint8_t b = (uint8_t)AT91C_BASE_SSC->SSC_RHR;
uint8_t b = (uint8_t)FPGA_SSC_RX_Value();
(void)b;
uint8_t flip = 0;
@@ -555,8 +556,8 @@ static bool GetIso14443aCommandFromReaderInterruptible(uint8_t *received, uint16
checker = 4000;
}
if (AT91C_BASE_SSC->SSC_SR & (AT91C_SSC_RXRDY)) {
b = (uint8_t)AT91C_BASE_SSC->SSC_RHR;
if (FPGA_SSC_RX_Ready()) {
b = (uint8_t)FPGA_SSC_RX_Value();
if (MillerDecoding(b, 0)) {
*len = GetUart14a()->len;
return true;
+3 -2
View File
@@ -22,9 +22,10 @@
#include "hf_colin.h"
#include "proxmark3_arm.h"
#include "appmain.h"
#include "fpgaloader.h"
#include "fpga_apis.h"
#include "fpga_loader.h"
#include "dbprint.h"
#include "ticks.h"
#include "ticks_apis.h"
#include "util.h"
#include "commonutil.h"
#include "BigBuf.h"
+3 -2
View File
@@ -21,10 +21,11 @@
#include "standalone.h"
#include "proxmark3_arm.h"
#include "appmain.h"
#include "fpgaloader.h"
#include "fpga_apis.h"
#include "fpga_loader.h"
#include "util.h"
#include "dbprint.h"
#include "ticks.h"
#include "ticks_apis.h"
#include "string.h"
#include "BigBuf.h"
#include "iso14443a.h"
+8 -17
View File
@@ -67,12 +67,13 @@
#include "standalone.h" // standalone definitions
#include "proxmark3_arm.h"
#include "fpgaloader.h"
#include "fpga_apis.h"
#include "fpga_loader.h"
#include "iso14443a.h"
#include "util.h"
#include "appmain.h"
#include "dbprint.h"
#include "ticks.h"
#include "ticks_apis.h"
#include "protocols.h"
#include "mifareutil.h"
#include "string.h"
@@ -208,8 +209,8 @@ static bool RAMFUNC sniff_wait_for_rnda_reply(tag_t type) {
uint8_t *data = dma->buf;
// Setup and start DMA.
if (FpgaSetupSscDma((uint8_t *) dma->buf, DMA_BUFFER_SIZE) == false) {
if (g_dbglevel > DBG_ERROR) Dbprintf("FpgaSetupSscDma failed. Exiting");
if (FpgaSetupSscRxDmaRepeat((uint8_t *) dma->buf, DMA_BUFFER_SIZE) == false) {
if (g_dbglevel > DBG_ERROR) Dbprintf("FpgaSetupSscRxDmaRepeat failed. Exiting");
goto out;
}
@@ -222,7 +223,7 @@ static bool RAMFUNC sniff_wait_for_rnda_reply(tag_t type) {
uint32_t ledb_counter = 0;
while (BUTTON_PRESS() == false) {
register int readBufDataP = data - dma->buf;
register int dmaBufDataP = DMA_BUFFER_SIZE - AT91C_BASE_PDC_SSC->PDC_RCR;
register int dmaBufDataP = DMA_BUFFER_SIZE - FPGA_SSC_DMA_RX_Remaining_Count();
if (readBufDataP <= dmaBufDataP) {
dataLen = dmaBufDataP - readBufDataP;
} else {
@@ -246,17 +247,7 @@ static bool RAMFUNC sniff_wait_for_rnda_reply(tag_t type) {
ledb_counter = 0;
}
// primary buffer was stopped( <-- we lost data!
if (AT91C_BASE_PDC_SSC->PDC_RCR == 0) {
AT91C_BASE_PDC_SSC->PDC_RPR = (uint32_t) dma->buf;
AT91C_BASE_PDC_SSC->PDC_RCR = DMA_BUFFER_SIZE;
// Dbprintf("[-] RxEmpty ERROR | data length %d", dataLen); // temporary
}
// secondary buffer sets as primary, secondary buffer was stopped
if (AT91C_BASE_PDC_SSC->PDC_RNCR == 0) {
AT91C_BASE_PDC_SSC->PDC_RNPR = (uint32_t) dma->buf;
AT91C_BASE_PDC_SSC->PDC_RNCR = DMA_BUFFER_SIZE;
}
FPGA_SSC_DMA_RX_Refresh_Repeat(dma->buf, DMA_BUFFER_SIZE);
// Need two samples to feed Miller and Manchester-Decoder
if (rx_samples & 0x01) {
@@ -328,7 +319,7 @@ out:
FpgaWriteConfWord(FPGA_MAJOR_MODE_OFF);
}
FpgaDisableTracing();
FpgaDisableSscDma();
FPGA_SSC_DMA_RX_Disable();
return found_rnda_reply;
}
+8 -17
View File
@@ -67,12 +67,13 @@
#include "standalone.h" // standalone definitions
#include "proxmark3_arm.h"
#include "fpgaloader.h"
#include "fpga_apis.h"
#include "fpga_loader.h"
#include "iso14443a.h"
#include "util.h"
#include "appmain.h"
#include "dbprint.h"
#include "ticks.h"
#include "ticks_apis.h"
#include "protocols.h"
#include "mifareutil.h"
#include "string.h"
@@ -184,8 +185,8 @@ static bool RAMFUNC sniff_wait_for_commit(tag_t type) {
uint8_t *data = dma->buf;
// Setup and start DMA.
if (FpgaSetupSscDma((uint8_t *) dma->buf, DMA_BUFFER_SIZE) == false) {
if (g_dbglevel > DBG_ERROR) Dbprintf("FpgaSetupSscDma failed. Exiting");
if (FpgaSetupSscRxDmaRepeat((uint8_t *) dma->buf, DMA_BUFFER_SIZE) == false) {
if (g_dbglevel > DBG_ERROR) Dbprintf("FpgaSetupSscRxDmaRepeat failed. Exiting");
goto out;
}
@@ -195,7 +196,7 @@ static bool RAMFUNC sniff_wait_for_commit(tag_t type) {
uint32_t ledb_counter = 0;
while (BUTTON_PRESS() == false) {
register int readBufDataP = data - dma->buf;
register int dmaBufDataP = DMA_BUFFER_SIZE - AT91C_BASE_PDC_SSC->PDC_RCR;
register int dmaBufDataP = DMA_BUFFER_SIZE - FPGA_SSC_DMA_RX_Remaining_Count();
if (readBufDataP <= dmaBufDataP) {
dataLen = dmaBufDataP - readBufDataP;
} else {
@@ -219,17 +220,7 @@ static bool RAMFUNC sniff_wait_for_commit(tag_t type) {
ledb_counter = 0;
}
// primary buffer was stopped( <-- we lost data!
if (AT91C_BASE_PDC_SSC->PDC_RCR == 0) {
AT91C_BASE_PDC_SSC->PDC_RPR = (uint32_t) dma->buf;
AT91C_BASE_PDC_SSC->PDC_RCR = DMA_BUFFER_SIZE;
// Dbprintf("[-] RxEmpty ERROR | data length %d", dataLen); // temporary
}
// secondary buffer sets as primary, secondary buffer was stopped
if (AT91C_BASE_PDC_SSC->PDC_RNCR == 0) {
AT91C_BASE_PDC_SSC->PDC_RNPR = (uint32_t) dma->buf;
AT91C_BASE_PDC_SSC->PDC_RNCR = DMA_BUFFER_SIZE;
}
FPGA_SSC_DMA_RX_Refresh_Repeat(dma->buf, DMA_BUFFER_SIZE);
// Need two samples to feed Miller and Manchester-Decoder
if (rx_samples & 0x01) {
@@ -294,7 +285,7 @@ out:
FpgaWriteConfWord(FPGA_MAJOR_MODE_OFF);
}
FpgaDisableTracing();
FpgaDisableSscDma();
FPGA_SSC_DMA_RX_Disable();
return found_commit;
}
+3 -2
View File
@@ -31,10 +31,11 @@
#include "standalone.h"
#include "proxmark3_arm.h"
#include "appmain.h"
#include "fpgaloader.h"
#include "fpga_apis.h"
#include "fpga_loader.h"
#include "util.h"
#include "dbprint.h"
#include "ticks.h"
#include "ticks_apis.h"
#include "string.h"
#include "BigBuf.h"
#include "iso14443a.h"
+3 -2
View File
@@ -26,9 +26,10 @@
#include "proxmark3_arm.h"
#include "appmain.h"
#include "BigBuf.h"
#include "fpgaloader.h"
#include "fpga_apis.h"
#include "fpga_loader.h"
#include "util.h"
#include "ticks.h"
#include "ticks_apis.h"
#include "dbprint.h"
#include "spiffs.h"
#include "iclass.h"
+3 -2
View File
@@ -21,10 +21,11 @@
#include "proxmark3_arm.h"
#include "BigBuf.h"
#include "appmain.h"
#include "fpgaloader.h"
#include "fpga_apis.h"
#include "fpga_loader.h"
#include "util.h"
#include "dbprint.h"
#include "ticks.h"
#include "ticks_apis.h"
#include "legicrf.h"
#include "legicrfsim.h"
#include "legic.h" // legic_card_select_t struct
+3 -2
View File
@@ -18,11 +18,12 @@
// main code for legic prime simulator aka LEGICSIM
//-----------------------------------------------------------------------------
#include <inttypes.h>
#include "ticks.h"
#include "ticks_apis.h"
#include "proxmark3_arm.h"
#include "BigBuf.h"
#include "commonutil.h"
#include "fpgaloader.h"
#include "fpga_apis.h"
#include "fpga_loader.h"
#include "util.h"
#include "dbprint.h"
#include "spiffs.h"
+3 -2
View File
@@ -27,7 +27,8 @@
#include "commonutil.h"
#include "crc16.h"
#include "dbprint.h"
#include "fpgaloader.h"
#include "fpga_apis.h"
#include "fpga_loader.h"
#include "iso14443a.h"
#include "mifarecmd.h"
#include "mifaresim.h" // mifare1ksim
@@ -36,7 +37,7 @@
#include "spiffs.h"
#include "standalone.h" // standalone definitions
#include "string.h"
#include "ticks.h"
#include "ticks_apis.h"
#include "util.h"
/*
+3 -2
View File
@@ -17,11 +17,12 @@
// main code for mifare classic simulator aka MFCSIM
//-----------------------------------------------------------------------------
#include <inttypes.h>
#include "ticks.h"
#include "ticks_apis.h"
#include "proxmark3_arm.h"
#include "BigBuf.h"
#include "commonutil.h"
#include "fpgaloader.h"
#include "fpga_apis.h"
#include "fpga_loader.h"
#include "util.h"
#include "dbprint.h"
#include "spiffs.h"
+3 -2
View File
@@ -19,10 +19,11 @@
#include "standalone.h"
#include "proxmark3_arm.h"
#include "appmain.h"
#include "fpgaloader.h"
#include "fpga_apis.h"
#include "fpga_loader.h"
#include "util.h"
#include "dbprint.h"
#include "ticks.h"
#include "ticks_apis.h"
#include "string.h"
#include "BigBuf.h"
#include "iso14443a.h"
+3 -2
View File
@@ -19,10 +19,11 @@
#include "standalone.h"
#include "proxmark3_arm.h"
#include "appmain.h"
#include "fpgaloader.h"
#include "fpga_apis.h"
#include "fpga_loader.h"
#include "util.h"
#include "dbprint.h"
#include "ticks.h"
#include "ticks_apis.h"
#include "string.h"
#include "BigBuf.h"
#include "iso14443a.h"

Some files were not shown because too many files have changed in this diff Show More