From 9d8cfd13a7f38f2817a1d3df9fa37cd1ffdd8f05 Mon Sep 17 00:00:00 2001 From: iceman1001 Date: Sun, 6 Aug 2017 16:29:29 +0200 Subject: [PATCH] NEW: cleaning up in the StandAloneMode mods. 'hw version' - added a function to print out which mods is installed on the firmware (deviceside) New compiler flags are: # -DWITH_ICEMAN # -DWITH_LF_SAMYRUN # -DWITH_LF_PROXBRUTE # -DWITH_LF_HIDCORP # -DWITH_HF_YOUNG # -DWITH_HF_MATTYRUN The code behind them are NOT in this commit. They will come in there own files later on. --- armsrc/Makefile | 12 +++++++++++- armsrc/appmain.c | 46 +++++++++++++++++++++++++++++++++++++++------- 2 files changed, 50 insertions(+), 8 deletions(-) diff --git a/armsrc/Makefile b/armsrc/Makefile index baf420a26..e11e7ae83 100644 --- a/armsrc/Makefile +++ b/armsrc/Makefile @@ -21,10 +21,20 @@ APP_CFLAGS = -DWITH_CRC \ -DWITH_ISO14443a \ -DWITH_ICLASS \ -DWITH_HFSNOOP \ - -DWITH_ISO14443a_StandAlone \ + -DWITH_HF_YOUNG \ + -DWITH_LF_SAMYRUN \ -fno-strict-aliasing -ffunction-sections -fdata-sections ### IMPORTANT - move the commented variable below this line # -DWITH_LCD \ +# +# Standalone Mods +#------------------------------------------------------- +# -DWITH_ICEMAN +# -DWITH_LF_SAMYRUN +# -DWITH_LF_PROXBRUTE +# -DWITH_LF_HIDCORP +# -DWITH_HF_YOUNG +# -DWITH_HF_MATTYRUN SRC_LCD = fonts.c LCD.c SRC_LF = lfops.c hitag2.c hitagS.c lfsampling.c pcf7931.c lfdemod.c diff --git a/armsrc/appmain.c b/armsrc/appmain.c index 8ef038a55..1ba3ae185 100644 --- a/armsrc/appmain.c +++ b/armsrc/appmain.c @@ -27,7 +27,7 @@ #endif // Craig Young - 14a stand-alone code -#ifdef WITH_ISO14443a_StandAlone +#ifdef WITH_HF_YOUNG #include "iso14443a.h" #include "protocols.h" #endif @@ -320,6 +320,37 @@ void SendVersion(void) cmd_send(CMD_ACK, *(AT91C_DBGU_CIDR), text_and_rodata_section_size + compressed_data_section_size, 0, VersionString, strlen(VersionString)); } +// detection of which Standalone Modes is installed +// (iceman) +void printStandAloneModes(void){ + #if defined(WITH_HF_YOUNG) || defined(WITH_LF_SAMYRUN) + DbpString("Installed StandAlone Mods"); + #endif + #if defined(WITH_ICEMAN) + DbpString("LF sniff/clone/simulation - aka IceRun (iceman)"); + #endif + #if defined(WITH_HF_YOUNG) // WITH_HF_YOUNG + DbpString("HF Mifare sniff/simulation - (Craig Young)"); + #endif + #if defined(WITH_LF_SAMYRUN) // + DbpString("LF HID26 standalone - aka SamyRun (Samy Kamkar)"); + #endif + #if defined(WITH_LF_PROXBRUTE) + DbpString("LF HID ProxII bruteforce - aka Proxbrute (Brad Antoniewicz)"); + #endif + #if defined(WITH_LF_HIDCORP) + DbpString("LF HID corporate 1000 bruteforce - (Federi Codotta)"); + #endif + #if defined(WITH_HF_MATTYRUN) + DbpString("HF Mifare sniff/clone - aka MattyRun (Matta Real)"); + #endif + + //.. add your own standalone detection based on with compiler directive you are used. + // don't "reuse" the already taken ones, this will make things easier when trying to detect the different modes + // 2017-08-06 must adapt the makefile and have individual compilation flags for all mods + // +} + // measure the USB Speed by sending SpeedTestBufferSize bytes to client and measuring the elapsed time. // Note: this mimics GetFromBigbuf(), i.e. we have the overhead of the UsbCommand structure included. void printUSBSpeed(void) @@ -362,10 +393,11 @@ void SendStatus(void) { Dbprintf(" ToSendMax...............%d", ToSendMax); Dbprintf(" ToSendBit...............%d", ToSendBit); Dbprintf(" ToSend BUFFERSIZE.......%d", TOSEND_BUFFER_SIZE); + printStandAloneModes(); cmd_send(CMD_ACK,1,0,0,0,0); } -#if defined(WITH_ISO14443a_StandAlone) || defined(WITH_LF) +#if defined(WITH_HF_YOUNG) || defined(WITH_LF_SAMYRUN) #define OPTS 2 void StandAloneMode() @@ -384,7 +416,7 @@ void StandAloneMode() } #endif -#ifdef WITH_ISO14443a_StandAlone +#ifdef WITH_HF_YOUNG typedef struct { uint8_t uid[10]; @@ -639,7 +671,7 @@ void StandAloneMode14a() } } } -#elif WITH_LF +#elif WITH_LF_SAMYRUN // samy's sniff and repeat routine for LF void SamyRun() { @@ -1522,14 +1554,14 @@ void __attribute__((noreturn)) AppMain(void) } WDT_HIT(); -#ifdef WITH_LF -#ifndef WITH_ISO14443a_StandAlone +#ifdef WITH_LF_SAMYRUN +#ifndef WITH_HF_YOUNG if (BUTTON_HELD(1000) > 0) SamyRun(); #endif #endif #ifdef WITH_ISO14443a -#ifdef WITH_ISO14443a_StandAlone +#ifdef WITH_HF_YOUNG if (BUTTON_HELD(1000) > 0) StandAloneMode14a(); #endif