Makefile & CMake rework

This commit is contained in:
Philippe Teuwen 2020-05-24 23:23:55 +02:00
commit 72acec5806
23 changed files with 467 additions and 291 deletions

View file

@ -4,11 +4,6 @@
# the license. # the license.
#----------------------------------------------------------------------------- #-----------------------------------------------------------------------------
# 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)
# Must be called before any Makefile include # Must be called before any Makefile include
ROOT_DIR:=$(dir $(realpath $(lastword $(MAKEFILE_LIST)))) ROOT_DIR:=$(dir $(realpath $(lastword $(MAKEFILE_LIST))))
@ -22,44 +17,45 @@ vpath %.dic dictionaries
OBJDIR = obj OBJDIR = obj
LDLIBS ?= -L/usr/local/lib LDLIBS ?= -L/usr/local/lib
LDLIBS += -lreadline -lm
ifneq ($(SKIPPTHREAD),1) ifeq ($(platform),Darwin)
LDLIBS += -lpthread # cf brew info qt: qt not symlinked anymore
PKG_CONFIG_ENV := PKG_CONFIG_PATH=/usr/local/opt/qt/lib/pkgconfig
endif endif
# RPi Zero gcc requires -latomic ###################
# but MacOSX /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld # local libraries #
# doesn't recognize option --as-needed ###################
ifneq ($(platform),Darwin)
LDLIBS += -Wl,--as-needed -latomic -Wl,--no-as-needed
endif
# local libraries ## Amiibo
LUALIBPATH = ./deps/liblua
LUALIBINC = -I$(LUALIBPATH)
LUALIB = $(LUALIBPATH)/liblua.a
JANSSONLIBPATH = ./deps/jansson
JANSSONLIBINC = -I$(JANSSONLIBPATH)
JANSSONLIB = $(JANSSONLIBPATH)/libjansson.a
CBORLIBPATH = ./deps/tinycbor
CBORLIBINC = -I$(CBORLIBPATH)
CBORLIB = $(CBORLIBPATH)/tinycbor.a
REVENGLIBPATH = ./deps/reveng
REVENGLIBINC = -I$(REVENGLIBPATH)
REVENGLIB = $(REVENGLIBPATH)/libreveng.a
AMIIBOLIBPATH = ./deps/amiitool AMIIBOLIBPATH = ./deps/amiitool
AMIIBOLIBINC = -I$(AMIIBOLIBPATH) AMIIBOLIBINC = -I$(AMIIBOLIBPATH)
AMIIBOLIB = $(AMIIBOLIBPATH)/libamiibo.a AMIIBOLIB = $(AMIIBOLIBPATH)/libamiibo.a
HARDNESTEDLIBPATH = ./deps/hardnested
HARDNESTEDLIBINC = -I$(HARDNESTEDLIBPATH) ## Tinycbor
HARDNESTEDLIB = $(HARDNESTEDLIBPATH)/libhardnested.a CBORLIBPATH = ./deps/tinycbor
CBORLIBINC = -I$(CBORLIBPATH)
CBORLIB = $(CBORLIBPATH)/tinycbor.a
## Cliparser / Argtable3
CLIPARSERLIBPATH = ./deps/cliparser CLIPARSERLIBPATH = ./deps/cliparser
CLIPARSERLIBINC = -I$(CLIPARSERLIBPATH) CLIPARSERLIBINC = -I$(CLIPARSERLIBPATH)
CLIPARSERLIB = $(CLIPARSERLIBPATH)/libcliparser.a CLIPARSERLIB = $(CLIPARSERLIBPATH)/libcliparser.a
WAILIBPATH = ./deps/whereami
WAILIBINC = -I$(WAILIBPATH)
WAILIB = $(WAILIBPATH)/libwhereami.a
## Hardnested
HARDNESTEDLIBPATH = ./deps/hardnested
HARDNESTEDLIBINC = -I$(HARDNESTEDLIBPATH)
HARDNESTEDLIB = $(HARDNESTEDLIBPATH)/libhardnested.a
## Jansson
JANSSONLIBPATH = ./deps/jansson
JANSSONLIBINC = -I$(JANSSONLIBPATH)
JANSSONLIB = $(JANSSONLIBPATH)/libjansson.a
## Lua
LUALIBPATH = ./deps/liblua
LUALIBINC = -I$(LUALIBPATH)
LUALIB = $(LUALIBPATH)/liblua.a
LUAPLATFORM = generic LUAPLATFORM = generic
ifneq (,$(findstring MINGW,$(platform))) ifneq (,$(findstring MINGW,$(platform)))
LUAPLATFORM = mingw LUAPLATFORM = mingw
@ -72,85 +68,195 @@ else
endif endif
endif endif
# common libraries ## Reveng
REVENGLIBPATH = ./deps/reveng
REVENGLIBINC = -I$(REVENGLIBPATH)
REVENGLIB = $(REVENGLIBPATH)/libreveng.a
## Whereami
WAILIBPATH = ./deps/whereami
WAILIBINC = -I$(WAILIBPATH)
WAILIB = $(WAILIBPATH)/libwhereami.a
##########################
# common local libraries #
##########################
## mbed TLS
MBEDTLSLIBPATH = ../common/mbedtls MBEDTLSLIBPATH = ../common/mbedtls
MBEDTLSLIBINC = -I$(MBEDTLSLIBPATH)
MBEDTLSLIB = $(OBJDIR)/libmbedtls.a MBEDTLSLIB = $(OBJDIR)/libmbedtls.a
## Zlib
ZLIBPATH = ../common/zlib ZLIBPATH = ../common/zlib
ZLIBINC = -I$(ZLIBPATH)
ZLIB = $(OBJDIR)/libz.a ZLIB = $(OBJDIR)/libz.a
# system libraries ########################################################
ifneq ($(SKIPLUASYSTEM),1) # optional system libraries to replace local libraries #
LUAINCLUDES = $(shell $(PKG_CONFIG_ENV) pkg-config --cflags lua5.2 2>/dev/null) ########################################################
LUALDLIBS = $(shell $(PKG_CONFIG_ENV) pkg-config --libs lua5.2 2>/dev/null)
ifneq ($(LUALDLIBS),)
LUALIB = $(LUALDLIBS)
LUALIBINC = $(LUAINCLUDES)
LUASYSTEM = 1
endif
endif
## Amiibo
# not distributed as system library
LDLIBS += $(AMIIBOLIB)
INCLUDES += $(AMIIBOLIBINC)
## Tinycbor
# not distributed as system library
LDLIBS += $(CBORLIB)
INCLUDES += $(CBORLIBINC)
## Cliparser / Argtable3
# not distributed as system library
LDLIBS += $(CLIPARSERLIB)
INCLUDES += $(CLIPARSERLIBINC)
## Hardnested
# not distributed as system library
LDLIBS += $(HARDNESTEDLIB)
INCLUDES += $(HARDNESTEDLIBINC)
## Jansson
ifneq ($(SKIPJANSSONSYSTEM),1) ifneq ($(SKIPJANSSONSYSTEM),1)
JANSSONINCLUDES = $(shell $(PKG_CONFIG_ENV) pkg-config --cflags jansson 2>/dev/null) JANSSONINCLUDES = $(shell $(PKG_CONFIG_ENV) pkg-config --cflags jansson 2>/dev/null)
JANSSONLDLIBS = $(shell $(PKG_CONFIG_ENV) pkg-config --libs jansson 2>/dev/null) JANSSONLDLIBS = $(shell $(PKG_CONFIG_ENV) pkg-config --libs jansson 2>/dev/null)
ifneq ($(JANSSONLDLIBS),) ifneq ($(JANSSONLDLIBS),)
JANSSONLIB = $(JANSSONLDLIBS) JANSSONLIB = $(JANSSONLDLIBS)
JANSSONLIBINC = $(JANSSONINCLUDES) JANSSONLIBINC = $(JANSSONINCLUDES)
JANSSONSYSTEM = 1 JANSSON_FOUND = 1
endif endif
endif endif
LDLIBS += $(JANSSONLIB)
INCLUDES += $(JANSSONLIBINC)
## Lua
ifneq ($(SKIPLUASYSTEM),1)
LUAINCLUDES = $(shell $(PKG_CONFIG_ENV) pkg-config --cflags lua5.2 2>/dev/null)
LUALDLIBS = $(shell $(PKG_CONFIG_ENV) pkg-config --libs lua5.2 2>/dev/null)
ifneq ($(LUALDLIBS),)
LUALIB = $(LUALDLIBS)
LUALIBINC = $(LUAINCLUDES)
LUA_FOUND = 1
endif
endif
LDLIBS += $(LUALIB)
INCLUDES += $(LUALIBINC)
## mbed TLS
# system library cannot be used because it is compiled by default without CMAC support
LDLIBS +=$(MBEDTLSLIB)
INCLUDES += $(MBEDTLSLIBINC)
## Reveng
# not distributed as system library
LDLIBS += $(REVENGLIB)
INCLUDES += $(REVENGLIBINC)
## Whereami
ifneq ($(SKIPWHEREAMISYSTEM),1) ifneq ($(SKIPWHEREAMISYSTEM),1)
ifneq (,$(wildcard /usr/include/whereami.h)) ifneq (,$(wildcard /usr/include/whereami.h))
WAILIB = -lwhereami WAILIB = -lwhereami
WAILIBINC = WAILIBINC =
WAISYSTEM = 1 WAI_FOUND = 1
endif endif
endif endif
LDLIBS += $(WAILIB)
INCLUDES += $(WAILIBINC)
ifneq ($(SKIPBT),1) ## Zlib
BTLDLIBS = $(shell $(PKG_CONFIG_ENV) pkg-config --libs bluez 2>/dev/null) # system library useable? Need to recompress hardnested tables?
LDLIBS +=$(ZLIB)
INCLUDES += $(ZLIBINC)
####################
# system libraries #
####################
## Atomic
# 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 endif
## Bluez (optional)
ifneq ($(SKIPBT),1)
BTINCLUDES = $(shell $(PKG_CONFIG_ENV) pkg-config --cflags bluez 2>/dev/null)
BTLDLIBS = $(shell $(PKG_CONFIG_ENV) pkg-config --libs bluez 2>/dev/null)
ifneq ($(BTLDLIBS),)
BTLIB = $(BTLDLIBS)
BTLIBINC = $(BTINCLUDES)
BT_FOUND = 1
endif
endif
LDLIBS += $(BTLIB)
INCLUDES += $(BTLIBINC)
## Readline
ifeq ($(platform),Darwin)
LDLIBS += -L/usr/local/opt/readline/lib
INCLUDES += -I/usr/local/opt/readline/include
endif
LDLIBS += -lreadline
## Math
LDLIBS += -lm
## Pthread
# Some have no pthread, e.g. termux
ifneq ($(SKIPPTHREAD),1)
LDLIBS += -lpthread
endif
## QT5 (or QT4 fallback) (optional)
ifneq ($(SKIPQT),1) ifneq ($(SKIPQT),1)
# Check for correctly configured Qt5 # Check for correctly configured Qt5
QTINCLUDES = $(shell $(PKG_CONFIG_ENV) pkg-config --cflags Qt5Core Qt5Widgets 2>/dev/null) QTINCLUDES = $(shell $(PKG_CONFIG_ENV) pkg-config --cflags Qt5Core Qt5Widgets 2>/dev/null)
QTLDLIBS = $(shell $(PKG_CONFIG_ENV) pkg-config --libs Qt5Core Qt5Widgets 2>/dev/null) QTLDLIBS = $(shell $(PKG_CONFIG_ENV) pkg-config --libs Qt5Core Qt5Widgets 2>/dev/null)
MOC = $(shell $(PKG_CONFIG_ENV) pkg-config --variable=host_bins Qt5Core)/moc MOC = $(shell $(PKG_CONFIG_ENV) pkg-config --variable=host_bins Qt5Core)/moc
UIC = $(shell $(PKG_CONFIG_ENV) pkg-config --variable=host_bins Qt5Core)/uic UIC = $(shell $(PKG_CONFIG_ENV) pkg-config --variable=host_bins Qt5Core)/uic
ifeq ($(QTINCLUDES), ) ifneq ($(QTLDLIBS),)
# if Qt5 not found check for correctly configured Qt4 QT5_FOUND = 1
else
# if Qt5 not found check for correctly configured Qt4
QTINCLUDES = $(shell $(PKG_CONFIG_ENV) pkg-config --cflags QtCore QtGui 2>/dev/null) QTINCLUDES = $(shell $(PKG_CONFIG_ENV) pkg-config --cflags QtCore QtGui 2>/dev/null)
QTLDLIBS = $(shell $(PKG_CONFIG_ENV) pkg-config --libs QtCore QtGui 2>/dev/null) QTLDLIBS = $(shell $(PKG_CONFIG_ENV) pkg-config --libs QtCore QtGui 2>/dev/null)
MOC = $(shell $(PKG_CONFIG_ENV) pkg-config --variable=moc_location QtCore) MOC = $(shell $(PKG_CONFIG_ENV) pkg-config --variable=moc_location QtCore)
UIC = $(shell $(PKG_CONFIG_ENV) pkg-config --variable=uic_location QtCore) UIC = $(shell $(PKG_CONFIG_ENV) pkg-config --variable=uic_location QtCore)
else
# On OSX Qt5 is claiming for a C++11 compiler (gnu++14 works too, but if nothing it fails)
QT5FOUND = 1
endif endif
ifeq ($(QTINCLUDES), ) ifeq ($(QTLDLIBS),)
# if both pkg-config commands failed, search in common places # if both pkg-config commands failed, search in common places
ifneq ($(QTDIR), ) 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),) ifneq ($(wildcard $(QTDIR)/include/QtWidgets),)
QTINCLUDES += -I$(QTDIR)/include/QtWidgets # QT5
QTLDLIBS = -L$(QTDIR)/lib -lQt5Widgets -lQt5Gui -lQt5Core QTINCLUDES = -I$(QTDIR)/include -I$(QTDIR)/include/QtCore -I$(QTDIR)/include/QtGui -I$(QTDIR)/include/QtWidgets
QT5FOUND = 1 QTLDLIBS = -L$(QTDIR)/lib -lQt5Core -lQt5Gui -lQt5Widgets
QT5_FOUND = 1
else
# QT4
QTINCLUDES = -I$(QTDIR)/include -I$(QTDIR)/include/QtCore -I$(QTDIR)/include/QtGui
QTLDLIBS = -L$(QTDIR)/lib -lQtCore4 -lQtGui4
endif endif
MOC = $(QTDIR)/bin/moc MOC = $(QTDIR)/bin/moc
UIC = $(QTDIR)/bin/uic UIC = $(QTDIR)/bin/uic
endif endif
endif endif
ifneq ($(QTLDLIBS),)
QT_FOUND = 1
endif
endif endif
LDLIBS += $(QTLDLIBS)
CXXINCLUDES += $(QTINCLUDES)
LIBS = $(LUALIBINC) $(MBEDTLSLIBINC) $(JANSSONLIBINC) $(CBORLIBINC) $(ZLIBINC) $(REVENGLIBINC) $(AMIIBOLIBINC) $(HARDNESTEDLIBINC) $(CLIPARSERLIBINC) $(WAILIBINC) #######################################################################################################
INCLUDES_CLIENT += -I./src -I../include -I../common -I../common_fpga $(LIBS)
CFLAGS ?= $(DEFCFLAGS) CFLAGS ?= $(DEFCFLAGS)
# We cannot just use CFLAGS+=... because it has impact on sub-makes if CFLAGS is defined in env: # We cannot just use CFLAGS+=... because it has impact on sub-makes if CFLAGS is defined in env:
PM3CFLAGS = $(CFLAGS) $(INCLUDES_CLIENT) PM3CFLAGS = $(CFLAGS)
PM3CFLAGS += -I./src -I../include -I../common -I../common_fpga $(INCLUDES)
# WIP Testing # WIP Testing
#PM3CFLAGS = $(CFLAGS) -std=c11 -pedantic $(INCLUDES_CLIENT) #PM3CFLAGS += -std=c11 -pedantic
PREFIX ?= /usr/local PREFIX ?= /usr/local
ifneq (,$(findstring MINGW,$(platform))) ifneq (,$(findstring MINGW,$(platform)))
# Mingw uses by default Microsoft printf, we want the GNU printf (e.g. for %z) # Mingw uses by default Microsoft printf, we want the GNU printf (e.g. for %z)
@ -160,220 +266,254 @@ ifneq (,$(findstring MINGW,$(platform)))
PM3CFLAGS += -D_ISOC99_SOURCE PM3CFLAGS += -D_ISOC99_SOURCE
PM3CFLAGS += -mno-ms-bitfields -fexec-charset=cp850 PM3CFLAGS += -mno-ms-bitfields -fexec-charset=cp850
endif endif
ifeq ($(platform),Darwin)
OBJCSRCS = util_darwin.m
LDFLAGS += -framework Foundation -framework AppKit
LDLIBS := -L/usr/local/opt/readline/lib $(LDLIBS)
LIBS := -I/usr/local/opt/readline/include $(LIBS)
# cf brew info qt: qt not symlinked anymore
PKG_CONFIG_ENV := PKG_CONFIG_PATH=/usr/local/opt/qt/lib/pkgconfig
endif
CXXFLAGS ?= -Wall -Werror -O3 ifeq ($(BT_FOUND),1)
PM3CXXFLAGS = $(CXXFLAGS) -I../include
ifneq ($(BTLDLIBS),)
PM3CFLAGS += -DHAVE_BLUEZ PM3CFLAGS += -DHAVE_BLUEZ
endif endif
ifneq ($(QTLDLIBS),) CXXFLAGS ?= -Wall -Werror -O3
QTGUISRCS = proxgui.cpp proxguiqt.cpp proxguiqt.moc.cpp PM3CXXFLAGS = $(CXXFLAGS)
QTGUIOBJS = $(OBJDIR)/proxgui.o $(OBJDIR)/proxguiqt.o $(OBJDIR)/proxguiqt.moc.o PM3CXXFLAGS += -I../include
ifeq ($(QT_FOUND),1)
PM3CFLAGS += -DHAVE_GUI PM3CFLAGS += -DHAVE_GUI
PM3CXXFLAGS += -DQT_NO_DEBUG PM3CXXFLAGS += -DQT_NO_DEBUG
ifeq ($(QT5FOUND),1) ifeq ($(QT5_FOUND),1)
# On OSX Qt5 is claiming for a C++11 compiler (gnu++14 works too, but if nothing it fails)
PM3CXXFLAGS += -fPIC -std=c++11 PM3CXXFLAGS += -fPIC -std=c++11
endif endif
else
QTGUISRCS = guidummy.cpp
QTGUIOBJS = $(OBJDIR)/guidummy.o
endif endif
PM3LDFLAGS = $(LDFLAGS)
ifeq ($(platform),Darwin)
PM3LDFLAGS += -framework Foundation -framework AppKit
endif
###################
# printing status #
###################
$(info ===================================================================) $(info ===================================================================)
$(info Client platform: $(platform)) $(info Client platform: $(platform))
ifeq ($(SKIPQT),1) ifeq ($(SKIPQT),1)
$(info GUI support: skipped) $(info GUI support: skipped)
else ifneq ($(QTLDLIBS),) else ifeq ($(QT_FOUND),1)
$(info GUI support: QT found, enabled) ifeq ($(QT5_FOUND),1)
$(info GUI support: QT5 found, enabled)
else
$(info GUI support: QT4 found, enabled)
endif
else else
$(info GUI support: QT not found, disabled) $(info GUI support: QT not found, disabled)
endif endif
ifeq ($(SKIPBT),1) ifeq ($(SKIPBT),1)
$(info native BT support: skipped) $(info native BT support: skipped)
else ifneq ($(BTLDLIBS),) else ifneq ($(BTLDLIBS),)
$(info native BT support: Bluez found, enabled) $(info native BT support: Bluez found, enabled)
else else
$(info native BT support: Bluez not found, disabled) $(info native BT support: Bluez not found, disabled)
endif endif
ifeq ($(JANSSONSYSTEM),1)
$(info Jansson library: system library found) ifeq ($(JANSSON_FOUND),1)
$(info Jansson library: system library found)
endif endif
ifeq ($(LUASYSTEM),1)
$(info Lua library: system library found) ifeq ($(LUA_FOUND),1)
$(info Lua library: system library found)
endif endif
ifeq ($(WAISYSTEM),1)
$(info Whereami library: system library found) ifeq ($(WAI_FOUND),1)
$(info Whereami library: system library found)
endif endif
$(info compiler version: $(shell $(CC) --version|head -n 1)) $(info compiler version: $(shell $(CC) --version|head -n 1))
$(info ===================================================================) $(info ===================================================================)
################
# dependencies #
################
# Flags to generate temporary dependency files # Flags to generate temporary dependency files
DEPFLAGS = -MT $@ -MMD -MP -MF $(OBJDIR)/$*.Td DEPFLAGS = -MT $@ -MMD -MP -MF $(OBJDIR)/$*.Td
# make temporary to final dependency files after successful compilation # make temporary to final dependency files after successful compilation
POSTCOMPILE = $(MV) -f $(OBJDIR)/$*.Td $(OBJDIR)/$*.d && $(TOUCH) $@ POSTCOMPILE = $(MV) -f $(OBJDIR)/$*.Td $(OBJDIR)/$*.d && $(TOUCH) $@
CORESRCS = uart/uart_posix.c \ ################
uart/uart_win32.c \ # enumerations #
ui.c \ ################
commonutil.c \
util.c \
util_posix.c \
scandir.c \
crc16.c \
crc32.c \
comms.c \
version.c
CMDSRCS = crapto1/crapto1.c \ SRCS = aidsearch.c \
crapto1/crypto1.c \ cmdanalyse.c \
mifare/mifaredefault.c \ cmdcrc.c \
mifare/mfkey.c \ cmddata.c \
tea.c \ cmdflashmem.c \
fido/additional_ca.c \ cmdflashmemspiffs.c \
fido/cose.c \ cmdhf.c \
fido/cbortools.c \ cmdhf14a.c \
fido/fidocore.c \ cmdhf14b.c \
crypto/asn1dump.c \ cmdhf15.c \
crypto/libpcrypto.c\ cmdhfcryptorf.c \
crypto/asn1utils.c\ cmdhfepa.c \
loclass/cipher.c \ cmdhffelica.c \
loclass/cipherutils.c \ cmdhffido.c \
loclass/ikeys.c \ cmdhficlass.c \
loclass/elite_crack.c \ cmdhflegic.c \
fileutils.c \ cmdhflist.c \
mifare/mifarehost.c \ cmdhflto.c \
parity.c \ cmdhfmf.c \
crc.c \ cmdhfmfdes.c \
crc64.c \ cmdhfmfhard.c \
legic_prng.c \ cmdhfmfu.c \
iso15693tools.c \ cmdhfmfp.c \
prng.c \ cmdhfthinfilm.c \
generator.c \ cmdhftopaz.c \
graph.c \ cmdhw.c \
cmddata.c \ cmdlf.c \
lfdemod.c \ cmdlfawid.c \
emv/crypto_polarssl.c\ cmdlfcotag.c \
emv/crypto.c\ cmdlfem4x.c \
emv/emv_pk.c\ cmdlffdx.c \
emv/emv_pki.c\ cmdlfguard.c \
emv/emv_pki_priv.c\ cmdlfgallagher.c \
emv/test/cryptotest.c\ cmdlfhid.c \
emv/apduinfo.c \ cmdlfhitag.c \
emv/dump.c \ cmdlfindala.c \
emv/tlv.c \ cmdlfio.c \
emv/emv_tags.c \ cmdlfjablotron.c \
emv/dol.c \ cmdlfkeri.c \
emv/emvjson.c\ cmdlfmotorola.c \
emv/emvcore.c \ cmdlfnedap.c \
emv/test/crypto_test.c\ cmdlfnexwatch.c \
emv/test/sda_test.c\ cmdlfnoralsy.c \
emv/test/dda_test.c\ cmdlfpac.c \
emv/test/cda_test.c\ cmdlfparadox.c \
emv/cmdemv.c \ cmdlfpcf7931.c \
emv/emv_roca.c \ cmdlfpresco.c \
mifare/mifare4.c \ cmdlfpyramid.c \
mifare/mad.c \ cmdlfsecurakey.c \
mifare/ndef.c \ cmdlft55xx.c \
mifare/desfire_crypto.c \ cmdlfti.c \
cmdanalyse.c \ cmdlfviking.c \
cmdhf.c \ cmdlfvisa2000.c \
cmdhflist.c \ cmdmain.c \
aidsearch.c \ cmdparser.c \
cmdhf14a.c \ cmdscript.c \
cmdhf14b.c \ cmdsmartcard.c \
cmdhf15.c \ cmdtrace.c \
cmdhfepa.c \ cmdusart.c \
cmdhflegic.c \ cmdwiegand.c \
cmdhficlass.c \ comms.c \
cmdhfmf.c \ crypto/asn1dump.c \
cmdhfmfu.c \ crypto/asn1utils.c\
cmdhfmfp.c \ crypto/libpcrypto.c\
cmdhfmfhard.c \ emv/apduinfo.c \
cmdhfmfdes.c \ emv/cmdemv.c \
cmdhftopaz.c \ emv/crypto.c\
cmdhffido.c \ emv/crypto_polarssl.c\
cmdhffelica.c \ emv/dol.c \
cmdhfthinfilm.c \ emv/dump.c \
cmdhfcryptorf.c \ emv/emv_pk.c\
cmdhflto.c \ emv/emv_pki.c\
cmdhw.c \ emv/emv_pki_priv.c\
cmdlf.c \ emv/emv_roca.c \
cmdlfawid.c \ emv/emv_tags.c \
cmdlfcotag.c \ emv/emvcore.c \
cmdlfem4x.c \ emv/emvjson.c\
cmdlffdx.c \ emv/tlv.c \
cmdlfguard.c \ emv/test/crypto_test.c\
cmdlfgallagher.c \ emv/test/cryptotest.c\
cmdlfhid.c \ emv/test/cda_test.c\
cmdlfhitag.c \ emv/test/dda_test.c\
cmdlfio.c \ emv/test/sda_test.c\
cmdlfindala.c \ fido/additional_ca.c \
cmdlfjablotron.c \ fido/cose.c \
cmdlfkeri.c \ fido/cbortools.c \
cmdlfnexwatch.c \ fido/fidocore.c \
cmdlfnedap.c \ fileutils.c \
cmdlfnoralsy.c \ flash.c \
cmdlfpac.c \ generator.c \
cmdlfparadox.c \ graph.c \
cmdlfpcf7931.c \ jansson_path.c \
cmdlfpresco.c \ loclass/cipher.c \
cmdlfpyramid.c \ loclass/cipherutils.c \
cmdlfsecurakey.c \ loclass/elite_crack.c \
cmdlft55xx.c \ loclass/ikeys.c \
cmdlfti.c \ mifare/desfire_crypto.c \
cmdlfviking.c \ mifare/mad.c \
cmdlfvisa2000.c \ mifare/mfkey.c \
cmdlfmotorola.c \ mifare/mifare4.c \
cmdtrace.c \ mifare/mifaredefault.c \
cmdflashmem.c \ mifare/mifarehost.c \
cmdflashmemspiffs.c \ mifare/ndef.c \
cmdsmartcard.c \ pm3_binlib.c \
cmdusart.c \ pm3_bitlib.c \
cmdwiegand.c \ preferences.c \
cmdparser.c \ prng.c \
cmdmain.c \ proxmark3.c \
pm3_binlib.c \ scandir.c \
scripting.c \ uart/uart_posix.c \
cmdscript.c \ uart/uart_win32.c \
pm3_bitlib.c \ scripting.c \
cmdcrc.c \ tea.c \
bucketsort.c \ ui.c \
flash.c \ util.c \
wiegand_formats.c \ version.c \
wiegand_formatutils.c \ wiegand_formats.c \
cardhelper.c \ wiegand_formatutils.c
preferences.c \
jansson_path.c
COREOBJS = $(CORESRCS:%.c=$(OBJDIR)/%.o) # common
CMDOBJS = $(CMDSRCS:%.c=$(OBJDIR)/%.o) SRCS += bucketsort.c \
OBJCOBJS = $(OBJCSRCS:%.m=$(OBJDIR)/%.o) cardhelper.c \
crapto1/crapto1.c \
crapto1/crypto1.c \
crc.c \
crc16.c \
crc32.c \
crc64.c \
commonutil.c \
iso15693tools.c \
legic_prng.c \
lfdemod.c \
parity.c \
util_posix.c
# gui
ifeq ($(QT_FOUND),1)
CXXSRCS = proxgui.cpp proxguiqt.cpp proxguiqt.moc.cpp
else
CXXSRCS = guidummy.cpp
endif
# OS X
ifeq ($(platform),Darwin)
OBJCSRCS = util_darwin.m
endif
OBJS = $(SRCS:%.c=$(OBJDIR)/%.o)
OBJS += $(CXXSRCS:%.cpp=$(OBJDIR)/%.o)
OBJS += $(OBJCSRCS:%.m=$(OBJDIR)/%.o)
BINS = proxmark3 BINS = proxmark3
CLEAN = $(BINS) src/version.c src/*.moc.cpp src/ui/ui_overlays.h lualibs/pm3_cmd.lua lualibs/mfc_default_keys.lua CLEAN = $(BINS) src/version.c src/*.moc.cpp src/ui/ui_overlays.h lualibs/pm3_cmd.lua lualibs/mfc_default_keys.lua
# transition: cleaning also old path stuff # transition: cleaning also old path stuff
CLEAN += flasher *.moc.cpp ui/ui_overlays.h CLEAN += flasher *.moc.cpp ui/ui_overlays.h
###########
# targets #
###########
# need to assign dependancies to build these first... # need to assign dependancies to build these first...
all: $(BINS) all: $(BINS)
all-static: LDLIBS:=-static $(LDLIBS) all-static: LDLIBS:=-static $(LDLIBS)
all-static: $(BINS) all-static: $(BINS)
proxmark3: LDLIBS+=$(LUALIB) $(JANSSONLIB) $(MBEDTLSLIB) $(CBORLIB) $(ZLIB) $(REVENGLIB) $(AMIIBOLIB) $(HARDNESTEDLIB) $(CLIPARSERLIB) $(WAILIB) $(BTLDLIBS) $(QTLDLIBS) proxmark3: $(OBJS) liblua jansson tinycbor reveng mbedtls zlib amiibo hardnested cliparser whereami lualibs/pm3_cmd.lua lualibs/mfc_default_keys.lua
proxmark3: $(OBJDIR)/proxmark3.o $(COREOBJS) $(CMDOBJS) $(OBJCOBJS) $(QTGUIOBJS) liblua jansson tinycbor reveng mbedtls zlib amiibo hardnested cliparser whereami lualibs/pm3_cmd.lua lualibs/mfc_default_keys.lua
$(info [=] LD $@) $(info [=] LD $@)
$(Q)$(LD) $(LDFLAGS) $(OBJDIR)/proxmark3.o $(COREOBJS) $(CMDOBJS) $(OBJCOBJS) $(QTGUIOBJS) $(LDLIBS) -o $@ $(Q)$(LD) $(PM3LDFLAGS) $(OBJS) $(LDLIBS) -o $@
src/proxgui.cpp: src/ui/ui_overlays.h src/proxgui.cpp: src/ui/ui_overlays.h
@ -434,15 +574,18 @@ tarbin: $(BINS)
$(info [=] TAR ../proxmark3-$(platform)-bin.tar) $(info [=] TAR ../proxmark3-$(platform)-bin.tar)
$(Q)$(TAR) $(TARFLAGS) ../proxmark3-$(platform)-bin.tar $(BINS:%=client/%) $(WINBINS:%=client/%) $(Q)$(TAR) $(TARFLAGS) ../proxmark3-$(platform)-bin.tar $(BINS:%=client/%) $(WINBINS:%=client/%)
# local libraries: ###########################
# local libraries targets #
###########################
liblua: liblua:
ifneq ($(LUASYSTEM),1) ifneq ($(LUA_FOUND),1)
$(info [*] MAKE $@ for $(LUAPLATFORM)) $(info [*] MAKE $@ for $(LUAPLATFORM))
$(Q)$(MAKE) --no-print-directory -C $(LUALIBPATH) $(LUAPLATFORM) $(Q)$(MAKE) --no-print-directory -C $(LUALIBPATH) $(LUAPLATFORM)
endif endif
jansson: jansson:
ifneq ($(JANSSONSYSTEM),1) ifneq ($(JANSSON_FOUND),1)
$(info [*] MAKE $@) $(info [*] MAKE $@)
$(Q)$(MAKE) --no-print-directory -C $(JANSSONLIBPATH) all $(Q)$(MAKE) --no-print-directory -C $(JANSSONLIBPATH) all
endif endif
@ -468,7 +611,7 @@ cliparser:
$(Q)$(MAKE) --no-print-directory -C $(CLIPARSERLIBPATH) all $(Q)$(MAKE) --no-print-directory -C $(CLIPARSERLIBPATH) all
whereami: whereami:
ifneq ($(WAISYSTEM),1) ifneq ($(WAI_FOUND),1)
$(info [*] MAKE $@) $(info [*] MAKE $@)
$(Q)$(MAKE) --no-print-directory -C $(WAILIBPATH) all $(Q)$(MAKE) --no-print-directory -C $(WAILIBPATH) all
endif endif
@ -482,6 +625,10 @@ zlib:
$(info [*] MAKE $@) $(info [*] MAKE $@)
$(Q)$(MAKE) --no-print-directory -C $(ZLIBPATH) OBJDIR=$(ROOT_DIR)$(OBJDIR) BINDIR=$(ROOT_DIR)$(OBJDIR) all $(Q)$(MAKE) --no-print-directory -C $(ZLIBPATH) OBJDIR=$(ROOT_DIR)$(OBJDIR) BINDIR=$(ROOT_DIR)$(OBJDIR) all
########
# misc #
########
.PHONY: all clean install uninstall tarbin liblua jansson tinycbor reveng hardnested amiibo cliparser whereami mbedtls zlib .PHONY: all clean install uninstall tarbin liblua jansson tinycbor reveng hardnested amiibo cliparser whereami mbedtls zlib
# version.c should be remade on every compilation # version.c should be remade on every compilation
@ -503,7 +650,7 @@ $(OBJDIR)/%.o : %.c $(OBJDIR)/%.d
$(OBJDIR)/%.o : %.cpp $(OBJDIR)/%.d $(OBJDIR)/%.o : %.cpp $(OBJDIR)/%.d
$(info [-] CXX $<) $(info [-] CXX $<)
$(Q)$(MKDIR) $(dir $@) $(Q)$(MKDIR) $(dir $@)
$(Q)$(CXX) $(DEPFLAGS) $(PM3CXXFLAGS) $(QTINCLUDES) -c -o $@ $< $(Q)$(CXX) $(DEPFLAGS) $(PM3CXXFLAGS) $(CXXINCLUDES) -c -o $@ $<
$(Q)$(POSTCOMPILE) $(Q)$(POSTCOMPILE)
%.o: %.m %.o: %.m
@ -513,10 +660,9 @@ $(OBJDIR)/%.o : %.m $(OBJDIR)/%.d
$(Q)$(CC) $(DEPFLAGS) $(PM3CFLAGS) -c -o $@ $< $(Q)$(CC) $(DEPFLAGS) $(PM3CFLAGS) -c -o $@ $<
$(Q)$(POSTCOMPILE) $(Q)$(POSTCOMPILE)
DEPENDENCY_FILES = $(patsubst %.c, $(OBJDIR)/%.d, $(CORESRCS) $(CMDSRCS)) \ DEPENDENCY_FILES = $(patsubst %.c, $(OBJDIR)/%.d, $(SRCS)) \
$(patsubst %.cpp, $(OBJDIR)/%.d, $(QTGUISRCS)) \ $(patsubst %.cpp, $(OBJDIR)/%.d, $(CXXSRCS)) \
$(patsubst %.m, $(OBJDIR)/%.d, $(OBJCSRCS)) \ $(patsubst %.m, $(OBJDIR)/%.d, $(OBJCSRCS))
$(OBJDIR)/proxmark3.d
$(DEPENDENCY_FILES): ; $(DEPENDENCY_FILES): ;
.PRECIOUS: $(DEPENDENCY_FILES) .PRECIOUS: $(DEPENDENCY_FILES)

View file

@ -1,10 +1,30 @@
include(cliparser.cmake) if (NOT TARGET pm3rrg_rdv4_amiibo)
include(tinycbor.cmake) include(amiibo.cmake)
include(jansson.cmake) endif()
include(lua.cmake) if (NOT TARGET pm3rrg_rdv4_cliparser)
include(mbedtls.cmake) include(cliparser.cmake)
include(amiibo.cmake) endif()
include(reveng.cmake) if (NOT TARGET pm3rrg_rdv4_hardnested)
include(zlib.cmake) include(hardnested.cmake)
include(hardnested.cmake) endif()
include(whereami.cmake) if (NOT TARGET pm3rrg_rdv4_jansson)
include(jansson.cmake)
endif()
if (NOT TARGET pm3rrg_rdv4_lua)
include(lua.cmake)
endif()
if (NOT TARGET pm3rrg_rdv4_mbedtls)
include(mbedtls.cmake)
endif()
if (NOT TARGET pm3rrg_rdv4_reveng)
include(reveng.cmake)
endif()
if (NOT TARGET pm3rrg_rdv4_tinycbor)
include(tinycbor.cmake)
endif()
if (NOT TARGET pm3rrg_rdv4_whereami)
include(whereami.cmake)
endif()
if (NOT TARGET pm3rrg_rdv4_z)
include(zlib.cmake)
endif()

View file

@ -11,6 +11,14 @@ add_library(pm3rrg_rdv4_amiibo STATIC
amiitool/keygen.c amiitool/keygen.c
) )
if (NOT TARGET pm3rrg_rdv4_mbedtls)
include(mbedtls.cmake)
endif()
find_library(pm3rrg_rdv4_mbedtls REQUIRED)
target_link_libraries(pm3rrg_rdv4_amiibo PRIVATE
readline
m
pm3rrg_rdv4_mbedtls)
target_include_directories(pm3rrg_rdv4_amiibo PRIVATE ../../include ../../common) target_include_directories(pm3rrg_rdv4_amiibo PRIVATE ../../include ../../common)
target_include_directories(pm3rrg_rdv4_amiibo INTERFACE amiitool) target_include_directories(pm3rrg_rdv4_amiibo INTERFACE amiitool)
target_compile_options(pm3rrg_rdv4_amiibo PRIVATE -Wall -Werror -O3) target_compile_options(pm3rrg_rdv4_amiibo PRIVATE -Wall -Werror -O3)

View file

@ -1,5 +1,5 @@
MYSRCPATHS = MYSRCPATHS =
MYINCLUDES = -I. -I.. -I../jansson -I../../../common -I../../../include MYINCLUDES = -I. -I.. -I../jansson -I../../../common -I../../../common/mbedtls -I../../../include
MYCFLAGS = MYCFLAGS =
MYDEFS = MYDEFS =
MYSRCS = \ MYSRCS = \

View file

@ -6,8 +6,8 @@
*/ */
#include "amiibo.h" #include "amiibo.h"
#include "mbedtls/md.h" #include "md.h"
#include "mbedtls/aes.h" #include "aes.h"
#include "commonutil.h" #include "commonutil.h"
#define HMAC_POS_DATA 0x008 #define HMAC_POS_DATA 0x008

View file

@ -8,7 +8,7 @@
#include "drbg.h" #include "drbg.h"
#include <assert.h> #include <assert.h>
#include <string.h> #include <string.h>
#include "mbedtls/md.h" #include "md.h"
void nfc3d_drbg_init(nfc3d_drbg_ctx *ctx, const uint8_t *hmacKey, size_t hmacKeySize, const uint8_t *seed, size_t seedSize) { void nfc3d_drbg_init(nfc3d_drbg_ctx *ctx, const uint8_t *hmacKey, size_t hmacKeySize, const uint8_t *seed, size_t seedSize) {
assert(ctx != NULL); assert(ctx != NULL);

View file

@ -45,5 +45,6 @@ add_library(pm3rrg_rdv4_mbedtls STATIC
) )
target_include_directories(pm3rrg_rdv4_mbedtls PRIVATE ../../common) target_include_directories(pm3rrg_rdv4_mbedtls PRIVATE ../../common)
target_include_directories(pm3rrg_rdv4_mbedtls INTERFACE ../../common/mbedtls)
target_compile_options(pm3rrg_rdv4_mbedtls PRIVATE -Wall -Werror -O3) target_compile_options(pm3rrg_rdv4_mbedtls PRIVATE -Wall -Werror -O3)
set_property(TARGET pm3rrg_rdv4_mbedtls PROPERTY POSITION_INDEPENDENT_CODE ON) set_property(TARGET pm3rrg_rdv4_mbedtls PROPERTY POSITION_INDEPENDENT_CODE ON)

View file

@ -9,5 +9,6 @@ add_library(pm3rrg_rdv4_z STATIC
) )
target_compile_definitions(pm3rrg_rdv4_z PRIVATE Z_SOLO NO_GZIP ZLIB_PM3_TUNED) target_compile_definitions(pm3rrg_rdv4_z PRIVATE Z_SOLO NO_GZIP ZLIB_PM3_TUNED)
target_include_directories(pm3rrg_rdv4_z INTERFACE ../../common/zlib)
target_compile_options(pm3rrg_rdv4_z PRIVATE -Wall -Werror -O3) target_compile_options(pm3rrg_rdv4_z PRIVATE -Wall -Werror -O3)
set_property(TARGET pm3rrg_rdv4_z PROPERTY POSITION_INDEPENDENT_CODE ON) set_property(TARGET pm3rrg_rdv4_z PROPERTY POSITION_INDEPENDENT_CODE ON)

View file

@ -18,8 +18,8 @@
#include "comms.h" //getfromdevice #include "comms.h" //getfromdevice
#include "cmdflashmemspiffs.h" // spiffs commands #include "cmdflashmemspiffs.h" // spiffs commands
#include "mbedtls/rsa.h" #include "rsa.h"
#include "mbedtls/sha1.h" #include "sha1.h"
#define MCK 48000000 #define MCK 48000000
#define FLASH_MINFAST 24000000 //33000000 #define FLASH_MINFAST 24000000 //33000000

View file

@ -22,7 +22,7 @@
#include "util.h" #include "util.h"
#include "ui.h" #include "ui.h"
#include "mifare.h" // felica_card_select_t struct #include "mifare.h" // felica_card_select_t struct
#include "mbedtls/des.h" #include "des.h"
#define AddCrc(data, len) compute_crc(CRC_FELICA, (data), (len), (data)+(len)+1, (data)+(len)) #define AddCrc(data, len) compute_crc(CRC_FELICA, (data), (len), (data)+(len)+1, (data)+(len))
static int CmdHelp(const char *Cmd); static int CmdHelp(const char *Cmd);

View file

@ -18,7 +18,7 @@
#include "cmdtrace.h" #include "cmdtrace.h"
#include "util_posix.h" #include "util_posix.h"
#include "comms.h" #include "comms.h"
#include "mbedtls/des.h" #include "des.h"
#include "loclass/cipherutils.h" #include "loclass/cipherutils.h"
#include "loclass/cipher.h" #include "loclass/cipher.h"
#include "loclass/ikeys.h" #include "loclass/ikeys.h"

View file

@ -17,7 +17,7 @@
#include "comms.h" #include "comms.h"
#include "ui.h" #include "ui.h"
#include "cmdhf14a.h" #include "cmdhf14a.h"
#include "mbedtls/aes.h" #include "aes.h"
#include "crypto/libpcrypto.h" #include "crypto/libpcrypto.h"
#include "protocols.h" #include "protocols.h"
#include "cmdtrace.h" #include "cmdtrace.h"

View file

@ -14,8 +14,8 @@
#include "cmdhfmf.h" #include "cmdhfmf.h"
#include "util.h" #include "util.h"
#include "mbedtls/des.h" #include "des.h"
#include "mbedtls/aes.h" #include "aes.h"
static int CmdHelp(const char *Cmd); static int CmdHelp(const char *Cmd);

View file

@ -35,7 +35,7 @@
#include "hardnested_bruteforce.h" #include "hardnested_bruteforce.h"
#include "hardnested_bf_core.h" #include "hardnested_bf_core.h"
#include "hardnested_bitarray_core.h" #include "hardnested_bitarray_core.h"
#include "zlib/zlib.h" #include "zlib.h"
#include "fileutils.h" #include "fileutils.h"
#define NUM_CHECK_BITFLIPS_THREADS (num_CPUs()) #define NUM_CHECK_BITFLIPS_THREADS (num_CPUs())
@ -220,7 +220,7 @@ static void inflate_free(voidpf opaque, voidpf address) {
#define INPUT_BUFFER_LEN 80 #define INPUT_BUFFER_LEN 80
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
// Initialize decompression of the respective (HF or LF) FPGA stream // Initialize decompression of the respective bitflip_bitarray stream
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
static void init_inflate(z_streamp compressed_stream, uint8_t *input_buffer, uint32_t insize, uint8_t *output_buffer, uint32_t outsize) { static void init_inflate(z_streamp compressed_stream, uint8_t *input_buffer, uint32_t insize, uint8_t *output_buffer, uint32_t outsize) {

View file

@ -12,7 +12,7 @@
#include "cmdparser.h" #include "cmdparser.h"
#include "commonutil.h" #include "commonutil.h"
#include "crypto/libpcrypto.h" #include "crypto/libpcrypto.h"
#include "mbedtls/des.h" #include "des.h"
#include "cmdhfmf.h" #include "cmdhfmf.h"
#include "cmdhf14a.h" #include "cmdhf14a.h"
#include "comms.h" #include "comms.h"

View file

@ -23,8 +23,8 @@
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
#include "mbedtls/rsa.h" #include "rsa.h"
#include "mbedtls/sha1.h" #include "sha1.h"
struct crypto_hash_polarssl { struct crypto_hash_polarssl {
struct crypto_hash ch; struct crypto_hash ch;

View file

@ -24,7 +24,7 @@
#include "emv_roca.h" #include "emv_roca.h"
#include "ui.h" // Print... #include "ui.h" // Print...
#include "mbedtls/bignum.h" #include "bignum.h"
static uint8_t g_primes[ROCA_PRINTS_LENGTH] = { static uint8_t g_primes[ROCA_PRINTS_LENGTH] = {
11, 13, 17, 19, 37, 53, 61, 71, 73, 79, 97, 103, 107, 109, 127, 151, 157 11, 13, 17, 19, 37, 53, 61, 71, 73, 79, 97, 103, 107, 109, 127, 151, 157

View file

@ -12,19 +12,19 @@
#include "util.h" #include "util.h"
#include "ui.h" #include "ui.h"
#include "mbedtls/bignum.h" #include "bignum.h"
#include "mbedtls/aes.h" #include "aes.h"
#include "mbedtls/cmac.h" #include "cmac.h"
#include "mbedtls/des.h" #include "des.h"
#include "mbedtls/ecp.h" #include "ecp.h"
#include "mbedtls/rsa.h" #include "rsa.h"
#include "mbedtls/sha1.h" #include "sha1.h"
#include "mbedtls/md5.h" #include "md5.h"
#include "mbedtls/x509.h" #include "x509.h"
#include "mbedtls/base64.h" #include "base64.h"
#include "mbedtls/ctr_drbg.h" #include "ctr_drbg.h"
#include "mbedtls/entropy.h" #include "entropy.h"
#include "mbedtls/timing.h" #include "timing.h"
#include "crypto_test.h" #include "crypto_test.h"
#include "sda_test.h" #include "sda_test.h"

View file

@ -17,7 +17,7 @@
#include "emv/emvcore.h" #include "emv/emvcore.h"
#include "emv/emvjson.h" #include "emv/emvjson.h"
#include "cbortools.h" #include "cbortools.h"
#include "mbedtls/x509_crt.h" #include "x509_crt.h"
#include "crypto/asn1utils.h" #include "crypto/asn1utils.h"
#include "crypto/libpcrypto.h" #include "crypto/libpcrypto.h"
#include "additional_ca.h" #include "additional_ca.h"

View file

@ -45,7 +45,7 @@
#include "ikeys.h" #include "ikeys.h"
#include "elite_crack.h" #include "elite_crack.h"
#include "fileutils.h" #include "fileutils.h"
#include "mbedtls/des.h" #include "des.h"
#include "util_posix.h" #include "util_posix.h"
/** /**

View file

@ -70,7 +70,7 @@ From "Dismantling iclass":
#include "fileutils.h" #include "fileutils.h"
#include "cipherutils.h" #include "cipherutils.h"
#include "mbedtls/des.h" #include "des.h"
uint8_t pi[35] = { uint8_t pi[35] = {
0x0F, 0x17, 0x1B, 0x1D, 0x1E, 0x27, 0x2B, 0x2D, 0x0F, 0x17, 0x1B, 0x1D, 0x1E, 0x27, 0x2B, 0x2D,

View file

@ -29,8 +29,8 @@
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
#include "commonutil.h" #include "commonutil.h"
#include "mbedtls/aes.h" #include "aes.h"
#include "mbedtls/des.h" #include "des.h"
#include "ui.h" #include "ui.h"
#include "crc.h" #include "crc.h"
#include "crc16.h" // crc16 ccitt #include "crc16.h" // crc16 ccitt

View file

@ -21,8 +21,8 @@
#include "mifare/mifarehost.h" #include "mifare/mifarehost.h"
#include "crc.h" #include "crc.h"
#include "crc64.h" #include "crc64.h"
#include "mbedtls/sha1.h" #include "sha1.h"
#include "mbedtls/aes.h" #include "aes.h"
#include "cmdcrc.h" #include "cmdcrc.h"
#include "cmdhfmfhard.h" #include "cmdhfmfhard.h"
#include "cmdhfmfu.h" #include "cmdhfmfu.h"