mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-08-19 13:00:42 -07:00
Move Makefile standalone stuff to armsrc/Standalone for easier access
This commit is contained in:
parent
d3b6a8e193
commit
710b38f209
5 changed files with 118 additions and 94 deletions
|
@ -68,41 +68,7 @@ else
|
||||||
endif
|
endif
|
||||||
|
|
||||||
# Generic standalone Mode injection of source code
|
# Generic standalone Mode injection of source code
|
||||||
|
include Standalone/Makefile.inc
|
||||||
|
|
||||||
SRC_STANDALONE = placeholder.c
|
|
||||||
# WITH_STANDALONE_LF_ICERUN
|
|
||||||
ifneq (,$(findstring WITH_STANDALONE_LF_ICERUN,$(APP_CFLAGS)))
|
|
||||||
SRC_STANDALONE = lf_icerun.c
|
|
||||||
endif
|
|
||||||
# WITH_STANDALONE_LF_SAMYRUN
|
|
||||||
ifneq (,$(findstring WITH_STANDALONE_LF_SAMYRUN,$(APP_CFLAGS)))
|
|
||||||
SRC_STANDALONE = lf_samyrun.c
|
|
||||||
endif
|
|
||||||
# WITH_STANDALONE_LF_PROXBRUTE
|
|
||||||
ifneq (,$(findstring WITH_STANDALONE_LF_PROXBRUTE,$(APP_CFLAGS)))
|
|
||||||
SRC_STANDALONE = lf_proxbrute.c
|
|
||||||
endif
|
|
||||||
# WITH_STANDALONE_LF_HIDBRUTE
|
|
||||||
ifneq (,$(findstring WITH_STANDALONE_LF_HIDBRUTE,$(APP_CFLAGS)))
|
|
||||||
SRC_STANDALONE = lf_hidbrute.c
|
|
||||||
endif
|
|
||||||
# WITH_STANDALONE_HF_YOUNG
|
|
||||||
ifneq (,$(findstring WITH_STANDALONE_HF_YOUNG,$(APP_CFLAGS)))
|
|
||||||
SRC_STANDALONE = hf_young.c
|
|
||||||
endif
|
|
||||||
# WITH_STANDALONE_HF_MATTYRUN
|
|
||||||
ifneq (,$(findstring WITH_STANDALONE_HF_MATTYRUN,$(APP_CFLAGS)))
|
|
||||||
SRC_STANDALONE = hf_mattyrun.c
|
|
||||||
endif
|
|
||||||
# WITH_STANDALONE_HF_COLIN
|
|
||||||
ifneq (,$(findstring WITH_STANDALONE_HF_COLIN,$(APP_CFLAGS)))
|
|
||||||
SRC_STANDALONE = vtsend.c hf_colin.c
|
|
||||||
endif
|
|
||||||
# WITH_STANDALONE_HF_BOG
|
|
||||||
ifneq (,$(findstring WITH_STANDALONE_HF_BOG,$(APP_CFLAGS)))
|
|
||||||
SRC_STANDALONE = hf_bog.c
|
|
||||||
endif
|
|
||||||
|
|
||||||
#the FPGA bitstream files. Note: order matters!
|
#the FPGA bitstream files. Note: order matters!
|
||||||
FPGA_BITSTREAMS = fpga_lf.bit fpga_hf.bit
|
FPGA_BITSTREAMS = fpga_lf.bit fpga_hf.bit
|
||||||
|
|
46
armsrc/Standalone/Makefile.hal
Normal file
46
armsrc/Standalone/Makefile.hal
Normal file
|
@ -0,0 +1,46 @@
|
||||||
|
# Default standalone if no standalone specified
|
||||||
|
DEFAULT_STANDALONE=LF_SAMYRUN
|
||||||
|
HELP_EXAMPLE_STANDALONE=HF_COLIN
|
||||||
|
# (you can set explicitly STANDALONE= to disable standalone modes)
|
||||||
|
STANDALONE?=$(DEFAULT_STANDALONE)
|
||||||
|
|
||||||
|
define KNOWN_STANDALONE_DEFINITIONS
|
||||||
|
+==========================================================+
|
||||||
|
| STANDALONE | DESCRIPTION |
|
||||||
|
+==========================================================+
|
||||||
|
| | No standalone mode |
|
||||||
|
+----------------------------------------------------------+
|
||||||
|
| LF_SAMYRUN (def)| HID26 read/clone/sim |
|
||||||
|
| | - Samy Kamkar |
|
||||||
|
+----------------------------------------------------------+
|
||||||
|
| LF_ICERUN | standalone mode skeleton |
|
||||||
|
| | - iceman |
|
||||||
|
+----------------------------------------------------------+
|
||||||
|
| LF_PROXBRUTE | HID ProxII bruteforce |
|
||||||
|
| | - Brad Antoniewicz |
|
||||||
|
+----------------------------------------------------------+
|
||||||
|
| LF_HIDBRUTE | HID corporate 1000 bruteforce |
|
||||||
|
| | - Federico dotta & Maurizio Agazzini |
|
||||||
|
+----------------------------------------------------------+
|
||||||
|
| HF_YOUNG | Mifare sniff/simulation |
|
||||||
|
| | - Craig Young |
|
||||||
|
+----------------------------------------------------------+
|
||||||
|
| HF_MATTYRUN | Mifare sniff/clone |
|
||||||
|
| | - Matías A. Ré Medina |
|
||||||
|
+----------------------------------------------------------+
|
||||||
|
| HF_COLIN | Mifare ultra fast sniff/sim/clone |
|
||||||
|
| | - Colin Brigato |
|
||||||
|
+----------------------------------------------------------+
|
||||||
|
| HF_BOG | 14a sniff with ULC/ULEV1/NTAG auth |
|
||||||
|
| | storing in flashmem - Bogito |
|
||||||
|
+----------------------------------------------------------+
|
||||||
|
|
||||||
|
endef
|
||||||
|
|
||||||
|
STANDALONE_MODES := LF_SAMYRUN LF_ICERUN LF_PROXBRUTE LF_HIDBRUTE
|
||||||
|
STANDALONE_MODES += HF_YOUNG HF_MATTYRUN HF_COLIN HF_BOG
|
||||||
|
ifneq ($(filter $(STANDALONE),$(STANDALONE_MODES)),)
|
||||||
|
STANDALONE_PLATFORM_DEFS += -DWITH_STANDALONE_$(STANDALONE)
|
||||||
|
else ifneq ($(STANDALONE),)
|
||||||
|
$(error Invalid STANDALONE: $(STANDALONE). $(KNOWN_DEFINITIONS))
|
||||||
|
endif
|
36
armsrc/Standalone/Makefile.inc
Normal file
36
armsrc/Standalone/Makefile.inc
Normal file
|
@ -0,0 +1,36 @@
|
||||||
|
# Generic standalone Mode injection of source code
|
||||||
|
|
||||||
|
SRC_STANDALONE = placeholder.c
|
||||||
|
# WITH_STANDALONE_LF_ICERUN
|
||||||
|
ifneq (,$(findstring WITH_STANDALONE_LF_ICERUN,$(APP_CFLAGS)))
|
||||||
|
SRC_STANDALONE = lf_icerun.c
|
||||||
|
endif
|
||||||
|
# WITH_STANDALONE_LF_SAMYRUN
|
||||||
|
ifneq (,$(findstring WITH_STANDALONE_LF_SAMYRUN,$(APP_CFLAGS)))
|
||||||
|
SRC_STANDALONE = lf_samyrun.c
|
||||||
|
endif
|
||||||
|
# WITH_STANDALONE_LF_PROXBRUTE
|
||||||
|
ifneq (,$(findstring WITH_STANDALONE_LF_PROXBRUTE,$(APP_CFLAGS)))
|
||||||
|
SRC_STANDALONE = lf_proxbrute.c
|
||||||
|
endif
|
||||||
|
# WITH_STANDALONE_LF_HIDBRUTE
|
||||||
|
ifneq (,$(findstring WITH_STANDALONE_LF_HIDBRUTE,$(APP_CFLAGS)))
|
||||||
|
SRC_STANDALONE = lf_hidbrute.c
|
||||||
|
endif
|
||||||
|
# WITH_STANDALONE_HF_YOUNG
|
||||||
|
ifneq (,$(findstring WITH_STANDALONE_HF_YOUNG,$(APP_CFLAGS)))
|
||||||
|
SRC_STANDALONE = hf_young.c
|
||||||
|
endif
|
||||||
|
# WITH_STANDALONE_HF_MATTYRUN
|
||||||
|
ifneq (,$(findstring WITH_STANDALONE_HF_MATTYRUN,$(APP_CFLAGS)))
|
||||||
|
SRC_STANDALONE = hf_mattyrun.c
|
||||||
|
endif
|
||||||
|
# WITH_STANDALONE_HF_COLIN
|
||||||
|
ifneq (,$(findstring WITH_STANDALONE_HF_COLIN,$(APP_CFLAGS)))
|
||||||
|
SRC_STANDALONE = vtsend.c hf_colin.c
|
||||||
|
endif
|
||||||
|
# WITH_STANDALONE_HF_BOG
|
||||||
|
ifneq (,$(findstring WITH_STANDALONE_HF_BOG,$(APP_CFLAGS)))
|
||||||
|
SRC_STANDALONE = hf_bog.c
|
||||||
|
endif
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
# Standalone Modes
|
# Standalone Modes
|
||||||
|
|
||||||
This contains functionality for different StandAlone modes. The fullimage will be built given the correct compiler flags used. Build targets for these files are contained in `armsrc/Makefile` and `common/Makefile.hal`
|
This contains functionality for different StandAlone modes. The fullimage will be built given the correct compiler flags used. Build targets for these files are contained in `Makefile.inc` and `Makefile.hal`
|
||||||
|
|
||||||
If you want to implement a new standalone mode, you need to implement the methods provided in `standalone.h`.
|
If you want to implement a new standalone mode, you need to implement the methods provided in `standalone.h`.
|
||||||
Have a look at the skeleton standalone mode called IceRun, in the files `lf_icerun.c lf_icerun.h`.
|
Have a look at the skeleton standalone mode called IceRun, in the files `lf_icerun.c lf_icerun.h`.
|
||||||
|
@ -40,8 +40,6 @@ void RunMod(void) {
|
||||||
}
|
}
|
||||||
````
|
````
|
||||||
|
|
||||||
Each standalone mode needs to have its own compiler flag to be added in `armsrc/Makefile`.
|
|
||||||
|
|
||||||
## Naming your standalone mode
|
## Naming your standalone mode
|
||||||
|
|
||||||
We suggest that you follow these guidelines:
|
We suggest that you follow these guidelines:
|
||||||
|
@ -58,9 +56,9 @@ This leads to your next step, your DEFINE name needed in Makefile.
|
||||||
`WITH_STANDALONE_LF_FOO`
|
`WITH_STANDALONE_LF_FOO`
|
||||||
|
|
||||||
|
|
||||||
## Update COMMON/MAKEFILE.HAL
|
## Update MAKEFILE.HAL
|
||||||
|
|
||||||
Add your mode to the `common/Makefile.hal` help and modes list:
|
Add your mode to the `Makefile.hal` help and modes list:
|
||||||
```
|
```
|
||||||
+==========================================================+
|
+==========================================================+
|
||||||
| STANDALONE | DESCRIPTION |
|
| STANDALONE | DESCRIPTION |
|
||||||
|
@ -74,8 +72,8 @@ STANDALONE_MODES := LF_SAMYRUN LF_ICERUN LF_PROXBRUTE LF_HIDBRUTE LF_FOO
|
||||||
STANDALONE_MODES += HF_YOUNG HF_MATTYRUN HF_COLIN HF_BOG
|
STANDALONE_MODES += HF_YOUNG HF_MATTYRUN HF_COLIN HF_BOG
|
||||||
```
|
```
|
||||||
|
|
||||||
## Update ARMSRC/MAKEFILE
|
## Update MAKEFILE.INC
|
||||||
Add your source code files like the following sample in the `armsrc/Makefile`
|
Add your source code files like the following sample in the `Makefile.inc`
|
||||||
|
|
||||||
```
|
```
|
||||||
# WITH_STANDALONE_LF_ICERUN
|
# WITH_STANDALONE_LF_ICERUN
|
||||||
|
@ -100,7 +98,7 @@ void ModInfo(void) {
|
||||||
````
|
````
|
||||||
|
|
||||||
## Compiling your standalone mode
|
## Compiling your standalone mode
|
||||||
Once all this is done, you and others can now easily compile different standalone modes by just selecting one of the standalone modes (list in `common/Makefile.hal` or ) , e.g.:
|
Once all this is done, you and others can now easily compile different standalone modes by just selecting one of the standalone modes (list in `Makefile.hal` or ) , e.g.:
|
||||||
|
|
||||||
- rename Makefile.platform.sample -> Makefile.platform
|
- rename Makefile.platform.sample -> Makefile.platform
|
||||||
- edit the "STANDALONE" row inside Makefile.platform. You need to uncomment it and add your standalone mode name
|
- edit the "STANDALONE" row inside Makefile.platform. You need to uncomment it and add your standalone mode name
|
||||||
|
|
|
@ -1,10 +1,14 @@
|
||||||
# Default platform if no platform specified
|
# Default platform if no platform specified
|
||||||
PLATFORM?=PM3RDV4
|
PLATFORM?=PM3RDV4
|
||||||
# Default standalone if no standalone specified
|
|
||||||
# (you can set explicitly STANDALONE= to disable standalone modes)
|
|
||||||
STANDALONE?=LF_SAMYRUN
|
|
||||||
|
|
||||||
define KNOWN_DEFINITIONS
|
# Standalone Mode info (path depends if make is called at top or from armsrc)
|
||||||
|
-include armsrc/Standalone/Makefile.hal
|
||||||
|
-include Standalone/Makefile.hal
|
||||||
|
ifndef DEFAULT_STANDALONE
|
||||||
|
$(error Could not find armsrc/Standalone/Makefile.hal)
|
||||||
|
endif
|
||||||
|
|
||||||
|
define KNOWN_PLATFORM_DEFINITIONS
|
||||||
|
|
||||||
Known definitions:
|
Known definitions:
|
||||||
|
|
||||||
|
@ -30,39 +34,12 @@ Known definitions:
|
||||||
| BTADDON | Proxmark3 rdv4 BT add-on |
|
| BTADDON | Proxmark3 rdv4 BT add-on |
|
||||||
+----------------------------------------------------------+
|
+----------------------------------------------------------+
|
||||||
|
|
||||||
+==========================================================+
|
endef
|
||||||
| STANDALONE | DESCRIPTION |
|
|
||||||
+==========================================================+
|
|
||||||
| | No standalone mode |
|
|
||||||
+----------------------------------------------------------+
|
|
||||||
| LF_SAMYRUN (def)| HID26 read/clone/sim |
|
|
||||||
| | - Samy Kamkar |
|
|
||||||
+----------------------------------------------------------+
|
|
||||||
| LF_ICERUN | standalone mode skeleton |
|
|
||||||
| | - iceman |
|
|
||||||
+----------------------------------------------------------+
|
|
||||||
| LF_PROXBRUTE | HID ProxII bruteforce |
|
|
||||||
| | - Brad Antoniewicz |
|
|
||||||
+----------------------------------------------------------+
|
|
||||||
| LF_HIDBRUTE | HID corporate 1000 bruteforce |
|
|
||||||
| | - Federico dotta & Maurizio Agazzini |
|
|
||||||
+----------------------------------------------------------+
|
|
||||||
| HF_YOUNG | Mifare sniff/simulation |
|
|
||||||
| | - Craig Young |
|
|
||||||
+----------------------------------------------------------+
|
|
||||||
| HF_MATTYRUN | Mifare sniff/clone |
|
|
||||||
| | - Matías A. Ré Medina |
|
|
||||||
+----------------------------------------------------------+
|
|
||||||
| HF_COLIN | Mifare ultra fast sniff/sim/clone |
|
|
||||||
| | - Colin Brigato |
|
|
||||||
+----------------------------------------------------------+
|
|
||||||
| HF_BOG | 14a sniff with ULC/ULEV1/NTAG auth |
|
|
||||||
| | storing in flashmem - Bogito |
|
|
||||||
+----------------------------------------------------------+
|
|
||||||
|
|
||||||
|
define HELP_DEFINITIONS
|
||||||
Options to define platform, platform extras and/or standalone mode:
|
Options to define platform, platform extras and/or standalone mode:
|
||||||
(1) Run make with PLATFORM, PLATFORM_EXTRAS and/or STANDALONE as follows:
|
(1) Run make with PLATFORM, PLATFORM_EXTRAS and/or STANDALONE as follows:
|
||||||
make PLATFORM=PM3EASY STANDALONE=HF_COLIN
|
make PLATFORM=PM3EASY STANDALONE=$(HELP_EXAMPLE_STANDALONE)
|
||||||
|
|
||||||
(2) Save a file called Makefile.platform with contents:
|
(2) Save a file called Makefile.platform with contents:
|
||||||
PLATFORM=PM3EASY
|
PLATFORM=PM3EASY
|
||||||
|
@ -71,11 +48,17 @@ or if you have a Proxmark 3 RDV4 with the BT add-on:
|
||||||
PLATFORM=PM3RDV4
|
PLATFORM=PM3RDV4
|
||||||
PLATFORM_EXTRAS=BTADDON
|
PLATFORM_EXTRAS=BTADDON
|
||||||
|
|
||||||
Default standalone mode is LF_SAMYRUN.
|
Default standalone mode is $(DEFAULT_STANDALONE).
|
||||||
To disable standalone modes, set explicitly an empty STANDALONE:
|
To disable standalone modes, set explicitly an empty STANDALONE:
|
||||||
STANDALONE=
|
STANDALONE=
|
||||||
endef
|
endef
|
||||||
|
|
||||||
|
define KNOWN_DEFINITIONS
|
||||||
|
$(KNOWN_PLATFORM_DEFINITIONS)
|
||||||
|
$(KNOWN_STANDALONE_DEFINITIONS)
|
||||||
|
$(HELP_DEFINITIONS)
|
||||||
|
endef
|
||||||
|
|
||||||
PLTNAME = Unknown Platform
|
PLTNAME = Unknown Platform
|
||||||
|
|
||||||
ifeq ($(PLATFORM),PM3RDV4)
|
ifeq ($(PLATFORM),PM3RDV4)
|
||||||
|
@ -131,13 +114,7 @@ PLATFORM_DEFS += \
|
||||||
-DWITH_HFSNIFF
|
-DWITH_HFSNIFF
|
||||||
|
|
||||||
# Standalone mode
|
# Standalone mode
|
||||||
STANDALONE_MODES := LF_SAMYRUN LF_ICERUN LF_PROXBRUTE LF_HIDBRUTE
|
PLATFORM_DEFS+=$(STANDALONE_PLATFORM_DEFS)
|
||||||
STANDALONE_MODES += HF_YOUNG HF_MATTYRUN HF_COLIN HF_BOG
|
|
||||||
ifneq ($(filter $(STANDALONE),$(STANDALONE_MODES)),)
|
|
||||||
PLATFORM_DEFS += -DWITH_STANDALONE_$(STANDALONE)
|
|
||||||
else ifneq ($(STANDALONE),)
|
|
||||||
$(error Invalid STANDALONE: $(STANDALONE). $(KNOWN_DEFINITIONS))
|
|
||||||
endif
|
|
||||||
|
|
||||||
$(info $(findstring WITH_STANDALONE_*,$(PLATFORM_DEFS)))
|
$(info $(findstring WITH_STANDALONE_*,$(PLATFORM_DEFS)))
|
||||||
|
|
||||||
|
@ -171,15 +148,6 @@ ifeq (,$(PLATFORM_DEFS_INFO_STANDALONE))
|
||||||
PLATFORM_DEFS_INFO_STANDALONE = No standalone mode selected
|
PLATFORM_DEFS_INFO_STANDALONE = No standalone mode selected
|
||||||
endif
|
endif
|
||||||
|
|
||||||
export PLATFORM
|
|
||||||
export PLATFORM_EXTRAS
|
|
||||||
export PLATFORM_EXTRAS_INFO
|
|
||||||
export PLTNAME
|
|
||||||
export MCU
|
|
||||||
export PLATFORM_DEFS
|
|
||||||
export PLATFORM_DEFS_INFO
|
|
||||||
export PLATFORM_DEFS_INFO_STANDALONE
|
|
||||||
|
|
||||||
PLATFORM_CHANGED=false
|
PLATFORM_CHANGED=false
|
||||||
ifneq ($(PLATFORM), $(CACHED_PLATFORM))
|
ifneq ($(PLATFORM), $(CACHED_PLATFORM))
|
||||||
PLATFORM_CHANGED=true
|
PLATFORM_CHANGED=true
|
||||||
|
@ -189,6 +157,16 @@ else ifneq ($(PLATFORM_DEFS), $(CACHED_PLATFORM_DEFS))
|
||||||
PLATFORM_CHANGED=true
|
PLATFORM_CHANGED=true
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
export PLATFORM
|
||||||
|
export PLATFORM_EXTRAS
|
||||||
|
export PLATFORM_EXTRAS_INFO
|
||||||
|
export PLTNAME
|
||||||
|
export MCU
|
||||||
|
export PLATFORM_DEFS
|
||||||
|
export PLATFORM_DEFS_INFO
|
||||||
|
export PLATFORM_DEFS_INFO_STANDALONE
|
||||||
|
export PLATFORM_CHANGED
|
||||||
|
|
||||||
$(info ===================================================================)
|
$(info ===================================================================)
|
||||||
$(info Platform name: $(PLTNAME))
|
$(info Platform name: $(PLTNAME))
|
||||||
$(info PLATFORM: $(PLATFORM))
|
$(info PLATFORM: $(PLATFORM))
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue