proxmark3/armsrc/Standalone
Philippe Teuwen ee8b9ca74b make style
2024-08-03 21:21:11 +02:00
..
dankarmulti.c Adapting license headers, WIP 2022-01-06 02:20:38 +01:00
dankarmulti.h use ARRAYLEN 2022-01-09 14:25:10 +01:00
hf_14asniff.c standalone doc 2023-09-08 20:45:44 +02:00
hf_14bsniff.c standalone doc 2023-09-08 20:45:44 +02:00
hf_15sim.c style 2024-02-18 20:14:32 +01:00
hf_15sniff.c standalone doc 2023-09-08 20:45:44 +02:00
hf_aveful.c text 2023-12-06 22:16:53 +01:00
hf_bog.c style 2022-01-06 19:41:45 +01:00
hf_cardhopper.c style 2024-01-16 11:53:42 +01:00
hf_colin.c rmeoved some fct devices side regarding eml get/ set 2023-07-27 18:55:41 +02:00
hf_colin.h Adapting license headers, WIP 2022-01-06 02:20:38 +01:00
hf_craftbyte.c text 2023-12-06 22:16:53 +01:00
hf_iceclass.c Remove compilation error. 2023-10-17 19:33:59 +02:00
hf_legic.c style 2022-01-06 19:41:45 +01:00
hf_legicsim.c improved the eload upload times by using large chunks. Quite much faster now.\nAddapted the dots and text for eload / sim across the client 2023-07-26 23:39:27 +02:00
hf_mattyrun.c make style 2024-08-03 21:21:11 +02:00
hf_mattyrun.h make style 2024-08-03 21:21:11 +02:00
hf_mfcsim.c improved the eload upload times by using large chunks. Quite much faster now.\nAddapted the dots and text for eload / sim across the client 2023-07-26 23:39:27 +02:00
hf_msdsal.c text 2024-01-05 19:27:38 +01:00
hf_reblay.c text 2024-01-05 19:27:38 +01:00
hf_tcprst.c text 2024-01-05 19:27:38 +01:00
hf_tmudford.c style 2024-01-25 01:55:07 +01:00
hf_unisniff.c style 2024-03-14 11:26:06 +01:00
hf_young.c fix hf 14a sim, on device side a sneaky detection if data started with zero, it would treat it as uid is in emulator memory. Also fixed a size issue on flag 2022-01-22 18:29:11 +01:00
lf_em4100emul.c style 2024-07-21 16:19:21 +02:00
lf_em4100rswb.c style 2024-02-16 21:59:45 +01:00
lf_em4100rsww.c style 2024-02-16 21:59:45 +01:00
lf_em4100rwc.c style 2024-02-16 21:59:45 +01:00
lf_hidbrute.c Adapting license headers, WIP 2022-01-06 02:20:38 +01:00
lf_hidbrute.h Adapting license headers, WIP 2022-01-06 02:20:38 +01:00
lf_hidfcbrute.c Adapting license headers, WIP 2022-01-06 02:20:38 +01:00
lf_hidfcbrute.h Adapting license headers, WIP 2022-01-06 02:20:38 +01:00
lf_icehid.c Adapting license headers, WIP 2022-01-06 02:20:38 +01:00
lf_multihid.c Create lf_multihid.c 2023-05-04 21:34:27 +10:00
lf_nedap_sim.c make miscchecks 2023-01-14 22:23:40 +01:00
lf_nexid.c cppcheck fixes for const 2022-01-06 15:22:36 +01:00
lf_prox2brute.c scope, const 2024-05-14 14:37:08 +02:00
lf_proxbrute.c Adapting license headers, WIP 2022-01-06 02:20:38 +01:00
lf_samyrun.c Adapting license headers, WIP 2022-01-06 02:20:38 +01:00
lf_skeleton.c Adapting license headers, WIP 2022-01-06 02:20:38 +01:00
lf_tharexde.c Adapting license headers, WIP 2022-01-06 02:20:38 +01:00
Makefile.hal iso15sim rework: add support for lot of commands 2024-01-24 13:59:12 +01:00
Makefile.inc iso15sim rework: add support for lot of commands 2024-01-24 13:59:12 +01:00
placeholder.c Adapting license headers, WIP 2022-01-06 02:20:38 +01:00
readme.md standalone: respect alphabetical order, else it's a mess to cross-check 2023-01-24 15:34:13 +01:00
standalone.h Adapting license headers, WIP 2022-01-06 02:20:38 +01:00

Standalone Modes

Table of Contents

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. Have a look at the skeleton standalone mode, in the file lf_skeleton.c.

As it is now, you can only have one standalone mode installed at the time unless you use the dankarmulti mode (see dankarmulti.c on how to use it).

To avoid clashes between standalone modes, protect all your static variables with a specific namespace. See how it is done in the existing standalone modes.

Implementing a standalone mode

^Top

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.

void ModInfo(void) {
    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
    for (;;) {
        WDT_HIT();

        // exit from standalone mode, just send a usbcommand
        if (data_available()) break;

        // do your standalone stuff..
    }

Naming your standalone mode

^Top

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 MAKEFILE.HAL

^Top

Add your mode to the Makefile.hal help and modes list (alphabetically):

+==========================================================+
| STANDALONE      | DESCRIPTION                            |
+==========================================================+
...
+----------------------------------------------------------+
| LF_FOO          | My foobar mode will make you coffee    |
+----------------------------------------------------------+

STANDALONE_MODES := LF_... LF_FOO
STANDALONE_MODES += HF_...

If your mode is using one of the unique features of the RDV4, add it to the proper list:

STANDALONE_MODES_REQ_SMARTCARD :=
STANDALONE_MODES_REQ_FLASH :=
STANDALONE_MODES_REQ_BT :=

Please respect alphabetic order!

Update MAKEFILE.INC

^Top

Add your source code files like the following sample in the Makefile.inc

# WITH_STANDALONE_LF_SKELETON
ifneq (,$(findstring WITH_STANDALONE_LF_SKELETON,$(APP_CFLAGS)))
    SRC_STANDALONE = lf_skeleton.c
endif

# WITH_STANDALONE_LF_FOO
ifneq (,$(findstring WITH_STANDALONE_LF_FOO,$(APP_CFLAGS)))
    SRC_STANDALONE = lf_foo.c
endif

Please respect alphabetic order!

Adding identification string of your mode

^Top

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 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

^Top

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
  • edit the "STANDALONE" row inside Makefile.platform. You need to uncomment it and add your standalone mode name

Makefile.platform.sample

# If you want to use it, copy this file as Makefile.platform and adjust it to your needs
PLATFORM=PM3RDV4
#PLATFORM_EXTRAS=BTADDON
#STANDALONE=LF_SAMYRUN

becomes

Makefile.platform

# If you want to use it, copy this file as Makefile.platform and adjust it to your needs
PLATFORM=PM3RDV4
#PLATFORM_EXTRAS=BTADDON
STANDALONE=LF_FOO

Remember only one can be selected at a time for now.

The final steps is to

  • force recompilation of all code. make clean
  • compile make -j
  • flash your device
  • connect to your device
  • press button long time to trigger ledshow and enter your new standalone mode
  • if connected with usb / fpc , you can also see debug statements from your device in standalone mode. Useful for debugging :)

When compiling you will see a header showing what configurations your project compiled with. Make sure it says your standalone mode name.

Submitting your code

^Top

Once you're ready to share your mode, please

  • add a line in CHANGELOG.md
  • add your mode in the modes table in doc/md/Use_of_Proxmark/4_Advanced-compilation-parameters.md
  • add your mode in tools/build_all_firmwares.sh such that it reflects armsrc/Standalone/Makefile.hal list of firmwares to build.

Please respect alphabetic order of standalone modes everywhere!

Then submit your PR.

Once approved, add also your mode in https://github.com/RfidResearchGroup/proxmark3/wiki/Standalone-mode

Happy hacking!