mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-08-19 21:03:48 -07:00
Merge branch 'master' of https://github.com/RfidResearchGroup/proxmark3
This commit is contained in:
commit
de05d6e4d2
16 changed files with 63 additions and 31 deletions
|
@ -1,23 +1,32 @@
|
|||
# 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`.
|
||||
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`
|
||||
|
||||
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`.
|
||||
|
||||
As it is now, you can only have one standalone mode installed at the time.
|
||||
|
||||
## Implementing a standalone mode
|
||||
|
||||
Each standalone mod needs to have its own compiler flag to be added in `armsrc\makefile`.
|
||||
We suggest you keep your standalone code inside the `armsrc/Standalone` folder. And that you name your files according to your standalone mode name.
|
||||
|
||||
The `standalone.h` states that you must have two functions implemented.
|
||||
|
||||
The ModInfo function, which is your identification of your standalone mode. This string will show when running the command `hw status` on the client.
|
||||
|
||||
The RunMod function, which is your "main" function when running. You need to check for Usb commands, in order to let the pm3 client break the standalone mode. See this basic skeleton of main function RunMod() and Modinfo() below.
|
||||
|
||||
The RunMod function is your "main" function when running. You need to check for Usb commands, in order to let the pm3 client break the standalone mode. See this basic skeleton of main function RunMod().
|
||||
````
|
||||
void ModInfo(void) {
|
||||
DbpString(" HF good description of your mode - (my name)");
|
||||
DbpString(" LF good description of your mode - aka FooRun (your name)");
|
||||
}
|
||||
|
||||
void RunMod(void) {
|
||||
// led show
|
||||
StandAloneMode();
|
||||
|
||||
// Do you target LF or HF?
|
||||
FpgaDownloadAndGo(FPGA_BITSTREAM_LF);
|
||||
|
||||
// main loop
|
||||
|
@ -31,42 +40,69 @@ void RunMod(void) {
|
|||
}
|
||||
````
|
||||
|
||||
As it is now, you can only have one standalone mode installed at the time.
|
||||
Each standalone mode needs to have its own compiler flag to be added in `armsrc/Makefile`.
|
||||
|
||||
## Name
|
||||
Use HF/LF to denote which frequence your mod is targeting.
|
||||
Use you own github name/similar for perpetual honour to denote your mod
|
||||
## Naming your standalone mode
|
||||
|
||||
Samples of directive flag used in the `common/Makefile.hal`:
|
||||
We suggest that you follow these guidelines:
|
||||
- Use HF/LF to denote which frequency your mode is targeting.
|
||||
- Use you own github name/similar for perpetual honour to denote your mode.
|
||||
|
||||
sample:
|
||||
`LF_FOO`
|
||||
|
||||
Which indicates your mode targets LF and is called FOO.
|
||||
|
||||
This leads to your next step, your DEFINE name needed in Makefile.
|
||||
|
||||
`WITH_STANDALONE_LF_FOO`
|
||||
|
||||
|
||||
## Update COMMON/MAKEFILE.HAL
|
||||
|
||||
Add your suggested DEFINE to the samples of directive flag provided in the `common/Makefile.hal`.
|
||||
```
|
||||
#PLATFORM_DEFS += -DWITH_STANDALONE_LF_SAMYRUN
|
||||
#PLATFORM_DEFS += -DWITH_STANDALONE_LF_ICERUN
|
||||
#PLATFORM_DEFS += -DWITH_STANDALONE_LF_SAMYRUN
|
||||
#PLATFORM_DEFS += -DWITH_STANDALONE_LF_PROXBRUTE
|
||||
#PLATFORM_DEFS += -DWITH_STANDALONE_LF_HIDBRUTE
|
||||
#PLATFORM_DEFS += -DWITH_STANDALONE_HF_YOUNG
|
||||
#PLATFORM_DEFS += -DWITH_STANDALONE_HF_MATTYRUN
|
||||
#PLATFORM_DEFS += -DWITH_STANDALONE_HF_COLIN
|
||||
#PLATFORM_DEFS += -DWITH_STANDALONE_HF_BOG
|
||||
#PLATFORM_DEFS += -DWITH_STANDALONE_LF_FOO
|
||||
```
|
||||
Add your source code file like the following sample in the `armsrc/Makefile`
|
||||
|
||||
## Update ARMSRC/MAKEFILE
|
||||
Add your source code files like the following sample in the `armsrc/Makefile`
|
||||
|
||||
```
|
||||
# WITH_STANDALONE_HF_COLIN
|
||||
ifneq (,$(findstring WITH_STANDALONE_HF_COLIN,$(APP_CFLAGS)))
|
||||
SRC_STANDALONE = hf_colin.c vtsend.c
|
||||
else
|
||||
SRC_STANDALONE =
|
||||
# WITH_STANDALONE_LF_ICERUN
|
||||
ifneq (,$(findstring WITH_STANDALONE_LF_ICERUN,$(APP_CFLAGS)))
|
||||
SRC_STANDALONE = lf_icerun.c
|
||||
endif
|
||||
|
||||
# WITH_STANDALONE_LF_FOO
|
||||
ifneq (,$(findstring WITH_STANDALONE_LF_FOO,$(APP_CFLAGS)))
|
||||
SRC_STANDALONE = lf_foo.c
|
||||
endif
|
||||
```
|
||||
|
||||
## Adding identification of your mode
|
||||
## Adding identification string of your mode
|
||||
Do please add a identification string in a function called `ModInfo` inside your source code file.
|
||||
This will enable an easy way to detect on client side which standalone mods has been installed on the device.
|
||||
This will enable an easy way to detect on client side which standalone mode has been installed on the device.
|
||||
|
||||
````
|
||||
void ModInfo(void) {
|
||||
DbpString(" LF good description of your mode - aka FooRun (your name)");
|
||||
}
|
||||
````
|
||||
|
||||
## 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 in `common/Makefile.hal`, e.g.:
|
||||
|
||||
```
|
||||
PLATFORM_DEFS += -DWITH_STANDALONE_HF_COLIN
|
||||
PLATFORM_DEFS += -DWITH_STANDALONE_LF_FOO
|
||||
```
|
||||
|
||||
Remember only one can be selected at a time for now.
|
||||
|
|
|
@ -3,26 +3,23 @@
|
|||
# at your option, any later version. See the LICENSE.txt file for the text of
|
||||
# the license.
|
||||
#-----------------------------------------------------------------------------
|
||||
include ../../common/Makefile.common
|
||||
|
||||
CC=gcc
|
||||
CXX=g++
|
||||
#COMMON_FLAGS = -m32
|
||||
|
||||
VPATH = ../../common
|
||||
OBJDIR = obj
|
||||
|
||||
LDLIBS = -lreadline -lpthread
|
||||
CFLAGS = -std=gnu99 -Wall -Wno-unused-function $(COMMON_FLAGS) -g -O3
|
||||
ifeq ($(platform),Darwin)
|
||||
LDLIBS = -L/opt/local/lib -L/usr/local/lib -lusb-1.0 -lreadline -lpthread
|
||||
CFLAGS = -std=gnu99 -I. -I../include -I../common -I/usr/local/include -I/opt/local/include -Wall -Wno-unused-function $(COMMON_FLAGS) -g -O3
|
||||
LDLIBS += -lusb-1.0
|
||||
else
|
||||
LDLIBS = -L/opt/local/lib -L/usr/local/lib -lusb -lreadline -lpthread
|
||||
CFLAGS = -std=gnu99 -I. -I../include -I../common -I/opt/local/include -Wall -Wno-unused-function $(COMMON_FLAGS) -g -O3
|
||||
LDLIBS += -lusb
|
||||
endif
|
||||
|
||||
LDFLAGS = $(COMMON_FLAGS)
|
||||
CXXFLAGS =
|
||||
QTLDLIBS =
|
||||
|
||||
RM = rm -f
|
||||
BINS = flasher
|
|
@ -11,11 +11,11 @@
|
|||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
#include "util_posix.h"
|
||||
#include "proxusb.h"
|
||||
#include "flash.h"
|
||||
#include "elf.h"
|
||||
#include "proxendian.h"
|
||||
#include "sleep.h"
|
||||
|
||||
#define FLASH_START 0x100000
|
||||
#define FLASH_SIZE (256*1024)
|
|
@ -9,9 +9,9 @@
|
|||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include "util_posix.h"
|
||||
#include "proxusb.h"
|
||||
#include "flash.h"
|
||||
#include "sleep.h"
|
||||
|
||||
static void usage(char *argv0) {
|
||||
fprintf(stderr, "Usage: %s [-b] image.elf [image.elf...]\n\n", argv0);
|
|
@ -9,6 +9,7 @@
|
|||
// USB utilities
|
||||
//-----------------------------------------------------------------------------
|
||||
#include "proxusb.h"
|
||||
#include "sleep.h"
|
||||
|
||||
// It seems to be missing for mingw
|
||||
#ifndef ETIMEDOUT
|
|
@ -22,7 +22,6 @@
|
|||
#include <errno.h>
|
||||
#include "proxmark3.h"
|
||||
#include "usb_cmd.h"
|
||||
#include "util_posix.h"
|
||||
|
||||
extern unsigned char return_on_error;
|
||||
extern unsigned char error_occured;
|
|
@ -75,7 +75,6 @@ PLATFORM_DEFS += \
|
|||
# !! Choose only one !!
|
||||
PLATFORM_DEFS += -DWITH_STANDALONE_LF_SAMYRUN
|
||||
#PLATFORM_DEFS += -DWITH_STANDALONE_LF_ICERUN
|
||||
#PLATFORM_DEFS += -DWITH_STANDALONE_LF_SAMYRUN
|
||||
#PLATFORM_DEFS += -DWITH_STANDALONE_LF_PROXBRUTE
|
||||
#PLATFORM_DEFS += -DWITH_STANDALONE_LF_HIDBRUTE
|
||||
#PLATFORM_DEFS += -DWITH_STANDALONE_HF_YOUNG
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue