1 //-----------------------------------------------------------------------------
2 // Copyright (C) 2021 Tim Mudford <tim.mudford1@gmail.com>
3 // Copyright (C) Proxmark3 contributors. See AUTHORS.md for details.
5 // This program is free software: you can redistribute it and/or modify
6 // it under the terms of the GNU General Public License as published by
7 // the Free Software Foundation, either version 3 of the License, or
8 // (at your option) any later version.
10 // This program is distributed in the hope that it will be useful,
11 // but WITHOUT ANY WARRANTY; without even the implied warranty of
12 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 // GNU General Public License for more details.
15 // See LICENSE.txt for the text of the license.
16 //-----------------------------------------------------------------------------
17 // main code for hf_tmudford
18 // `hf_tmudford` Continuously scans for ISO15693 card UID and then emulates it.
19 //-----------------------------------------------------------------------------
21 #include "standalone.h"
22 #include "proxmark3_arm.h"
24 #include "fpgaloader.h"
36 DbpString("HF TMUDFORD mode - Scans and emulates ISO15693 UID (Tim Mudford)");
41 Dbprintf(_YELLOW_("HF TMUDFORD mode started"));
42 FpgaDownloadAndGo(FPGA_BITSTREAM_HF
);
46 if (data_available()) break;
50 // 0 = search, 1 = read, 2 = emul
51 int state
= STATE_READ
;
52 iso15_card_select_t card
;
54 DbpString("Scanning...");
55 int button_pressed
= BUTTON_NO_CLICK
;
57 // Was our button held down or pressed?
58 button_pressed
= BUTTON_HELD(1000);
60 if (button_pressed
!= BUTTON_NO_CLICK
|| data_available())
62 else if (state
== STATE_READ
) {
64 ReaderIso15693(&card
);
66 if (card
.uidlen
== 0) {
71 Dbprintf("Found card with UID: ");
72 Dbhexdump(card
.uidlen
, card
.uid
, 0);
75 } else if (state
== STATE_EMUL
) {
77 Dbprintf("Starting simulation, press " _GREEN_("pm3 button") " to stop and go back to search state.");
78 // default block size is 4..
79 // iceman: which can be 4,8 all the way to 32
80 SimTagIso15693(card
.uid
, 4);
85 if (button_pressed
== BUTTON_HOLD
)
89 Dbprintf("-=[ exit ]=-");