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)
|
|
|
|
|
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-29 04:31:20 +08:00
|
|
|
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)
|
2017-12-24 17:56:17 +08:00
|
|
|
INCLUDES_CLIENT = -I. -I../include -I../common -I../common/polarssl -I../zlib -I../uart -I/opt/local/include -I../liblua
|
2018-02-04 05:58:43 +08:00
|
|
|
CFLAGS = $(ENV_CFLAGS) -std=c99 -D_ISOC99_SOURCE -DPRESETS $(INCLUDES_CLIENT) -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
|
2018-10-06 19:29:20 +08:00
|
|
|
else
|
2017-07-28 02:59:54 +08:00
|
|
|
ifeq ($(platform),Darwin)
|
2015-03-11 02:00:39 +08:00
|
|
|
LUAPLATFORM = macosx
|
2018-10-06 19:29:20 +08:00
|
|
|
OBJCSRCS = util_darwin.m
|
2018-10-07 15:01:24 +08:00
|
|
|
LDFLAGS += -framework Foundation -framework AppKit
|
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
|
|
|
|
2018-05-03 18:15:03 +08:00
|
|
|
# RDV40 flag enables flashmemory commands in client. comment out if you don't have rdv40
|
2018-09-16 00:33:16 +08:00
|
|
|
CFLAGS += -DWITH_FLASH -DWITH_SMARTCARD
|
2018-05-03 18:15:03 +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 \
|
2018-09-07 03:43:20 +08:00
|
|
|
scandir.c \
|
|
|
|
comms.c
|
2017-07-30 15:17:48 +08:00
|
|
|
|
2017-07-28 08:05:03 +08:00
|
|
|
CMDSRCS = crapto1/crapto1.c \
|
|
|
|
crapto1/crypto1.c \
|
|
|
|
mfkey.c \
|
2017-12-24 17:29:50 +08:00
|
|
|
tea.c \
|
|
|
|
polarssl/des.c \
|
|
|
|
polarssl/aes.c \
|
2018-10-26 19:12:20 +08:00
|
|
|
polarssl/aes_cmac128.c \
|
2017-12-24 17:56:17 +08:00
|
|
|
polarssl/bignum.c \
|
|
|
|
polarssl/rsa.c \
|
2017-12-24 17:29:50 +08:00
|
|
|
polarssl/sha1.c \
|
|
|
|
polarssl/sha256.c \
|
2018-05-23 16:37:11 +08:00
|
|
|
polarssl/base64.c \
|
2018-10-24 23:18:05 +08:00
|
|
|
polarssl/libpcrypto.c \
|
2018-10-11 16:48:46 +08:00
|
|
|
cliparser/argtable3.c\
|
|
|
|
cliparser/cliparser.c\
|
2015-12-09 21:57:16 +08:00
|
|
|
loclass/cipher.c \
|
|
|
|
loclass/cipherutils.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 \
|
2016-09-09 17:58:53 +08:00
|
|
|
legic_prng.c \
|
2010-10-19 22:25:17 +08:00
|
|
|
iso15693tools.c \
|
2017-12-24 17:56:17 +08:00
|
|
|
prng.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
|
|
|
graph.c \
|
|
|
|
cmddata.c \
|
2014-12-29 09:33:32 +08:00
|
|
|
lfdemod.c \
|
2017-12-24 17:29:50 +08:00
|
|
|
emv/crypto_polarssl.c\
|
|
|
|
emv/crypto.c\
|
|
|
|
emv/emv_pk.c\
|
|
|
|
emv/emv_pki.c\
|
|
|
|
emv/emv_pki_priv.c\
|
|
|
|
emv/test/cryptotest.c\
|
2017-11-25 15:03:53 +08:00
|
|
|
emv/apduinfo.c \
|
|
|
|
emv/dump.c \
|
|
|
|
emv/tlv.c \
|
|
|
|
emv/emv_tags.c \
|
|
|
|
emv/dol.c \
|
|
|
|
emv/emvcore.c \
|
2017-12-24 17:29:50 +08:00
|
|
|
emv/test/crypto_test.c\
|
|
|
|
emv/test/sda_test.c\
|
|
|
|
emv/test/dda_test.c\
|
|
|
|
emv/test/cda_test.c\
|
2017-11-25 15:03:53 +08:00
|
|
|
emv/cmdemv.c \
|
2018-10-24 23:18:05 +08:00
|
|
|
mifare4.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 \
|
2018-02-15 06:03:39 +08:00
|
|
|
cmdhflist.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
|
|
|
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 \
|
2018-10-24 23:18:05 +08:00
|
|
|
cmdhfmfp.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-10-10 20:59:58 +08:00
|
|
|
cmdhffelica.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 \
|
2018-03-19 01:00:41 +08:00
|
|
|
cmdtrace.c \
|
2018-05-03 18:15:03 +08:00
|
|
|
cmdflashmem.c \
|
2018-07-05 16:48:24 +08:00
|
|
|
cmdsmartcard.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 \
|
|
|
|
protocols.c \
|
|
|
|
cmdcrc.c \
|
|
|
|
reveng/preset.c \
|
|
|
|
reveng/reveng.c \
|
|
|
|
reveng/cli.c \
|
|
|
|
reveng/bmpbit.c \
|
|
|
|
reveng/model.c \
|
|
|
|
reveng/poly.c \
|
2016-06-14 01:05:50 +08:00
|
|
|
bucketsort.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)), )
|
|
|
|
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)
|
2018-10-06 19:29:20 +08:00
|
|
|
OBJCOBJS = $(OBJCSRCS:%.m=$(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-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"
|
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
|
2018-02-08 05:02:04 +08:00
|
|
|
|
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))
|
2018-10-06 19:29:20 +08:00
|
|
|
CLEAN = $(BINS) $(WINBINS) $(COREOBJS) $(CMDOBJS) $(OBJCOBJS) $(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)
|
2018-10-06 19:29:20 +08:00
|
|
|
proxmark3: $(OBJDIR)/proxmark3.o $(COREOBJS) $(CMDOBJS) $(OBJCOBJS) $(QTGUIOBJS) $(MULTIARCHOBJS) $(ZLIBOBJS) lualibs/usb_cmd.lua lualibs/mf_default_keys.lua
|
|
|
|
$(LD) $(LDFLAGS) $(OBJDIR)/proxmark3.o $(COREOBJS) $(CMDOBJS) $(OBJCOBJS) $(QTGUIOBJS) $(MULTIARCHOBJS) $(ZLIBOBJS) $(LDLIBS) -o $@
|
2017-07-28 08:05:03 +08:00
|
|
|
|
2018-10-06 19:29:20 +08:00
|
|
|
flasher: $(OBJDIR)/flash.o $(OBJDIR)/flasher.o $(COREOBJS) $(OBJCOBJS)
|
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)
|
|
|
|
|
2018-10-06 19:29:20 +08:00
|
|
|
%.o: %.m
|
|
|
|
$(OBJDIR)/%.o : %.m $(OBJDIR)/%.d
|
|
|
|
$(CC) $(DEPFLAGS) $(CFLAGS) -c -o $@ $<
|
|
|
|
$(POSTCOMPILE)
|
|
|
|
|
2017-07-28 02:59:54 +08:00
|
|
|
#$(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)) \
|
2018-10-06 19:29:20 +08:00
|
|
|
$(patsubst %.m, $(OBJDIR)/%.d, $(OBJCSRCS)) \
|
2017-07-28 02:59:54 +08:00
|
|
|
$(OBJDIR)/proxmark3.d $(OBJDIR)/flash.d $(OBJDIR)/flasher.d $(OBJDIR)/fpga_compress.d
|
|
|
|
|
|
|
|
$(DEPENDENCY_FILES): ;
|
|
|
|
.PRECIOUS: $(DEPENDENCY_FILES)
|
|
|
|
|
|
|
|
-include $(DEPENDENCY_FILES)
|
2017-11-11 03:47:31 +08:00
|
|
|
|