mirror of
https://github.com/Proxmark/proxmark3.git
synced 2025-07-15 09:43:00 -07:00
Also defines to carve out LF related code
This commit is contained in:
parent
b1083ec9f7
commit
c0d04e9540
2 changed files with 37 additions and 9 deletions
|
@ -4,10 +4,11 @@ APP_INCLUDES = apps.h
|
||||||
|
|
||||||
#remove one of the following defines and comment out the relevant line
|
#remove one of the following defines and comment out the relevant line
|
||||||
#in the next section to remove that particular feature from compilation
|
#in the next section to remove that particular feature from compilation
|
||||||
APP_CFLAGS = -O6 -DWITH_ISO15693 -DWITH_ISO14443a -DWITH_ISO14443b
|
APP_CFLAGS = -O6 -DWITH_LF -DWITH_ISO15693 -DWITH_ISO14443a -DWITH_ISO14443b
|
||||||
#-DWITH_LCD
|
#-DWITH_LCD
|
||||||
|
|
||||||
#SRC_LCD = fonts.c LCD.c
|
#SRC_LCD = fonts.c LCD.c
|
||||||
|
SRC_LF = lfops.c hitag2.c
|
||||||
SRC_ISO15693 = iso15693.c
|
SRC_ISO15693 = iso15693.c
|
||||||
SRC_ISO14443a = iso14443a.c
|
SRC_ISO14443a = iso14443a.c
|
||||||
SRC_ISO14443b = iso14443.c
|
SRC_ISO14443b = iso14443.c
|
||||||
|
@ -15,10 +16,9 @@ SRC_ISO14443b = iso14443.c
|
||||||
THUMBSRC = start.c \
|
THUMBSRC = start.c \
|
||||||
$(SRC_LCD) \
|
$(SRC_LCD) \
|
||||||
$(SRC_ISO15693) \
|
$(SRC_ISO15693) \
|
||||||
|
$(SRC_LF) \
|
||||||
appmain.c \
|
appmain.c \
|
||||||
lfops.c \
|
|
||||||
util.c \
|
util.c \
|
||||||
hitag2.c \
|
|
||||||
usb.c
|
usb.c
|
||||||
|
|
||||||
# These are to be compiled in ARM mode
|
# These are to be compiled in ARM mode
|
||||||
|
|
|
@ -267,6 +267,7 @@ void SendVersion(void)
|
||||||
DbpString(temp);
|
DbpString(temp);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef DWITH_LF
|
||||||
// samy's sniff and repeat routine
|
// samy's sniff and repeat routine
|
||||||
void SamyRun()
|
void SamyRun()
|
||||||
{
|
{
|
||||||
|
@ -377,7 +378,7 @@ void SamyRun()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
/*
|
/*
|
||||||
OBJECTIVE
|
OBJECTIVE
|
||||||
|
@ -533,13 +534,17 @@ void UsbPacketReceived(BYTE *packet, int len)
|
||||||
UsbCommand *c = (UsbCommand *)packet;
|
UsbCommand *c = (UsbCommand *)packet;
|
||||||
|
|
||||||
switch(c->cmd) {
|
switch(c->cmd) {
|
||||||
|
#ifdef DWITH_LF
|
||||||
case CMD_ACQUIRE_RAW_ADC_SAMPLES_125K:
|
case CMD_ACQUIRE_RAW_ADC_SAMPLES_125K:
|
||||||
AcquireRawAdcSamples125k(c->ext1);
|
AcquireRawAdcSamples125k(c->ext1);
|
||||||
break;
|
break;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef DWITH_LF
|
||||||
case CMD_MOD_THEN_ACQUIRE_RAW_ADC_SAMPLES_125K:
|
case CMD_MOD_THEN_ACQUIRE_RAW_ADC_SAMPLES_125K:
|
||||||
ModThenAcquireRawAdcSamples125k(c->ext1,c->ext2,c->ext3,c->d.asBytes);
|
ModThenAcquireRawAdcSamples125k(c->ext1,c->ext2,c->ext3,c->d.asBytes);
|
||||||
break;
|
break;
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef WITH_ISO15693
|
#ifdef WITH_ISO15693
|
||||||
case CMD_ACQUIRE_RAW_ADC_SAMPLES_ISO_15693:
|
case CMD_ACQUIRE_RAW_ADC_SAMPLES_ISO_15693:
|
||||||
|
@ -625,13 +630,17 @@ void UsbPacketReceived(BYTE *packet, int len)
|
||||||
ListenReaderField(c->ext1);
|
ListenReaderField(c->ext1);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
#ifdef DWITH_LF
|
||||||
case CMD_HID_DEMOD_FSK:
|
case CMD_HID_DEMOD_FSK:
|
||||||
CmdHIDdemodFSK(0, 0, 0, 1); // Demodulate HID tag
|
CmdHIDdemodFSK(0, 0, 0, 1); // Demodulate HID tag
|
||||||
break;
|
break;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef DWITH_LF
|
||||||
case CMD_HID_SIM_TAG:
|
case CMD_HID_SIM_TAG:
|
||||||
CmdHIDsimTAG(c->ext1, c->ext2, 1); // Simulate HID tag by ID
|
CmdHIDsimTAG(c->ext1, c->ext2, 1); // Simulate HID tag by ID
|
||||||
break;
|
break;
|
||||||
|
#endif
|
||||||
|
|
||||||
case CMD_FPGA_MAJOR_MODE_OFF: // ## FPGA Control
|
case CMD_FPGA_MAJOR_MODE_OFF: // ## FPGA Control
|
||||||
FpgaWriteConfWord(FPGA_MAJOR_MODE_OFF);
|
FpgaWriteConfWord(FPGA_MAJOR_MODE_OFF);
|
||||||
|
@ -639,13 +648,17 @@ void UsbPacketReceived(BYTE *packet, int len)
|
||||||
LED_D_OFF(); // LED D indicates field ON or OFF
|
LED_D_OFF(); // LED D indicates field ON or OFF
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
#ifdef DWITH_LF
|
||||||
case CMD_READ_TI_TYPE:
|
case CMD_READ_TI_TYPE:
|
||||||
ReadTItag();
|
ReadTItag();
|
||||||
break;
|
break;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef DWITH_LF
|
||||||
case CMD_WRITE_TI_TYPE:
|
case CMD_WRITE_TI_TYPE:
|
||||||
WriteTItag(c->ext1,c->ext2,c->ext3);
|
WriteTItag(c->ext1,c->ext2,c->ext3);
|
||||||
break;
|
break;
|
||||||
|
#endif
|
||||||
|
|
||||||
case CMD_DOWNLOAD_RAW_ADC_SAMPLES_125K: {
|
case CMD_DOWNLOAD_RAW_ADC_SAMPLES_125K: {
|
||||||
UsbCommand n;
|
UsbCommand n;
|
||||||
|
@ -659,22 +672,29 @@ void UsbPacketReceived(BYTE *packet, int len)
|
||||||
UsbSendPacket((BYTE *)&n, sizeof(n));
|
UsbSendPacket((BYTE *)&n, sizeof(n));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
case CMD_DOWNLOADED_SIM_SAMPLES_125K: {
|
case CMD_DOWNLOADED_SIM_SAMPLES_125K: {
|
||||||
BYTE *b = (BYTE *)BigBuf;
|
BYTE *b = (BYTE *)BigBuf;
|
||||||
memcpy(b+c->ext1, c->d.asBytes, 48);
|
memcpy(b+c->ext1, c->d.asBytes, 48);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef DWITH_LF
|
||||||
case CMD_SIMULATE_TAG_125K:
|
case CMD_SIMULATE_TAG_125K:
|
||||||
LED_A_ON();
|
LED_A_ON();
|
||||||
SimulateTagLowFrequency(c->ext1, 1);
|
SimulateTagLowFrequency(c->ext1, 1);
|
||||||
LED_A_OFF();
|
LED_A_OFF();
|
||||||
break;
|
break;
|
||||||
|
#endif
|
||||||
|
|
||||||
case CMD_READ_MEM:
|
case CMD_READ_MEM:
|
||||||
ReadMem(c->ext1);
|
ReadMem(c->ext1);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case CMD_SET_LF_DIVISOR:
|
case CMD_SET_LF_DIVISOR:
|
||||||
FpgaSendCommand(FPGA_CMD_SET_DIVISOR, c->ext1);
|
FpgaSendCommand(FPGA_CMD_SET_DIVISOR, c->ext1);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case CMD_SET_ADC_MUX:
|
case CMD_SET_ADC_MUX:
|
||||||
switch(c->ext1) {
|
switch(c->ext1) {
|
||||||
case 0: SetAdcMuxFor(GPIO_MUXSEL_LOPKD); break;
|
case 0: SetAdcMuxFor(GPIO_MUXSEL_LOPKD); break;
|
||||||
|
@ -683,12 +703,17 @@ void UsbPacketReceived(BYTE *packet, int len)
|
||||||
case 3: SetAdcMuxFor(GPIO_MUXSEL_HIRAW); break;
|
case 3: SetAdcMuxFor(GPIO_MUXSEL_HIRAW); break;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case CMD_VERSION:
|
case CMD_VERSION:
|
||||||
SendVersion();
|
SendVersion();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
#ifdef DWITH_LF
|
||||||
case CMD_LF_SIMULATE_BIDIR:
|
case CMD_LF_SIMULATE_BIDIR:
|
||||||
SimulateTagLowFrequencyBidir(c->ext1, c->ext2);
|
SimulateTagLowFrequencyBidir(c->ext1, c->ext2);
|
||||||
break;
|
break;
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef WITH_LCD
|
#ifdef WITH_LCD
|
||||||
case CMD_LCD_RESET:
|
case CMD_LCD_RESET:
|
||||||
LCDReset();
|
LCDReset();
|
||||||
|
@ -708,6 +733,7 @@ void UsbPacketReceived(BYTE *packet, int len)
|
||||||
// We're going to reset, and the bootrom will take control.
|
// We're going to reset, and the bootrom will take control.
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case CMD_START_FLASH:
|
case CMD_START_FLASH:
|
||||||
if(common_area.flags.bootrom_present) {
|
if(common_area.flags.bootrom_present) {
|
||||||
common_area.command = COMMON_AREA_COMMAND_ENTER_FLASH_MODE;
|
common_area.command = COMMON_AREA_COMMAND_ENTER_FLASH_MODE;
|
||||||
|
@ -797,7 +823,9 @@ void __attribute__((noreturn)) AppMain(void)
|
||||||
UsbPoll(FALSE);
|
UsbPoll(FALSE);
|
||||||
WDT_HIT();
|
WDT_HIT();
|
||||||
|
|
||||||
|
#ifdef DWITH_LF
|
||||||
if (BUTTON_HELD(1000) > 0)
|
if (BUTTON_HELD(1000) > 0)
|
||||||
SamyRun();
|
SamyRun();
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue