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
|
|
|
|
2016-01-20 00:22:18 +08:00
|
|
|
CC = gcc
|
|
|
|
CXX = g++
|
2017-07-28 02:59:54 +08:00
|
|
|
LD = g++
|
|
|
|
TAR = tar
|
|
|
|
TARFLAGS = -C .. --ignore-failed-read -rvf
|
|
|
|
RM = rm -f
|
|
|
|
MV = mv
|
2017-02-13 18:06:30 +08:00
|
|
|
|
2017-09-19 04:33:22 +08:00
|
|
|
# uncomment to enable EMV
|
2017-09-29 04:31:20 +08:00
|
|
|
#CFLAGS += -DWITH_EMV
|
|
|
|
|
|
|
|
ENV_LDFLAGS := $(LDFLAGS)
|
|
|
|
ENV_CFLAGS := $(CFLAGS)
|
2017-09-19 04:33:22 +08:00
|
|
|
|
2017-07-28 02:59:54 +08:00
|
|
|
VPATH = ../common ../zlib ../uart
|
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
|
|
|
|
2016-02-19 01:43:20 +08:00
|
|
|
LDLIBS = -L/opt/local/lib -L/usr/local/lib -lreadline -lpthread -lm
|
2015-06-25 18:22:34 +08:00
|
|
|
LUALIB = ../liblua/liblua.a
|
2017-09-29 04:31:20 +08:00
|
|
|
LDFLAGS = $(ENV_LDFLAGS)
|
|
|
|
CFLAGS = $(ENV_CFLAGS) -std=c99 -D_ISOC99_SOURCE -I. -I../include -I../common -I../zlib -I../uart -I/opt/local/include -I../liblua -Wall -g -O3
|
2017-07-28 02:59:54 +08:00
|
|
|
CXXFLAGS = -I../include -Wall -O3
|
2015-03-11 02:00:39 +08:00
|
|
|
|
2017-07-28 02:59:54 +08:00
|
|
|
LUAPLATFORM = generic
|
|
|
|
platform = $(shell uname)
|
2016-02-19 01:43:20 +08:00
|
|
|
ifneq (,$(findstring MINGW,$(platform)))
|
2015-03-11 02:00:39 +08:00
|
|
|
LUAPLATFORM = mingw
|
|
|
|
else
|
2017-07-28 02:59:54 +08:00
|
|
|
ifeq ($(platform),Darwin)
|
2015-03-11 02:00:39 +08:00
|
|
|
LUAPLATFORM = macosx
|
2010-02-25 03:33:29 +08:00
|
|
|
else
|
2015-06-25 18:22:34 +08:00
|
|
|
LUALIB += -ldl
|
2016-07-22 19:52:12 +08:00
|
|
|
LDLIBS += -ltermcap -lncurses
|
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
|
|
|
|
|
|
|
|
# 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
|
|
|
|
CXXFLAGS += -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
|
|
|
|
CXXFLAGS += -std=c++11 -fPIC
|
|
|
|
endif
|
|
|
|
MOC = $(QTDIR)/bin/moc
|
|
|
|
UIC = $(QTDIR)/bin/uic
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
|
2010-02-21 09:07:11 +08:00
|
|
|
|
2011-09-05 19:48:08 +08:00
|
|
|
ifneq ($(QTLDLIBS),)
|
2017-07-28 02:59:54 +08:00
|
|
|
QTGUIOBJS = $(OBJDIR)/proxgui.o $(OBJDIR)/proxguiqt.o $(OBJDIR)/proxguiqt.moc.o
|
2015-03-11 02:00:39 +08:00
|
|
|
CFLAGS += -DHAVE_GUI
|
2011-09-05 19:48:08 +08:00
|
|
|
else
|
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
|
|
|
|
# make temporary to final dependeny files after successful compilation
|
|
|
|
POSTCOMPILE = $(MV) -f $(OBJDIR)/$*.Td $(OBJDIR)/$*.d
|
|
|
|
|
|
|
|
CORESRCS = uart_posix.c \
|
|
|
|
uart_win32.c \
|
2017-08-11 17:40:25 +08:00
|
|
|
ui.c \
|
2017-02-13 18:06:30 +08:00
|
|
|
util.c \
|
2017-07-28 02:59:54 +08:00
|
|
|
util_posix.c \
|
2017-07-30 15:17:48 +08:00
|
|
|
scandir.c
|
|
|
|
|
2013-03-14 23:03:04 +08:00
|
|
|
|
2017-07-28 08:05:03 +08:00
|
|
|
CMDSRCS = crapto1/crapto1.c \
|
|
|
|
crapto1/crypto1.c \
|
|
|
|
mfkey.c \
|
2015-12-09 21:57:16 +08:00
|
|
|
loclass/cipher.c \
|
|
|
|
loclass/cipherutils.c \
|
|
|
|
loclass/des.c \
|
|
|
|
loclass/ikeys.c \
|
2017-08-23 13:37:49 +08:00
|
|
|
loclass/hash1_brute.c \
|
2016-04-21 16:26:00 +08:00
|
|
|
loclass/elite_crack.c \
|
|
|
|
loclass/fileutils.c \
|
2017-02-24 21:59:38 +08:00
|
|
|
whereami.c \
|
2017-07-28 08:05:03 +08:00
|
|
|
mifarehost.c \
|
2016-04-21 16:26:00 +08:00
|
|
|
parity.c \
|
2015-03-12 17:10:22 +08:00
|
|
|
crc.c \
|
2010-02-20 08:36:48 +08:00
|
|
|
crc16.c \
|
2015-03-12 05:06:23 +08:00
|
|
|
crc64.c \
|
2010-02-20 08:36:48 +08:00
|
|
|
iso14443crc.c \
|
2016-09-09 17:58:53 +08:00
|
|
|
legic_prng.c \
|
2010-10-19 22:25:17 +08:00
|
|
|
iso15693tools.c \
|
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
|
|
|
data.c \
|
|
|
|
graph.c \
|
|
|
|
cmddata.c \
|
2014-12-29 09:33:32 +08:00
|
|
|
lfdemod.c \
|
2016-06-14 01:05:50 +08:00
|
|
|
cmdanalyse.c \
|
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
|
|
|
cmdhf.c \
|
|
|
|
cmdhf14a.c \
|
|
|
|
cmdhf14b.c \
|
|
|
|
cmdhf15.c \
|
2012-08-29 05:39:50 +08:00
|
|
|
cmdhfepa.c \
|
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
|
|
|
cmdhflegic.c \
|
2011-05-18 20:33:32 +08:00
|
|
|
cmdhficlass.c \
|
2011-06-10 21:35:10 +08:00
|
|
|
cmdhfmf.c \
|
2015-01-21 04:23:04 +08:00
|
|
|
cmdhfmfu.c \
|
2015-12-09 21:57:16 +08:00
|
|
|
cmdhfmfhard.c \
|
2017-07-28 02:59:54 +08:00
|
|
|
hardnested/hardnested_bruteforce.c \
|
2015-03-24 18:45:31 +08:00
|
|
|
cmdhfmfdes.c \
|
|
|
|
cmdhftopaz.c \
|
2017-02-06 04:56:47 +08:00
|
|
|
cmdhfemv.c \
|
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
|
|
|
cmdhw.c \
|
|
|
|
cmdlf.c \
|
2015-07-19 02:43:14 +08:00
|
|
|
cmdlfawid.c \
|
2017-07-28 02:59:54 +08:00
|
|
|
cmdlfcotag.c \
|
2013-02-28 23:11:52 +08:00
|
|
|
cmdlfem4x.c \
|
2017-07-28 02:59:54 +08:00
|
|
|
cmdlffdx.c \
|
|
|
|
cmdlfguard.c \
|
|
|
|
cmdlfhid.c \
|
2012-09-18 21:52:50 +08:00
|
|
|
cmdlfhitag.c \
|
2017-07-28 02:59:54 +08:00
|
|
|
cmdlfio.c \
|
2017-07-30 15:17:48 +08:00
|
|
|
cmdlfindala.c \
|
2017-07-28 02:59:54 +08:00
|
|
|
cmdlfjablotron.c \
|
|
|
|
cmdlfnexwatch.c \
|
|
|
|
cmdlfnedap.c \
|
|
|
|
cmdlfnoralsy.c \
|
2017-07-14 21:51:12 +08:00
|
|
|
cmdlfpac.c \
|
2017-07-30 15:17:48 +08:00
|
|
|
cmdlfparadox.c \
|
2017-07-28 02:59:54 +08:00
|
|
|
cmdlfpcf7931.c \
|
2016-04-21 16:26:00 +08:00
|
|
|
cmdlfpresco.c \
|
|
|
|
cmdlfpyramid.c \
|
2017-07-14 21:51:12 +08:00
|
|
|
cmdlfsecurakey.c \
|
2017-07-28 02:59:54 +08:00
|
|
|
cmdlft55xx.c \
|
|
|
|
cmdlfti.c \
|
|
|
|
cmdlfviking.c \
|
2016-12-15 06:23:16 +08:00
|
|
|
cmdlfvisa2000.c \
|
2017-07-28 02:59:54 +08:00
|
|
|
cmdparser.c \
|
|
|
|
cmdmain.c \
|
2016-04-21 16:26:00 +08:00
|
|
|
pm3_binlib.c \
|
|
|
|
scripting.c \
|
|
|
|
cmdscript.c \
|
|
|
|
pm3_bitlib.c \
|
|
|
|
aes.c \
|
|
|
|
protocols.c \
|
|
|
|
sha1.c \
|
|
|
|
sha256.c \
|
|
|
|
cmdcrc.c \
|
|
|
|
reveng/preset.c \
|
|
|
|
reveng/reveng.c \
|
|
|
|
reveng/cli.c \
|
|
|
|
reveng/bmpbit.c \
|
|
|
|
reveng/model.c \
|
|
|
|
reveng/poly.c \
|
|
|
|
reveng/getopt.c \
|
|
|
|
tea.c \
|
|
|
|
prng.c \
|
2016-06-14 01:05:50 +08:00
|
|
|
bucketsort.c
|
2016-07-29 02:42:46 +08:00
|
|
|
# radixsort.c \
|
|
|
|
|
2017-07-28 02:59:54 +08:00
|
|
|
cpu_arch = $(shell uname -m)
|
|
|
|
ifneq ($(findstring 86, $(cpu_arch)), )
|
|
|
|
MULTIARCHSRCS = hardnested/hardnested_bf_core.c hardnested/hardnested_bitarray_core.c
|
|
|
|
endif
|
2017-08-16 20:15:16 +08:00
|
|
|
ifneq ($(findstring amd64, $(cpu_arch)), )
|
2017-07-28 02:59:54 +08:00
|
|
|
MULTIARCHSRCS = hardnested/hardnested_bf_core.c hardnested/hardnested_bitarray_core.c
|
|
|
|
endif
|
|
|
|
ifeq ($(MULTIARCHSRCS), )
|
|
|
|
CMDSRCS += hardnested/hardnested_bf_core.c hardnested/hardnested_bitarray_core.c
|
|
|
|
endif
|
2016-05-10 21:30:46 +08:00
|
|
|
|
2015-06-25 18:22:34 +08:00
|
|
|
ZLIBSRCS = deflate.c adler32.c trees.c zutil.c inflate.c inffast.c inftrees.c
|
2017-07-30 15:17:48 +08:00
|
|
|
ZLIBFLAGS = -DZ_SOLO -DZ_PREFIX -DNO_GZIP -DZLIB_PM3_TUNED
|
2015-06-25 18:22:34 +08:00
|
|
|
#-DDEBUG -Dverbose=1
|
2013-05-25 05:05:45 +08:00
|
|
|
|
2017-07-28 02:59:54 +08:00
|
|
|
QTGUISRCS = proxgui.cpp proxguiqt.cpp proxguiqt.moc.cpp guidummy.cpp
|
|
|
|
|
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)
|
2015-06-25 18:22:34 +08:00
|
|
|
ZLIBOBJS = $(ZLIBSRCS:%.c=$(OBJDIR)/%.o)
|
2017-07-28 02:59:54 +08:00
|
|
|
MULTIARCHOBJS = $(MULTIARCHSRCS:%.c=$(OBJDIR)/%_NOSIMD.o) \
|
|
|
|
$(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-09-13 03:45:37 +08:00
|
|
|
#GCC_GTEQ_490 := $(shell expr `gcc --version | awk '/gcc/{print $$NF;}' | sed -e 's/\.\([0-9][0-9]\)/\1/g' -e 's/\.\([0-9]\)/0\1/g' -e 's/^[0-9]\{3,4\}$$/&00/'` \>= 40900)
|
|
|
|
GCC_VERSION := $(shell gcc --version | awk '/gcc/{print $$NF;}' | sed -e 's/\.\([0-9][0-9]\)/\1/g' -e 's/\.\([0-9]\)/0\1/g' -e 's/^[0-9]\{3,4\}$$/&00/')
|
|
|
|
CLANG_VERSION := $(shell gcc --version | awk '/Apple LLVM version/{print $$4;}' | sed -e 's/\.\([0-9][0-9]\)/\1/g' -e 's/\.\([0-9]\)/0\1/g' -e 's/^[0-9]\{3,4\}$$/&00/')
|
|
|
|
ifneq ($(CLANG_VERSION), )
|
|
|
|
SUPPORTS_AVX512 := $(shell [ $(CLANG_VERSION) -ge 80000 ] && echo "True" )
|
|
|
|
endif
|
|
|
|
ifneq ($(GCC_VERSION), )
|
|
|
|
SUPPORTS_AVX512 := $(shell [ $(GCC_VERSION) -ge 40900 ] && echo "True" )
|
|
|
|
endif
|
2017-08-23 13:37:49 +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
|
|
|
|
HARD_SWITCH_SSE2 = -mmmx -msse2 -mno-avx -mno-avx2
|
|
|
|
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"
|
2017-07-28 02:59:54 +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)
|
|
|
|
endif
|
|
|
|
|
2016-04-21 16:26:00 +08:00
|
|
|
BINS = proxmark3 flasher fpga_compress
|
2017-07-28 02:59:54 +08:00
|
|
|
WINBINS = $(patsubst %, %.exe, $(BINS))
|
2017-07-28 08:45:58 +08:00
|
|
|
CLEAN = $(BINS) $(WINBINS) $(COREOBJS) $(CMDOBJS) $(ZLIBOBJS) $(QTGUIOBJS) $(MULTIARCHOBJS) $(OBJDIR)/*.o *.moc.cpp ui/ui_overlays.h lualibs/usb_cmd.lua lualibs/mf_default_keys.lua
|
2009-12-22 20:52:02 +08:00
|
|
|
|
2017-07-28 02:59:54 +08:00
|
|
|
# need to assign dependancies to build these first...
|
2013-05-22 02:37:43 +08:00
|
|
|
all: lua_build $(BINS)
|
2009-04-09 14:43:20 +08:00
|
|
|
|
2009-09-11 10:25:48 +08:00
|
|
|
all-static: LDLIBS:=-static $(LDLIBS)
|
2017-07-28 02:59:54 +08:00
|
|
|
all-static: proxmark3 flasher fpga_compress
|
2017-07-28 08:05:03 +08:00
|
|
|
|
2015-06-25 18:22:34 +08:00
|
|
|
proxmark3: LDLIBS+=$(LUALIB) $(QTLDLIBS)
|
2017-07-28 08:45:58 +08:00
|
|
|
proxmark3: $(OBJDIR)/proxmark3.o $(COREOBJS) $(CMDOBJS) $(QTGUIOBJS) $(MULTIARCHOBJS) $(ZLIBOBJS) lualibs/usb_cmd.lua lualibs/mf_default_keys.lua
|
2017-07-28 02:59:54 +08:00
|
|
|
$(LD) $(LDFLAGS) $(OBJDIR)/proxmark3.o $(COREOBJS) $(CMDOBJS) $(QTGUIOBJS) $(MULTIARCHOBJS) $(ZLIBOBJS) $(LDLIBS) -o $@
|
2017-07-28 08:05:03 +08:00
|
|
|
|
2013-03-14 23:03:04 +08:00
|
|
|
flasher: $(OBJDIR)/flash.o $(OBJDIR)/flasher.o $(COREOBJS)
|
2017-07-28 02:59:54 +08:00
|
|
|
$(LD) $(LDFLAGS) $^ $(LDLIBS) -o $@
|
2010-02-21 08:16:42 +08:00
|
|
|
|
2015-06-25 18:22:34 +08:00
|
|
|
fpga_compress: $(OBJDIR)/fpga_compress.o $(ZLIBOBJS)
|
2017-07-28 02:59:54 +08:00
|
|
|
$(LD) $(LDFLAGS) $(ZLIBFLAGS) $^ $(LDLIBS) -o $@
|
2010-02-21 08:16:42 +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
|
|
|
|
$(MOC) -o$@ $^
|
|
|
|
|
2017-07-28 02:59:54 +08:00
|
|
|
ui/ui_overlays.h: ui/overlays.ui
|
|
|
|
$(UIC) $^ > $@
|
|
|
|
|
|
|
|
lualibs/usb_cmd.lua: ../include/usb_cmd.h
|
|
|
|
awk -f usb_cmd_h2lua.awk $^ > $@
|
2017-07-28 08:45:58 +08:00
|
|
|
|
|
|
|
lualibs/mf_default_keys.lua : default_keys.dic
|
|
|
|
awk -f default_keys_dic2lua.awk $^ > $@
|
2017-07-28 02:59:54 +08:00
|
|
|
|
2009-04-09 14:43:20 +08:00
|
|
|
clean:
|
2009-12-22 20:52:02 +08:00
|
|
|
$(RM) $(CLEAN)
|
2013-06-26 19:02:37 +08:00
|
|
|
cd ../liblua && make clean
|
2009-04-09 14:43:20 +08:00
|
|
|
|
2010-05-09 20:17:42 +08:00
|
|
|
tarbin: $(BINS)
|
2017-07-28 02:59:54 +08:00
|
|
|
$(TAR) $(TARFLAGS) ../proxmark3-$(platform)-bin.tar $(BINS:%=client/%) $(WINBINS:%=client/%)
|
2010-05-09 20:17:42 +08:00
|
|
|
|
2013-05-22 02:37:43 +08:00
|
|
|
lua_build:
|
2013-06-26 04:25:18 +08:00
|
|
|
@echo Compiling liblua, using platform $(LUAPLATFORM)
|
|
|
|
cd ../liblua && make $(LUAPLATFORM)
|
2013-05-22 02:37:43 +08:00
|
|
|
|
2009-04-09 14:43:20 +08:00
|
|
|
.PHONY: all clean
|
2017-09-19 00:59:51 +08:00
|
|
|
|
|
|
|
# easy printing of MAKE VARIABLES
|
|
|
|
print-%: ; @echo $* = $($*)
|
2017-07-28 02:59:54 +08:00
|
|
|
|
|
|
|
$(OBJDIR)/%_NOSIMD.o : %.c $(OBJDIR)/%.d
|
|
|
|
$(CC) $(DEPFLAGS) $(CFLAGS) $(HARD_SWITCH_NOSIMD) -c -o $@ $<
|
|
|
|
|
|
|
|
$(OBJDIR)/%_MMX.o : %.c $(OBJDIR)/%.d
|
|
|
|
$(CC) $(DEPFLAGS) $(CFLAGS) $(HARD_SWITCH_MMX) -c -o $@ $<
|
|
|
|
|
|
|
|
$(OBJDIR)/%_SSE2.o : %.c $(OBJDIR)/%.d
|
|
|
|
$(CC) $(DEPFLAGS) $(CFLAGS) $(HARD_SWITCH_SSE2) -c -o $@ $<
|
|
|
|
|
|
|
|
$(OBJDIR)/%_AVX.o : %.c $(OBJDIR)/%.d
|
|
|
|
$(CC) $(DEPFLAGS) $(CFLAGS) $(HARD_SWITCH_AVX) -c -o $@ $<
|
|
|
|
|
|
|
|
$(OBJDIR)/%_AVX2.o : %.c $(OBJDIR)/%.d
|
|
|
|
$(CC) $(DEPFLAGS) $(CFLAGS) $(HARD_SWITCH_AVX2) -c -o $@ $<
|
|
|
|
|
|
|
|
$(OBJDIR)/%_AVX512.o : %.c $(OBJDIR)/%.d
|
|
|
|
$(CC) $(DEPFLAGS) $(CFLAGS) $(HARD_SWITCH_AVX512) -c -o $@ $<
|
|
|
|
|
|
|
|
%.o: %.c
|
|
|
|
$(OBJDIR)/%.o : %.c $(OBJDIR)/%.d
|
|
|
|
$(CC) $(DEPFLAGS) $(CFLAGS) $(ZLIBFLAGS) -c -o $@ $<
|
|
|
|
$(POSTCOMPILE)
|
|
|
|
|
|
|
|
%.o: %.cpp
|
|
|
|
$(OBJDIR)/%.o : %.cpp $(OBJDIR)/%.d
|
|
|
|
$(CXX) $(DEPFLAGS) $(CXXFLAGS) $(QTINCLUDES) -c -o $@ $<
|
|
|
|
$(POSTCOMPILE)
|
|
|
|
|
|
|
|
|
|
|
|
#$(CMDOBJS) $(COREOBJS): $(notdir $(%.c)) %.d
|
|
|
|
# $(CC) $(DEPFLAGS) $(CFLAGS) -c -o $@ $<
|
|
|
|
# $(POSTCOMPILE)
|
|
|
|
|
|
|
|
#$(ZLIBOBJS): $(notdir $(%.c)) %.d
|
|
|
|
# $(CC) $(DEPFLAGS) $(CFLAGS) $(ZLIBFLAGS) -c -o $@ $<
|
|
|
|
# $(POSTCOMPILE)
|
|
|
|
|
|
|
|
#$(QTGUIOBJS): $(notdir $(%.cpp)) %.d
|
|
|
|
# $(CXX) $(DEPFLAGS) $(CXXFLAGS) -c -o $@ $<
|
|
|
|
# $(POSTCOMPILE)
|
|
|
|
|
|
|
|
DEPENDENCY_FILES = $(patsubst %.c, $(OBJDIR)/%.d, $(CORESRCS) $(CMDSRCS) $(ZLIBSRCS) $(MULTIARCHSRCS)) \
|
|
|
|
$(patsubst %.cpp, $(OBJDIR)/%.d, $(QTGUISRCS)) \
|
|
|
|
$(OBJDIR)/proxmark3.d $(OBJDIR)/flash.d $(OBJDIR)/flasher.d $(OBJDIR)/fpga_compress.d
|
|
|
|
|
|
|
|
$(DEPENDENCY_FILES): ;
|
|
|
|
.PRECIOUS: $(DEPENDENCY_FILES)
|
|
|
|
|
|
|
|
-include $(DEPENDENCY_FILES)
|