2010-02-21 08:47:22 +08:00
|
|
|
#-----------------------------------------------------------------------------
|
|
|
|
# This code is licensed to you under the terms of the GNU GPL, version 2 or,
|
|
|
|
# at your option, any later version. See the LICENSE.txt file for the text of
|
|
|
|
# the license.
|
|
|
|
#-----------------------------------------------------------------------------
|
2010-05-09 20:17:42 +08:00
|
|
|
|
2018-02-04 05:58:43 +08:00
|
|
|
# reveng will compile without macros, but these may be useful:
|
|
|
|
# Add -DBMPMACRO to use bitmap size constant macros (edit config.h)
|
|
|
|
# Add -DNOFORCE to disable the -F switch
|
|
|
|
# Add -DPRESETS to compile with preset models (edit config.h)
|
|
|
|
|
2019-08-31 04:10:06 +08:00
|
|
|
# Must be called before any Makefile include
|
|
|
|
ROOT_DIR:=$(dir $(realpath $(lastword $(MAKEFILE_LIST))))
|
|
|
|
|
|
|
|
include ../Makefile.defs
|
2019-06-02 06:25:25 +08:00
|
|
|
|
2019-09-09 07:07:46 +08:00
|
|
|
INSTALLBIN = proxmark3
|
2019-09-05 05:28:02 +08:00
|
|
|
INSTALLSHARE = cmdscripts lualibs luascripts resources dictionaries
|
2019-08-31 03:55:13 +08:00
|
|
|
|
2019-08-17 04:50:03 +08:00
|
|
|
VPATH = ../common uart
|
2019-08-23 04:16:33 +08:00
|
|
|
vpath %.dic dictionaries
|
2010-02-21 08:16:42 +08:00
|
|
|
OBJDIR = obj
|
Client cleanup and restructuring. Stage 1...
Next Step is refactoring some of the giant functions which are
just copy/paste of some other ones with just a few line changes,
removing unnecessary 'goto' etc.
The MS Windows version is broken with this commit but will be fixed
soon. Everything can't be done all at once :P
The commands are now hierarchical, for example:
"hf 14a read" vs. "hf 14b read".
You can also request help:
"hf help", "data help", "hf 15 help" etc.
Indents are now space-based, not tab-based anymore. Hopefully
no one will be trolling about it, considering the suicide-prone work
being done here ;)
client/cmdhw.c, client/proxusb.c, client/cmdhw.h, client/proxusb.h,
client/cmdmain.c, client/cmdlfhid.c, client/cmdmain.h, client/cmdlfhid.h,
client/data.c, client/data.h, client/cmdhf.c, client/cmdlf.c,
client/cmdhf.h, client/cmdhf15.c, client/cmdhf14b.c, client/cmdlf.h,
client/cmdhf15.h, client/cmdhf14b.h, client/cmddata.c, client/cmddata.h,
client/ui.c, client/cmdparser.c, client/cmdlfti.c, client/ui.h,
client/cmdlfem4x.c, client/cmdparser.h, client/cmdlfti.h, client/cmdlfem4x.h,
client/graph.c, client/graph.h, client/cmdhf14a.c, client/cmdhf14a.h,
client/cmdhflegic.c, client/cmdhflegic.c: New files.
client/cli.c, client/flasher.c, client/snooper.c, client/proxmark3.c,
client/proxmark3.h, client/Makefile: Update accordingly.
client/flash.h, client/flash.c, client/proxgui.cpp: Cosmetic changes.
client/translate.h, client/command.c, client/gui.c,
client/usb.c, client/prox.h: Remove.
include/usb_cmd.h (CMD_ACQUIRE_RAW_ADC_SAMPLES_ISO_14443_SIM): Remove dead cmd.
common/crc16.h: New file.
common/crc16.c: Modify accordingly.
common/iso14443crc.h: New file.
common/iso14443_crc.c: Rename to
common/iso14443crc.c: and modify accordingly.
armsrc/lfops.c, armsrc/iso14443.c,
armsrc/iso14443a.c: include .h files from
the common directory instead of including the c files.
common/Makefile.common, armsrc/Makefile: Modify accordingly.
2010-02-04 09:27:07 +08:00
|
|
|
|
2019-08-17 04:49:34 +08:00
|
|
|
LDLIBS ?= -L/usr/local/lib
|
2020-01-13 20:49:32 +08:00
|
|
|
LDLIBS += -lreadline -lpthread -lm
|
2019-07-11 00:43:19 +08:00
|
|
|
|
2019-07-06 16:06:04 +08:00
|
|
|
# RPi Zero gcc requires -latomic
|
|
|
|
# but MacOSX /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld
|
|
|
|
# doesn't recognize option --as-needed
|
|
|
|
ifneq ($(platform),Darwin)
|
|
|
|
LDLIBS += -Wl,--as-needed -latomic -Wl,--no-as-needed
|
|
|
|
endif
|
|
|
|
|
2019-08-18 06:09:42 +08:00
|
|
|
# local libraries
|
2019-08-08 22:57:33 +08:00
|
|
|
LUALIBPATH = ./liblua
|
|
|
|
LUALIB = $(LUALIBPATH)/liblua.a
|
2018-11-12 21:00:35 +08:00
|
|
|
JANSSONLIBPATH = ./jansson
|
|
|
|
JANSSONLIB = $(JANSSONLIBPATH)/libjansson.a
|
2018-11-16 23:06:13 +08:00
|
|
|
CBORLIBPATH = ./tinycbor
|
2018-11-17 00:33:10 +08:00
|
|
|
CBORLIB = $(CBORLIBPATH)/tinycbor.a
|
2019-08-17 03:33:01 +08:00
|
|
|
REVENGPATH = ./reveng
|
|
|
|
REVENGLIB = $(REVENGPATH)/libreveng.a
|
2019-09-03 06:18:29 +08:00
|
|
|
AMIIBOLIBPATH = ./amiitool
|
|
|
|
AMIIBOLIB = $(AMIIBOLIBPATH)/libamiibo.a
|
2019-08-18 06:09:42 +08:00
|
|
|
|
|
|
|
# common libraries
|
|
|
|
MBEDTLSLIBPATH = ../common/mbedtls
|
|
|
|
MBEDTLSLIB = $(OBJDIR)/libmbedtls.a
|
|
|
|
ZLIBPATH = ../common/zlib
|
|
|
|
ZLIB = $(OBJDIR)/libz.a
|
|
|
|
|
2019-09-03 06:18:29 +08:00
|
|
|
LIBS = -I$(LUALIBPATH) -I$(MBEDTLSLIBPATH) -I$(JANSSONLIBPATH) -I$(CBORLIBPATH) -I$(ZLIBPATH) -I$(REVENGPATH) -I$(AMIIBOLIBPATH)
|
2019-08-17 04:49:34 +08:00
|
|
|
INCLUDES_CLIENT = -I. -I../include -I../common -Iuart $(LIBS)
|
|
|
|
CFLAGS ?= -Wall -Werror -g -O3
|
|
|
|
# We cannot just use CFLAGS+=... because it has impact on sub-makes if CFLAGS is defined in env:
|
2019-08-17 03:33:01 +08:00
|
|
|
PM3CFLAGS = $(CFLAGS) -std=c99 -D_ISOC99_SOURCE $(INCLUDES_CLIENT)
|
2019-08-31 03:36:10 +08:00
|
|
|
PREFIX ?= /usr/local
|
2019-05-06 21:37:40 +08:00
|
|
|
ifneq (,$(findstring MINGW,$(platform)))
|
2019-08-28 06:03:27 +08:00
|
|
|
PM3CFLAGS += -mno-ms-bitfields -fexec-charset=cp850
|
2019-05-06 21:37:40 +08:00
|
|
|
endif
|
2019-08-17 04:49:34 +08:00
|
|
|
CXXFLAGS ?= -Wall -Werror -O3
|
|
|
|
PM3CXXFLAGS = $(CXXFLAGS) -I../include
|
2015-03-11 02:00:39 +08:00
|
|
|
|
2017-07-28 02:59:54 +08:00
|
|
|
LUAPLATFORM = generic
|
2019-03-10 18:35:03 +08:00
|
|
|
ifneq (,$(findstring MINGW,$(platform)))
|
2015-03-11 02:00:39 +08:00
|
|
|
LUAPLATFORM = mingw
|
2018-10-06 19:29:20 +08:00
|
|
|
else
|
2019-05-07 02:45:59 +08:00
|
|
|
ifeq ($(platform),Darwin)
|
2015-03-11 02:00:39 +08:00
|
|
|
LUAPLATFORM = macosx
|
2019-05-07 02:45:59 +08:00
|
|
|
OBJCSRCS = util_darwin.m
|
|
|
|
LDFLAGS += -framework Foundation -framework AppKit
|
2019-05-10 18:24:38 +08:00
|
|
|
LDLIBS := -L/usr/local/opt/readline/lib $(LDLIBS)
|
|
|
|
LIBS := -I/usr/local/opt/readline/include $(LIBS)
|
2010-02-25 03:33:29 +08:00
|
|
|
else
|
2015-06-25 18:22:34 +08:00
|
|
|
LUALIB += -ldl
|
2015-03-11 02:00:39 +08:00
|
|
|
LUAPLATFORM = linux
|
2010-02-21 09:07:11 +08:00
|
|
|
endif
|
2017-07-28 02:59:54 +08:00
|
|
|
endif
|
|
|
|
|
2019-10-10 01:28:37 +08:00
|
|
|
ifneq ($(SKIPQT),1)
|
|
|
|
# Check for correctly configured Qt5
|
|
|
|
QTINCLUDES = $(shell pkg-config --cflags Qt5Core Qt5Widgets 2>/dev/null)
|
|
|
|
QTLDLIBS = $(shell pkg-config --libs Qt5Core Qt5Widgets 2>/dev/null)
|
|
|
|
MOC = $(shell pkg-config --variable=host_bins Qt5Core)/moc
|
|
|
|
UIC = $(shell pkg-config --variable=host_bins Qt5Core)/uic
|
|
|
|
ifeq ($(QTINCLUDES), )
|
|
|
|
# if Qt5 not found check for correctly configured Qt4
|
|
|
|
QTINCLUDES = $(shell pkg-config --cflags QtCore QtGui 2>/dev/null)
|
|
|
|
QTLDLIBS = $(shell pkg-config --libs QtCore QtGui 2>/dev/null)
|
|
|
|
MOC = $(shell pkg-config --variable=moc_location QtCore)
|
|
|
|
UIC = $(shell pkg-config --variable=uic_location QtCore)
|
|
|
|
else
|
|
|
|
PM3CXXFLAGS += -std=c++11 -fPIC
|
|
|
|
endif
|
|
|
|
ifeq ($(QTINCLUDES), )
|
|
|
|
# if both pkg-config commands failed, search in common places
|
|
|
|
ifneq ($(QTDIR), )
|
|
|
|
QTINCLUDES = -I$(QTDIR)/include -I$(QTDIR)/include/QtCore -I$(QTDIR)/include/QtGui
|
|
|
|
QTLDLIBS = -L$(QTDIR)/lib -lQtCore4 -lQtGui4
|
|
|
|
ifneq ($(wildcard $(QTDIR)/include/QtWidgets),)
|
|
|
|
QTINCLUDES += -I$(QTDIR)/include/QtWidgets
|
|
|
|
QTLDLIBS = -L$(QTDIR)/lib -lQt5Widgets -lQt5Gui -lQt5Core
|
|
|
|
PM3CXXFLAGS += -std=c++11 -fPIC
|
|
|
|
endif
|
|
|
|
MOC = $(QTDIR)/bin/moc
|
|
|
|
UIC = $(QTDIR)/bin/uic
|
2019-05-07 02:45:59 +08:00
|
|
|
endif
|
|
|
|
endif
|
2017-07-28 02:59:54 +08:00
|
|
|
endif
|
|
|
|
|
2011-09-05 19:48:08 +08:00
|
|
|
ifneq ($(QTLDLIBS),)
|
2019-10-16 21:37:39 +08:00
|
|
|
QTGUISRCS = proxgui.cpp proxguiqt.cpp proxguiqt.moc.cpp
|
2017-07-28 02:59:54 +08:00
|
|
|
QTGUIOBJS = $(OBJDIR)/proxgui.o $(OBJDIR)/proxguiqt.o $(OBJDIR)/proxguiqt.moc.o
|
2019-08-17 04:49:34 +08:00
|
|
|
PM3CFLAGS += -DHAVE_GUI
|
2011-09-05 19:48:08 +08:00
|
|
|
else
|
2019-10-16 21:37:39 +08:00
|
|
|
QTGUISRCS = guidummy.cpp
|
2017-07-28 02:59:54 +08:00
|
|
|
QTGUIOBJS = $(OBJDIR)/guidummy.o
|
2011-09-05 19:48:08 +08:00
|
|
|
endif
|
2010-02-21 09:07:11 +08:00
|
|
|
|
2017-07-28 02:59:54 +08:00
|
|
|
# Flags to generate temporary dependency files
|
|
|
|
DEPFLAGS = -MT $@ -MMD -MP -MF $(OBJDIR)/$*.Td
|
2019-08-08 22:57:33 +08:00
|
|
|
# make temporary to final dependency files after successful compilation
|
2019-08-23 03:05:45 +08:00
|
|
|
POSTCOMPILE = $(MV) -f $(OBJDIR)/$*.Td $(OBJDIR)/$*.d && $(TOUCH) $@
|
2017-07-28 02:59:54 +08:00
|
|
|
|
|
|
|
CORESRCS = uart_posix.c \
|
2019-05-07 02:45:59 +08:00
|
|
|
uart_win32.c \
|
|
|
|
ui.c \
|
|
|
|
commonutil.c \
|
|
|
|
util.c \
|
|
|
|
util_posix.c \
|
|
|
|
scandir.c \
|
|
|
|
crc16.c \
|
2020-03-11 00:10:05 +08:00
|
|
|
comms.c
|
2017-07-30 15:17:48 +08:00
|
|
|
|
2019-08-01 21:39:33 +08:00
|
|
|
CMDSRCS = crapto1/crapto1.c \
|
2019-05-07 02:45:59 +08:00
|
|
|
crapto1/crypto1.c \
|
2019-11-28 06:49:12 +08:00
|
|
|
mifare/mifaredefault.c \
|
2019-05-07 02:45:59 +08:00
|
|
|
mifare/mfkey.c \
|
|
|
|
tea.c \
|
|
|
|
fido/additional_ca.c \
|
|
|
|
fido/cose.c \
|
|
|
|
fido/cbortools.c \
|
|
|
|
fido/fidocore.c \
|
|
|
|
crypto/asn1dump.c \
|
|
|
|
crypto/libpcrypto.c\
|
|
|
|
crypto/asn1utils.c\
|
|
|
|
cliparser/argtable3.c\
|
|
|
|
cliparser/cliparser.c\
|
|
|
|
loclass/cipher.c \
|
|
|
|
loclass/cipherutils.c \
|
|
|
|
loclass/ikeys.c \
|
|
|
|
loclass/elite_crack.c \
|
2019-08-21 20:41:33 +08:00
|
|
|
fileutils.c \
|
2019-05-07 02:45:59 +08:00
|
|
|
whereami.c \
|
|
|
|
mifare/mifarehost.c \
|
|
|
|
parity.c \
|
|
|
|
crc.c \
|
|
|
|
crc64.c \
|
|
|
|
legic_prng.c \
|
|
|
|
iso15693tools.c \
|
|
|
|
prng.c \
|
2020-01-02 22:29:15 +08:00
|
|
|
generator.c \
|
2019-05-07 02:45:59 +08:00
|
|
|
graph.c \
|
|
|
|
cmddata.c \
|
|
|
|
lfdemod.c \
|
|
|
|
emv/crypto_polarssl.c\
|
|
|
|
emv/crypto.c\
|
|
|
|
emv/emv_pk.c\
|
|
|
|
emv/emv_pki.c\
|
|
|
|
emv/emv_pki_priv.c\
|
|
|
|
emv/test/cryptotest.c\
|
|
|
|
emv/apduinfo.c \
|
|
|
|
emv/dump.c \
|
|
|
|
emv/tlv.c \
|
|
|
|
emv/emv_tags.c \
|
|
|
|
emv/dol.c \
|
|
|
|
emv/emvjson.c\
|
|
|
|
emv/emvcore.c \
|
|
|
|
emv/test/crypto_test.c\
|
|
|
|
emv/test/sda_test.c\
|
|
|
|
emv/test/dda_test.c\
|
|
|
|
emv/test/cda_test.c\
|
|
|
|
emv/cmdemv.c \
|
|
|
|
emv/emv_roca.c \
|
2019-02-22 01:15:46 +08:00
|
|
|
mifare/mifare4.c \
|
2019-02-22 01:34:12 +08:00
|
|
|
mifare/mad.c \
|
2019-03-05 06:11:31 +08:00
|
|
|
mifare/ndef.c \
|
2019-05-07 02:45:59 +08:00
|
|
|
cmdanalyse.c \
|
|
|
|
cmdhf.c \
|
|
|
|
cmdhflist.c \
|
2019-11-05 01:54:23 +08:00
|
|
|
aidsearch.c \
|
2019-05-07 02:45:59 +08:00
|
|
|
cmdhf14a.c \
|
|
|
|
cmdhf14b.c \
|
|
|
|
cmdhf15.c \
|
|
|
|
cmdhfepa.c \
|
|
|
|
cmdhflegic.c \
|
|
|
|
cmdhficlass.c \
|
|
|
|
cmdhfmf.c \
|
2015-01-21 04:23:04 +08:00
|
|
|
cmdhfmfu.c \
|
2018-10-24 23:18:05 +08:00
|
|
|
cmdhfmfp.c \
|
2019-05-07 02:45:59 +08:00
|
|
|
cmdhfmfhard.c \
|
2017-07-28 02:59:54 +08:00
|
|
|
hardnested/hardnested_bruteforce.c \
|
2019-05-07 02:45:59 +08:00
|
|
|
cmdhfmfdes.c \
|
|
|
|
cmdhftopaz.c \
|
|
|
|
cmdhffido.c \
|
|
|
|
cmdhffelica.c \
|
2019-08-01 21:39:33 +08:00
|
|
|
cmdhfthinfilm.c \
|
2020-04-06 12:17:05 +08:00
|
|
|
cmdhfcryptorf.c \
|
2019-12-22 18:16:59 +08:00
|
|
|
cmdhflto.c \
|
2019-05-07 02:45:59 +08:00
|
|
|
cmdhw.c \
|
|
|
|
cmdlf.c \
|
|
|
|
cmdlfawid.c \
|
|
|
|
cmdlfcotag.c \
|
|
|
|
cmdlfem4x.c \
|
|
|
|
cmdlffdx.c \
|
|
|
|
cmdlfguard.c \
|
2019-10-09 03:45:40 +08:00
|
|
|
cmdlfgallagher.c \
|
2019-05-07 02:45:59 +08:00
|
|
|
cmdlfhid.c \
|
|
|
|
cmdlfhitag.c \
|
|
|
|
cmdlfio.c \
|
|
|
|
cmdlfindala.c \
|
|
|
|
cmdlfjablotron.c \
|
|
|
|
cmdlfkeri.c \
|
|
|
|
cmdlfnexwatch.c \
|
|
|
|
cmdlfnedap.c \
|
|
|
|
cmdlfnoralsy.c \
|
|
|
|
cmdlfpac.c \
|
|
|
|
cmdlfparadox.c \
|
|
|
|
cmdlfpcf7931.c \
|
|
|
|
cmdlfpresco.c \
|
|
|
|
cmdlfpyramid.c \
|
|
|
|
cmdlfsecurakey.c \
|
|
|
|
cmdlft55xx.c \
|
|
|
|
cmdlfti.c \
|
|
|
|
cmdlfviking.c \
|
|
|
|
cmdlfvisa2000.c \
|
2019-10-12 05:13:52 +08:00
|
|
|
cmdlfmotorola.c \
|
2019-05-07 02:45:59 +08:00
|
|
|
cmdtrace.c \
|
|
|
|
cmdflashmem.c \
|
2019-07-23 04:56:06 +08:00
|
|
|
cmdflashmemspiffs.c \
|
2019-05-07 02:45:59 +08:00
|
|
|
cmdsmartcard.c \
|
|
|
|
cmdusart.c \
|
2019-09-19 01:42:59 +08:00
|
|
|
cmdwiegand.c \
|
2019-05-07 02:45:59 +08:00
|
|
|
cmdparser.c \
|
|
|
|
cmdmain.c \
|
|
|
|
pm3_binlib.c \
|
|
|
|
scripting.c \
|
|
|
|
cmdscript.c \
|
|
|
|
pm3_bitlib.c \
|
|
|
|
cmdcrc.c \
|
2019-09-09 07:07:46 +08:00
|
|
|
bucketsort.c \
|
2019-09-19 01:42:59 +08:00
|
|
|
flash.c \
|
|
|
|
wiegand_formats.c \
|
2020-02-27 23:35:17 +08:00
|
|
|
wiegand_formatutils.c \
|
2020-04-05 18:36:39 +08:00
|
|
|
cardhelper.c \
|
|
|
|
settings.c
|
2016-07-29 02:42:46 +08:00
|
|
|
|
2017-07-28 02:59:54 +08:00
|
|
|
cpu_arch = $(shell uname -m)
|
|
|
|
ifneq ($(findstring 86, $(cpu_arch)), )
|
2019-05-07 02:45:59 +08:00
|
|
|
MULTIARCHSRCS = hardnested/hardnested_bf_core.c hardnested/hardnested_bitarray_core.c
|
2017-07-28 02:59:54 +08:00
|
|
|
endif
|
2017-08-16 20:15:16 +08:00
|
|
|
ifneq ($(findstring amd64, $(cpu_arch)), )
|
2019-05-07 02:45:59 +08:00
|
|
|
MULTIARCHSRCS = hardnested/hardnested_bf_core.c hardnested/hardnested_bitarray_core.c
|
2017-07-28 02:59:54 +08:00
|
|
|
endif
|
|
|
|
ifeq ($(MULTIARCHSRCS), )
|
2019-05-07 02:45:59 +08:00
|
|
|
CMDSRCS += hardnested/hardnested_bf_core.c hardnested/hardnested_bitarray_core.c
|
2017-07-28 02:59:54 +08:00
|
|
|
endif
|
2019-03-10 18:35:03 +08:00
|
|
|
|
2017-07-28 02:59:54 +08:00
|
|
|
|
2013-03-14 23:03:04 +08:00
|
|
|
COREOBJS = $(CORESRCS:%.c=$(OBJDIR)/%.o)
|
2010-02-21 08:16:42 +08:00
|
|
|
CMDOBJS = $(CMDSRCS:%.c=$(OBJDIR)/%.o)
|
2018-10-06 19:29:20 +08:00
|
|
|
OBJCOBJS = $(OBJCSRCS:%.m=$(OBJDIR)/%.o)
|
2017-07-28 02:59:54 +08:00
|
|
|
MULTIARCHOBJS = $(MULTIARCHSRCS:%.c=$(OBJDIR)/%_NOSIMD.o) \
|
2019-05-07 02:45:59 +08:00
|
|
|
$(MULTIARCHSRCS:%.c=$(OBJDIR)/%_MMX.o) \
|
|
|
|
$(MULTIARCHSRCS:%.c=$(OBJDIR)/%_SSE2.o) \
|
|
|
|
$(MULTIARCHSRCS:%.c=$(OBJDIR)/%_AVX.o) \
|
|
|
|
$(MULTIARCHSRCS:%.c=$(OBJDIR)/%_AVX2.o)
|
Client cleanup and restructuring. Stage 1...
Next Step is refactoring some of the giant functions which are
just copy/paste of some other ones with just a few line changes,
removing unnecessary 'goto' etc.
The MS Windows version is broken with this commit but will be fixed
soon. Everything can't be done all at once :P
The commands are now hierarchical, for example:
"hf 14a read" vs. "hf 14b read".
You can also request help:
"hf help", "data help", "hf 15 help" etc.
Indents are now space-based, not tab-based anymore. Hopefully
no one will be trolling about it, considering the suicide-prone work
being done here ;)
client/cmdhw.c, client/proxusb.c, client/cmdhw.h, client/proxusb.h,
client/cmdmain.c, client/cmdlfhid.c, client/cmdmain.h, client/cmdlfhid.h,
client/data.c, client/data.h, client/cmdhf.c, client/cmdlf.c,
client/cmdhf.h, client/cmdhf15.c, client/cmdhf14b.c, client/cmdlf.h,
client/cmdhf15.h, client/cmdhf14b.h, client/cmddata.c, client/cmddata.h,
client/ui.c, client/cmdparser.c, client/cmdlfti.c, client/ui.h,
client/cmdlfem4x.c, client/cmdparser.h, client/cmdlfti.h, client/cmdlfem4x.h,
client/graph.c, client/graph.h, client/cmdhf14a.c, client/cmdhf14a.h,
client/cmdhflegic.c, client/cmdhflegic.c: New files.
client/cli.c, client/flasher.c, client/snooper.c, client/proxmark3.c,
client/proxmark3.h, client/Makefile: Update accordingly.
client/flash.h, client/flash.c, client/proxgui.cpp: Cosmetic changes.
client/translate.h, client/command.c, client/gui.c,
client/usb.c, client/prox.h: Remove.
include/usb_cmd.h (CMD_ACQUIRE_RAW_ADC_SAMPLES_ISO_14443_SIM): Remove dead cmd.
common/crc16.h: New file.
common/crc16.c: Modify accordingly.
common/iso14443crc.h: New file.
common/iso14443_crc.c: Rename to
common/iso14443crc.c: and modify accordingly.
armsrc/lfops.c, armsrc/iso14443.c,
armsrc/iso14443a.c: include .h files from
the common directory instead of including the c files.
common/Makefile.common, armsrc/Makefile: Modify accordingly.
2010-02-04 09:27:07 +08:00
|
|
|
|
2017-12-07 00:15:24 +08:00
|
|
|
SUPPORTS_AVX512 := $(shell echo | gcc -E -mavx512f - > /dev/null 2>&1 && echo "True" )
|
2017-12-06 01:42:57 +08:00
|
|
|
|
2017-07-28 02:59:54 +08:00
|
|
|
HARD_SWITCH_NOSIMD = -mno-mmx -mno-sse2 -mno-avx -mno-avx2
|
|
|
|
HARD_SWITCH_MMX = -mmmx -mno-sse2 -mno-avx -mno-avx2
|
2018-01-07 01:52:28 +08:00
|
|
|
HARD_SWITCH_SSE2 = -mmmx -msse2 -mno-avx -mno-avx2
|
2017-07-28 02:59:54 +08:00
|
|
|
HARD_SWITCH_AVX = -mmmx -msse2 -mavx -mno-avx2
|
|
|
|
HARD_SWITCH_AVX2 = -mmmx -msse2 -mavx -mavx2
|
|
|
|
HARD_SWITCH_AVX512 = -mmmx -msse2 -mavx -mavx2 -mavx512f
|
2017-09-13 03:45:37 +08:00
|
|
|
ifeq "$(SUPPORTS_AVX512)" "True"
|
2019-05-07 02:45:59 +08:00
|
|
|
HARD_SWITCH_NOSIMD += -mno-avx512f
|
|
|
|
HARD_SWITCH_MMX += -mno-avx512f
|
|
|
|
HARD_SWITCH_SSE2 += -mno-avx512f
|
|
|
|
HARD_SWITCH_AVX += -mno-avx512f
|
|
|
|
HARD_SWITCH_AVX2 += -mno-avx512f
|
|
|
|
MULTIARCHOBJS += $(MULTIARCHSRCS:%.c=$(OBJDIR)/%_AVX512.o)
|
2017-07-28 02:59:54 +08:00
|
|
|
endif
|
2018-02-08 05:02:04 +08:00
|
|
|
|
2019-09-09 07:07:46 +08:00
|
|
|
BINS = proxmark3
|
2019-08-23 04:16:33 +08:00
|
|
|
CLEAN = $(BINS) *.moc.cpp ui/ui_overlays.h lualibs/pm3_cmd.lua lualibs/mfc_default_keys.lua
|
2019-08-31 03:57:43 +08:00
|
|
|
# transition: make sure old flasher is gone too
|
|
|
|
CLEAN += flasher
|
2009-12-22 20:52:02 +08:00
|
|
|
|
2017-07-28 02:59:54 +08:00
|
|
|
# need to assign dependancies to build these first...
|
2019-08-18 06:10:04 +08:00
|
|
|
all: $(BINS)
|
2009-04-09 14:43:20 +08:00
|
|
|
|
2009-09-11 10:25:48 +08:00
|
|
|
all-static: LDLIBS:=-static $(LDLIBS)
|
2019-08-09 20:41:44 +08:00
|
|
|
all-static: $(BINS)
|
2017-07-28 08:05:03 +08:00
|
|
|
|
2019-09-03 06:18:29 +08:00
|
|
|
proxmark3: LDLIBS+=$(LUALIB) $(JANSSONLIB) $(MBEDTLSLIB) $(CBORLIB) $(ZLIB) $(REVENGLIB) $(AMIIBOLIB) $(QTLDLIBS)
|
|
|
|
proxmark3: $(OBJDIR)/proxmark3.o $(COREOBJS) $(CMDOBJS) $(OBJCOBJS) $(QTGUIOBJS) $(MULTIARCHOBJS) $(LUALIB) $(JANSSONLIB) $(CBORLIB) $(REVENGLIB) $(MBEDTLSLIB) $(ZLIB) $(AMIIBOLIB) lualibs/pm3_cmd.lua lualibs/mfc_default_keys.lua
|
2019-06-02 06:25:25 +08:00
|
|
|
$(info [=] LD $@)
|
2019-08-17 03:33:01 +08:00
|
|
|
$(Q)$(LD) $(LDFLAGS) $(OBJDIR)/proxmark3.o $(COREOBJS) $(CMDOBJS) $(OBJCOBJS) $(QTGUIOBJS) $(MULTIARCHOBJS) $(LDLIBS) -o $@
|
2019-03-10 18:35:03 +08:00
|
|
|
|
2017-07-28 02:59:54 +08:00
|
|
|
proxgui.cpp: ui/ui_overlays.h
|
2009-06-29 06:13:04 +08:00
|
|
|
|
2009-04-09 14:43:20 +08:00
|
|
|
proxguiqt.moc.cpp: proxguiqt.h
|
2019-06-02 06:25:25 +08:00
|
|
|
$(info [-] MOC $@)
|
|
|
|
$(Q)$(MOC) -o$@ $^
|
2009-04-09 14:43:20 +08:00
|
|
|
|
2017-07-28 02:59:54 +08:00
|
|
|
ui/ui_overlays.h: ui/overlays.ui
|
2019-06-02 06:25:25 +08:00
|
|
|
$(info [-] UIC $@)
|
|
|
|
$(Q)$(UIC) $^ > $@
|
2017-07-28 02:59:54 +08:00
|
|
|
|
2019-05-01 03:10:11 +08:00
|
|
|
lualibs/pm3_cmd.lua: ../include/pm3_cmd.h
|
2019-06-02 06:25:25 +08:00
|
|
|
$(info [=] GEN $@)
|
|
|
|
$(Q)awk -f pm3_cmd_h2lua.awk $^ > $@
|
2017-07-28 08:45:58 +08:00
|
|
|
|
2019-08-23 04:16:33 +08:00
|
|
|
lualibs/mfc_default_keys.lua : mfc_default_keys.dic
|
2019-06-02 06:25:25 +08:00
|
|
|
$(info [=] GEN $@)
|
|
|
|
$(Q)awk -f default_keys_dic2lua.awk $^ > $@
|
2019-03-10 18:35:03 +08:00
|
|
|
|
2009-04-09 14:43:20 +08:00
|
|
|
clean:
|
2019-06-02 06:25:25 +08:00
|
|
|
$(Q)$(RM) $(CLEAN)
|
2019-08-18 06:09:42 +08:00
|
|
|
$(Q)$(RMDIR) $(OBJDIR)
|
2019-08-08 22:57:33 +08:00
|
|
|
$(Q)$(MAKE) --no-print-directory -C $(LUALIBPATH) clean
|
2019-06-02 06:25:25 +08:00
|
|
|
$(Q)$(MAKE) --no-print-directory -C $(JANSSONLIBPATH) clean
|
|
|
|
$(Q)$(MAKE) --no-print-directory -C $(CBORLIBPATH) clean
|
2019-08-17 03:33:01 +08:00
|
|
|
$(Q)$(MAKE) --no-print-directory -C $(REVENGPATH) clean
|
2019-09-03 06:18:29 +08:00
|
|
|
$(Q)$(MAKE) --no-print-directory -C $(AMIIBOLIBPATH) clean
|
2009-04-09 14:43:20 +08:00
|
|
|
|
2019-08-31 03:44:40 +08:00
|
|
|
install: all
|
2019-08-31 03:55:13 +08:00
|
|
|
$(info [@] Installing client to $(DESTDIR)$(PREFIX)...)
|
|
|
|
ifneq (,$(INSTALLBIN))
|
2019-09-06 05:20:46 +08:00
|
|
|
$(Q)$(MKDIR) $(DESTDIR)$(PREFIX)$(PATHSEP)$(INSTALLBINRELPATH)
|
|
|
|
$(Q)$(CP) $(INSTALLBIN) $(DESTDIR)$(PREFIX)$(PATHSEP)$(INSTALLBINRELPATH)
|
2019-08-31 03:55:13 +08:00
|
|
|
endif
|
|
|
|
ifneq (,$(INSTALLSHARE))
|
2019-09-06 05:20:46 +08:00
|
|
|
$(Q)$(MKDIR) $(DESTDIR)$(PREFIX)$(PATHSEP)$(INSTALLSHARERELPATH)
|
|
|
|
$(Q)$(CP) $(INSTALLSHARE) $(DESTDIR)$(PREFIX)$(PATHSEP)$(INSTALLSHARERELPATH)
|
2019-08-31 03:55:13 +08:00
|
|
|
endif
|
2019-08-31 03:44:40 +08:00
|
|
|
@true
|
|
|
|
|
|
|
|
uninstall:
|
2019-08-31 03:55:13 +08:00
|
|
|
$(info [@] Uninstalling client from $(DESTDIR)$(PREFIX)...)
|
|
|
|
ifneq (,$(INSTALLBIN))
|
2019-09-06 05:20:46 +08:00
|
|
|
$(Q)$(RM) $(foreach tool,$(INSTALLBIN),$(DESTDIR)$(PREFIX)$(PATHSEP)$(INSTALLBINRELPATH)$(PATHSEP)$(notdir $(tool)))
|
2019-08-31 03:55:13 +08:00
|
|
|
endif
|
|
|
|
ifneq (,$(INSTALLSHARE))
|
2019-09-06 05:20:46 +08:00
|
|
|
$(Q)$(RMDIR) $(foreach tool,$(INSTALLSHARE),$(DESTDIR)$(PREFIX)$(PATHSEP)$(INSTALLSHARERELPATH)$(PATHSEP)$(notdir $(tool)))
|
2019-08-31 03:55:13 +08:00
|
|
|
endif
|
2019-08-31 03:44:40 +08:00
|
|
|
@true
|
|
|
|
|
2010-05-09 20:17:42 +08:00
|
|
|
tarbin: $(BINS)
|
2019-06-02 06:25:25 +08:00
|
|
|
$(info [=] TAR ../proxmark3-$(platform)-bin.tar)
|
|
|
|
$(Q)$(TAR) $(TARFLAGS) ../proxmark3-$(platform)-bin.tar $(BINS:%=client/%) $(WINBINS:%=client/%)
|
2010-05-09 20:17:42 +08:00
|
|
|
|
2019-08-18 06:09:42 +08:00
|
|
|
# local libraries:
|
2019-08-18 06:10:04 +08:00
|
|
|
$(LUALIB):
|
2019-06-02 06:25:25 +08:00
|
|
|
$(info [*] MAKE liblua for $(LUAPLATFORM))
|
2019-08-08 22:57:33 +08:00
|
|
|
$(Q)$(MAKE) --no-print-directory -C $(LUALIBPATH) $(LUAPLATFORM)
|
2019-03-10 18:35:03 +08:00
|
|
|
|
2019-08-18 06:10:04 +08:00
|
|
|
$(JANSSONLIB):
|
2019-06-02 06:25:25 +08:00
|
|
|
$(info [*] MAKE jansson)
|
|
|
|
$(Q)$(MAKE) --no-print-directory -C $(JANSSONLIBPATH) all
|
2013-05-22 02:37:43 +08:00
|
|
|
|
2019-08-18 06:10:04 +08:00
|
|
|
$(CBORLIB):
|
2019-06-02 06:25:25 +08:00
|
|
|
$(info [*] MAKE tinycbor)
|
|
|
|
$(Q)$(MAKE) --no-print-directory -C $(CBORLIBPATH) all
|
2019-03-10 18:35:03 +08:00
|
|
|
|
2019-08-18 06:10:04 +08:00
|
|
|
$(REVENGLIB):
|
2019-08-17 03:33:01 +08:00
|
|
|
$(info [*] MAKE reveng)
|
|
|
|
$(Q)$(MAKE) --no-print-directory -C $(REVENGPATH) all
|
2019-08-15 03:52:20 +08:00
|
|
|
|
2019-09-03 06:18:29 +08:00
|
|
|
$(AMIIBOLIB):
|
|
|
|
$(info [*] MAKE amiibo)
|
|
|
|
$(Q)$(MAKE) --no-print-directory -C $(AMIIBOLIBPATH) all
|
|
|
|
|
2019-08-18 06:09:42 +08:00
|
|
|
# common libraries:
|
2019-08-18 06:10:04 +08:00
|
|
|
$(MBEDTLSLIB):
|
2019-08-18 06:09:42 +08:00
|
|
|
$(info [*] MAKE mbedtls)
|
|
|
|
$(Q)$(MAKE) --no-print-directory -C $(MBEDTLSLIBPATH) OBJDIR=$(ROOT_DIR)$(OBJDIR) BINDIR=$(ROOT_DIR)$(OBJDIR) all
|
|
|
|
|
2019-08-18 06:10:04 +08:00
|
|
|
$(ZLIB):
|
2019-08-18 06:09:42 +08:00
|
|
|
$(info [*] MAKE zlib)
|
|
|
|
$(Q)$(MAKE) --no-print-directory -C $(ZLIBPATH) OBJDIR=$(ROOT_DIR)$(OBJDIR) BINDIR=$(ROOT_DIR)$(OBJDIR) all
|
|
|
|
|
2019-08-31 03:44:40 +08:00
|
|
|
.PHONY: all clean install uninstall
|
2017-09-19 00:59:51 +08:00
|
|
|
|
|
|
|
# easy printing of MAKE VARIABLES
|
2019-03-10 18:35:03 +08:00
|
|
|
print-%: ; @echo $* = $($*)
|
2017-07-28 02:59:54 +08:00
|
|
|
|
2019-03-10 19:22:02 +08:00
|
|
|
$(OBJDIR)/%_NOSIMD.o : %.c $(OBJDIR)/%_NOSIMD.d
|
2019-06-02 06:25:25 +08:00
|
|
|
$(info [-] CC(NOSIMD) $<)
|
2019-08-18 06:09:42 +08:00
|
|
|
$(Q)$(MKDIR) $(dir $@)
|
2019-08-17 04:49:34 +08:00
|
|
|
$(Q)$(CC) $(DEPFLAGS:%.Td=%_NOSIMD.Td) $(PM3CFLAGS) $(HARD_SWITCH_NOSIMD) -c -o $@ $<
|
2019-08-23 03:05:45 +08:00
|
|
|
$(Q)$(MV) -f $(OBJDIR)/$*_NOSIMD.Td $(OBJDIR)/$*_NOSIMD.d && $(TOUCH) $@
|
2017-07-28 02:59:54 +08:00
|
|
|
|
2019-03-10 19:22:02 +08:00
|
|
|
$(OBJDIR)/%_MMX.o : %.c $(OBJDIR)/%_MMX.d
|
2019-06-02 06:25:25 +08:00
|
|
|
$(info [-] CC(MMX) $<)
|
2019-08-18 06:09:42 +08:00
|
|
|
$(Q)$(MKDIR) $(dir $@)
|
2019-08-17 04:49:34 +08:00
|
|
|
$(Q)$(CC) $(DEPFLAGS:%.Td=%_MMX.Td) $(PM3CFLAGS) $(HARD_SWITCH_MMX) -c -o $@ $<
|
2019-08-23 03:05:45 +08:00
|
|
|
$(Q)$(MV) -f $(OBJDIR)/$*_MMX.Td $(OBJDIR)/$*_MMX.d && $(TOUCH) $@
|
2017-07-28 02:59:54 +08:00
|
|
|
|
2019-03-10 19:22:02 +08:00
|
|
|
$(OBJDIR)/%_SSE2.o : %.c $(OBJDIR)/%_SSE2.d
|
2019-06-02 06:25:25 +08:00
|
|
|
$(info [-] CC(SSE2) $<)
|
2019-08-18 06:09:42 +08:00
|
|
|
$(Q)$(MKDIR) $(dir $@)
|
2019-08-17 04:49:34 +08:00
|
|
|
$(Q)$(CC) $(DEPFLAGS:%.Td=%_SSE2.Td) $(PM3CFLAGS) $(HARD_SWITCH_SSE2) -c -o $@ $<
|
2019-08-23 03:05:45 +08:00
|
|
|
$(Q)$(MV) -f $(OBJDIR)/$*_SSE2.Td $(OBJDIR)/$*_SSE2.d && $(TOUCH) $@
|
2017-07-28 02:59:54 +08:00
|
|
|
|
2019-03-10 19:22:02 +08:00
|
|
|
$(OBJDIR)/%_AVX.o : %.c $(OBJDIR)/%_AVX.d
|
2019-06-02 06:25:25 +08:00
|
|
|
$(info [-] CC(AVX) $<)
|
2019-08-18 06:09:42 +08:00
|
|
|
$(Q)$(MKDIR) $(dir $@)
|
2019-08-17 04:49:34 +08:00
|
|
|
$(Q)$(CC) $(DEPFLAGS:%.Td=%_AVX.Td) $(PM3CFLAGS) $(HARD_SWITCH_AVX) -c -o $@ $<
|
2019-08-23 03:05:45 +08:00
|
|
|
$(Q)$(MV) -f $(OBJDIR)/$*_AVX.Td $(OBJDIR)/$*_AVX.d && $(TOUCH) $@
|
2017-07-28 02:59:54 +08:00
|
|
|
|
2019-03-10 19:22:02 +08:00
|
|
|
$(OBJDIR)/%_AVX2.o : %.c $(OBJDIR)/%_AVX2.d
|
2019-06-02 06:25:25 +08:00
|
|
|
$(info [-] CC(AVX2) $<)
|
2019-08-18 06:09:42 +08:00
|
|
|
$(Q)$(MKDIR) $(dir $@)
|
2019-08-17 04:49:34 +08:00
|
|
|
$(Q)$(CC) $(DEPFLAGS:%.Td=%_AVX2.Td) $(PM3CFLAGS) $(HARD_SWITCH_AVX2) -c -o $@ $<
|
2019-08-23 03:05:45 +08:00
|
|
|
$(Q)$(MV) -f $(OBJDIR)/$*_AVX2.Td $(OBJDIR)/$*_AVX2.d && $(TOUCH) $@
|
2017-07-28 02:59:54 +08:00
|
|
|
|
2019-03-10 19:22:02 +08:00
|
|
|
$(OBJDIR)/%_AVX512.o : %.c $(OBJDIR)/%_AVX512.d
|
2019-06-02 06:25:25 +08:00
|
|
|
$(info [-] CC(AVX512) $<)
|
2019-08-18 06:09:42 +08:00
|
|
|
$(Q)$(MKDIR) $(dir $@)
|
2019-08-17 04:49:34 +08:00
|
|
|
$(Q)$(CC) $(DEPFLAGS:%.Td=%_AVX512.Td) $(PM3CFLAGS) $(HARD_SWITCH_AVX512) -c -o $@ $<
|
2019-08-23 03:05:45 +08:00
|
|
|
$(Q)$(MV) -f $(OBJDIR)/$*_AVX512.Td $(OBJDIR)/$*_AVX512.d && $(TOUCH) $@
|
2017-07-28 02:59:54 +08:00
|
|
|
|
|
|
|
%.o: %.c
|
|
|
|
$(OBJDIR)/%.o : %.c $(OBJDIR)/%.d
|
2019-06-02 06:25:25 +08:00
|
|
|
$(info [-] CC $<)
|
2019-08-18 06:09:42 +08:00
|
|
|
$(Q)$(MKDIR) $(dir $@)
|
2019-08-17 04:50:03 +08:00
|
|
|
$(Q)$(CC) $(DEPFLAGS) $(PM3CFLAGS) -c -o $@ $<
|
2019-06-02 06:25:25 +08:00
|
|
|
$(Q)$(POSTCOMPILE)
|
2017-07-28 02:59:54 +08:00
|
|
|
|
|
|
|
%.o: %.cpp
|
|
|
|
$(OBJDIR)/%.o : %.cpp $(OBJDIR)/%.d
|
2019-06-02 06:25:25 +08:00
|
|
|
$(info [-] CXX $<)
|
2019-08-18 06:09:42 +08:00
|
|
|
$(Q)$(MKDIR) $(dir $@)
|
2019-08-17 04:49:34 +08:00
|
|
|
$(Q)$(CXX) $(DEPFLAGS) $(PM3CXXFLAGS) $(QTINCLUDES) -c -o $@ $<
|
2019-06-02 06:25:25 +08:00
|
|
|
$(Q)$(POSTCOMPILE)
|
2017-07-28 02:59:54 +08:00
|
|
|
|
2018-10-06 19:29:20 +08:00
|
|
|
%.o: %.m
|
|
|
|
$(OBJDIR)/%.o : %.m $(OBJDIR)/%.d
|
2019-06-02 06:25:25 +08:00
|
|
|
$(info [-] CC $<)
|
2019-08-18 06:09:42 +08:00
|
|
|
$(Q)$(MKDIR) $(dir $@)
|
2019-08-17 04:49:34 +08:00
|
|
|
$(Q)$(CC) $(DEPFLAGS) $(PM3CFLAGS) -c -o $@ $<
|
2019-06-02 06:25:25 +08:00
|
|
|
$(Q)$(POSTCOMPILE)
|
2019-03-10 18:35:03 +08:00
|
|
|
|
2019-08-17 04:50:03 +08:00
|
|
|
DEPENDENCY_FILES = $(patsubst %.c, $(OBJDIR)/%.d, $(CORESRCS) $(CMDSRCS) $(REVENGSRCS)) \
|
2019-03-10 19:22:02 +08:00
|
|
|
$(patsubst %.o, %.d, $(MULTIARCHOBJS)) \
|
2017-07-28 02:59:54 +08:00
|
|
|
$(patsubst %.cpp, $(OBJDIR)/%.d, $(QTGUISRCS)) \
|
2018-10-06 19:29:20 +08:00
|
|
|
$(patsubst %.m, $(OBJDIR)/%.d, $(OBJCSRCS)) \
|
2019-09-09 07:07:46 +08:00
|
|
|
$(OBJDIR)/proxmark3.d
|
2017-07-28 02:59:54 +08:00
|
|
|
|
|
|
|
$(DEPENDENCY_FILES): ;
|
|
|
|
.PRECIOUS: $(DEPENDENCY_FILES)
|
|
|
|
|
|
|
|
-include $(DEPENDENCY_FILES)
|