This commit is contained in:
2015-11-15 18:18:42 +00:00
parent 9ac343fc45
commit 72be7b0c2f
580 changed files with 356252 additions and 6 deletions
+74
View File
@@ -0,0 +1,74 @@
common.o: common.c \
e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/stdio.h \
e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/_mingw.h \
e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/include/stddef.h \
e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/include/stdarg.h \
e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/sys/types.h \
e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/unistd.h \
e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/io.h \
e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/process.h \
e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/stdint.h \
e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/getopt.h \
e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/stdlib.h \
e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/string.h \
e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/errno.h \
../include/librfid/rfid.h ../include/librfid/rfid_scan.h \
../include/librfid/rfid_reader.h ../include/librfid/rfid_asic.h \
../include/librfid/rfid_asic_rc632.h ../include/librfid/rfid_layer2.h \
../include/librfid/rfid_layer2_iso14443a.h \
../include/librfid/rfid_layer2_iso15693.h \
../include/librfid/rfid_protocol.h \
../include/librfid/rfid_protocol_mifare_classic.h \
../include/librfid/rfid_protocol_mifare_ul.h librfid-tool.h common.h
e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/stdio.h:
e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/_mingw.h:
e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/include/stddef.h:
e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/include/stdarg.h:
e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/sys/types.h:
e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/unistd.h:
e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/io.h:
e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/process.h:
e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/stdint.h:
e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/getopt.h:
e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/stdlib.h:
e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/string.h:
e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/errno.h:
../include/librfid/rfid.h:
../include/librfid/rfid_scan.h:
../include/librfid/rfid_reader.h:
../include/librfid/rfid_asic.h:
../include/librfid/rfid_asic_rc632.h:
../include/librfid/rfid_layer2.h:
../include/librfid/rfid_layer2_iso14443a.h:
../include/librfid/rfid_layer2_iso15693.h:
../include/librfid/rfid_protocol.h:
../include/librfid/rfid_protocol_mifare_classic.h:
../include/librfid/rfid_protocol_mifare_ul.h:
librfid-tool.h:
common.h:
+81
View File
@@ -0,0 +1,81 @@
librfid-tool.o: librfid-tool.c \
e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/stdio.h \
e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/_mingw.h \
e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/include/stddef.h \
e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/include/stdarg.h \
e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/sys/types.h \
e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/unistd.h \
e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/io.h \
e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/process.h \
e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/stdint.h \
e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/getopt.h \
e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/stdlib.h \
e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/string.h \
e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/errno.h \
../include/librfid/rfid.h ../include/librfid/rfid_scan.h \
../include/librfid/rfid_reader.h ../include/librfid/rfid_asic.h \
../include/librfid/rfid_asic_rc632.h ../include/librfid/rfid_layer2.h \
../include/librfid/rfid_layer2_iso14443a.h \
../include/librfid/rfid_layer2_iso15693.h \
../include/librfid/rfid_protocol.h \
../include/librfid/rfid_protocol_mifare_classic.h \
../include/librfid/rfid_protocol_mifare_ul.h \
../include/librfid/rfid_protocol_tagit.h \
../include/librfid/rfid_protocol_icode.h \
../include/librfid/rfid_protocol_tcl.h librfid-tool.h
e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/stdio.h:
e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/_mingw.h:
e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/include/stddef.h:
e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/include/stdarg.h:
e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/sys/types.h:
e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/unistd.h:
e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/io.h:
e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/process.h:
e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/stdint.h:
e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/getopt.h:
e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/stdlib.h:
e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/string.h:
e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/errno.h:
../include/librfid/rfid.h:
../include/librfid/rfid_scan.h:
../include/librfid/rfid_reader.h:
../include/librfid/rfid_asic.h:
../include/librfid/rfid_asic_rc632.h:
../include/librfid/rfid_layer2.h:
../include/librfid/rfid_layer2_iso14443a.h:
../include/librfid/rfid_layer2_iso15693.h:
../include/librfid/rfid_protocol.h:
../include/librfid/rfid_protocol_mifare_classic.h:
../include/librfid/rfid_protocol_mifare_ul.h:
../include/librfid/rfid_protocol_tagit.h:
../include/librfid/rfid_protocol_icode.h:
../include/librfid/rfid_protocol_tcl.h:
librfid-tool.h:
+75
View File
@@ -0,0 +1,75 @@
mifare-tool.o: mifare-tool.c \
e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/stdio.h \
e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/_mingw.h \
e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/include/stddef.h \
e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/include/stdarg.h \
e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/sys/types.h \
e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/unistd.h \
e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/io.h \
e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/process.h \
e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/stdint.h \
e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/getopt.h \
e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/stdlib.h \
e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/string.h \
e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/errno.h \
../include/librfid/rfid.h ../include/librfid/rfid_scan.h \
../include/librfid/rfid_reader.h ../include/librfid/rfid_asic.h \
../include/librfid/rfid_asic_rc632.h ../include/librfid/rfid_layer2.h \
../include/librfid/rfid_layer2_iso14443a.h \
../include/librfid/rfid_layer2_iso15693.h \
../include/librfid/rfid_protocol.h \
../include/librfid/rfid_protocol_mifare_classic.h \
../include/librfid/rfid_protocol_mifare_ul.h \
../include/librfid/rfid_access_mifare_classic.h librfid-tool.h
e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/stdio.h:
e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/_mingw.h:
e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/include/stddef.h:
e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/include/stdarg.h:
e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/sys/types.h:
e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/unistd.h:
e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/io.h:
e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/process.h:
e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/stdint.h:
e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/getopt.h:
e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/stdlib.h:
e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/string.h:
e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/errno.h:
../include/librfid/rfid.h:
../include/librfid/rfid_scan.h:
../include/librfid/rfid_reader.h:
../include/librfid/rfid_asic.h:
../include/librfid/rfid_asic_rc632.h:
../include/librfid/rfid_layer2.h:
../include/librfid/rfid_layer2_iso14443a.h:
../include/librfid/rfid_layer2_iso15693.h:
../include/librfid/rfid_protocol.h:
../include/librfid/rfid_protocol_mifare_classic.h:
../include/librfid/rfid_protocol_mifare_ul.h:
../include/librfid/rfid_access_mifare_classic.h:
librfid-tool.h:
+71
View File
@@ -0,0 +1,71 @@
send_script.o: send_script.c \
e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/stdio.h \
e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/_mingw.h \
e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/include/stddef.h \
e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/include/stdarg.h \
e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/sys/types.h \
e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/unistd.h \
e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/io.h \
e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/process.h \
e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/stdint.h \
e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/getopt.h \
e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/stdlib.h \
e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/string.h \
e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/errno.h \
e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/ctype.h \
../include/librfid/rfid.h ../include/librfid/rfid_reader.h \
../include/librfid/rfid_asic.h ../include/librfid/rfid_asic_rc632.h \
../include/librfid/rfid_layer2.h \
../include/librfid/rfid_layer2_iso14443a.h \
../include/librfid/rfid_layer2_iso15693.h \
../include/librfid/rfid_protocol.h \
../include/librfid/rfid_protocol_mifare_classic.h \
../include/librfid/rfid_protocol_mifare_ul.h
e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/stdio.h:
e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/_mingw.h:
e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/include/stddef.h:
e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/include/stdarg.h:
e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/sys/types.h:
e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/unistd.h:
e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/io.h:
e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/process.h:
e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/stdint.h:
e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/getopt.h:
e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/stdlib.h:
e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/string.h:
e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/errno.h:
e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/ctype.h:
../include/librfid/rfid.h:
../include/librfid/rfid_reader.h:
../include/librfid/rfid_asic.h:
../include/librfid/rfid_asic_rc632.h:
../include/librfid/rfid_layer2.h:
../include/librfid/rfid_layer2_iso14443a.h:
../include/librfid/rfid_layer2_iso15693.h:
../include/librfid/rfid_protocol.h:
../include/librfid/rfid_protocol_mifare_classic.h:
../include/librfid/rfid_protocol_mifare_ul.h:
+642
View File
@@ -0,0 +1,642 @@
# Makefile.in generated by automake 1.11.1 from Makefile.am.
# utils/Makefile. Generated from Makefile.in by configure.
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation,
# Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE.
pkgdatadir = $(datadir)/librfid
pkgincludedir = $(includedir)/librfid
pkglibdir = $(libdir)/librfid
pkglibexecdir = $(libexecdir)/librfid
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
install_sh_DATA = $(install_sh) -c -m 644
install_sh_PROGRAM = $(install_sh) -c
install_sh_SCRIPT = $(install_sh) -c
INSTALL_HEADER = $(INSTALL_DATA)
transform = $(program_transform_name)
NORMAL_INSTALL = :
PRE_INSTALL = :
POST_INSTALL = :
NORMAL_UNINSTALL = :
PRE_UNINSTALL = :
POST_UNINSTALL = :
build_triplet = i686-pc-mingw32
host_triplet = i686-pc-mingw32
target_triplet = i686-pc-mingw32
DIST_COMMON = $(noinst_HEADERS) $(srcdir)/Makefile.am \
$(srcdir)/Makefile.in $(top_srcdir)/Makefile.flags.am
#am__append_1 = -mno-cygwin
#am__append_2 = -lusb
#am__append_3 = -DHAVE_LIBUSB
#am__append_4 = -DLIBRFID_FIRMWARE
bin_PROGRAMS = librfid-tool$(EXEEXT) mifare-tool$(EXEEXT) \
librfid-send_script$(EXEEXT)
subdir = utils
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/configure.in
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
mkinstalldirs = $(install_sh) -d
CONFIG_CLEAN_FILES =
CONFIG_CLEAN_VPATH_FILES =
am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(man1dir)"
PROGRAMS = $(bin_PROGRAMS)
am_librfid_send_script_OBJECTS = send_script.$(OBJEXT)
librfid_send_script_OBJECTS = $(am_librfid_send_script_OBJECTS)
librfid_send_script_DEPENDENCIES = ../src/librfid.la
librfid_send_script_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \
$(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
$(librfid_send_script_LDFLAGS) $(LDFLAGS) -o $@
am_librfid_tool_OBJECTS = librfid-tool.$(OBJEXT) common.$(OBJEXT)
librfid_tool_OBJECTS = $(am_librfid_tool_OBJECTS)
librfid_tool_DEPENDENCIES = ../src/librfid.la
librfid_tool_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \
$(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
$(librfid_tool_LDFLAGS) $(LDFLAGS) -o $@
am_mifare_tool_OBJECTS = mifare-tool.$(OBJEXT) common.$(OBJEXT)
mifare_tool_OBJECTS = $(am_mifare_tool_OBJECTS)
mifare_tool_DEPENDENCIES = ../src/librfid.la
mifare_tool_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \
$(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
$(mifare_tool_LDFLAGS) $(LDFLAGS) -o $@
DEFAULT_INCLUDES = -I.
depcomp = $(SHELL) $(top_srcdir)/depcomp
am__depfiles_maybe = depfiles
am__mv = mv -f
COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
--mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
CCLD = $(CC)
LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
--mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \
$(LDFLAGS) -o $@
SOURCES = $(librfid_send_script_SOURCES) $(librfid_tool_SOURCES) \
$(mifare_tool_SOURCES)
DIST_SOURCES = $(librfid_send_script_SOURCES) $(librfid_tool_SOURCES) \
$(mifare_tool_SOURCES)
am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
am__vpath_adj = case $$p in \
$(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
*) f=$$p;; \
esac;
am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
am__install_max = 40
am__nobase_strip_setup = \
srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
am__nobase_strip = \
for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
am__nobase_list = $(am__nobase_strip_setup); \
for p in $$list; do echo "$$p $$p"; done | \
sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
$(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
if (++n[$$2] == $(am__install_max)) \
{ print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
END { for (dir in files) print dir, files[dir] }'
am__base_list = \
sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
man1dir = $(mandir)/man1
NROFF = nroff
MANS = $(man_MANS)
HEADERS = $(noinst_HEADERS)
ETAGS = etags
CTAGS = ctags
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
ACLOCAL = ${SHELL} "/D/Visual Studio 2010/Projects/Matomat/librfid/missing" --run aclocal-1.11
AMTAR = ${SHELL} "/D/Visual Studio 2010/Projects/Matomat/librfid/missing" --run tar
AR = ar
AS = as
AUTOCONF = ${SHELL} "/D/Visual Studio 2010/Projects/Matomat/librfid/missing" --run autoconf
AUTOHEADER = ${SHELL} "/D/Visual Studio 2010/Projects/Matomat/librfid/missing" --run autoheader
AUTOMAKE = ${SHELL} "/D/Visual Studio 2010/Projects/Matomat/librfid/missing" --run automake-1.11
AWK = gawk
BUILDENV = UNIX
CC = gcc
CCDEPMODE = depmode=gcc3
CFLAGS = -g -O2
CPP = gcc -E
CPPFLAGS =
CYGPATH_W = echo
DEFS = -DPACKAGE_NAME=\"\" -DPACKAGE_TARNAME=\"\" -DPACKAGE_VERSION=\"\" -DPACKAGE_STRING=\"\" -DPACKAGE_BUGREPORT=\"\" -DPACKAGE_URL=\"\" -DPACKAGE=\"librfid\" -DVERSION=\"0.2.0\" -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DLT_OBJDIR=\".libs/\"
DEPDIR = .deps
DLLTOOL = dlltool
DSYMUTIL =
DUMPBIN =
ECHO_C =
ECHO_N = -n
ECHO_T =
EGREP = /bin/grep -E
EXEEXT = .exe
FGREP = /bin/grep -F
FIRMWARE_PATH =
GREP = /bin/grep
INSTALL = /bin/install -c
INSTALL_DATA = ${INSTALL} -m 644
INSTALL_PROGRAM = ${INSTALL}
INSTALL_SCRIPT = ${INSTALL}
INSTALL_STRIP_PROGRAM = $(install_sh) -c -s
LD = e:/programme/mingw/mingw32/bin/ld.exe
LDFLAGS =
LIBOBJS =
LIBS = $(am__append_2)
LIBTOOL = $(SHELL) $(top_builddir)/libtool
LIBTOOL_DEPS = ./ltmain.sh
LIPO =
LN_S = cp -p
LTLIBOBJS =
MAKEINFO = ${SHELL} "/D/Visual Studio 2010/Projects/Matomat/librfid/missing" --run makeinfo
MANIFEST_TOOL = :
MKDIR_P = /bin/mkdir -p
NM = /mingw/bin/nm
NMEDIT =
OBJDUMP = objdump
OBJEXT = o
OPENCT_CFLAGS =
OPENCT_LIBS =
OTOOL =
OTOOL64 =
PACKAGE = librfid
PACKAGE_BUGREPORT =
PACKAGE_NAME =
PACKAGE_STRING =
PACKAGE_TARNAME =
PACKAGE_URL =
PACKAGE_VERSION =
PATH_SEPARATOR = :
RANLIB = ranlib
SED = /bin/sed
SET_MAKE =
SHELL = /bin/sh
STRIP = strip
VERSION = 0.2.0
abs_builddir = /D/Visual Studio 2010/Projects/Matomat/librfid/utils
abs_srcdir = /D/Visual Studio 2010/Projects/Matomat/librfid/utils
abs_top_builddir = /D/Visual Studio 2010/Projects/Matomat/librfid
abs_top_srcdir = /D/Visual Studio 2010/Projects/Matomat/librfid
ac_ct_AR = ar
ac_ct_CC = gcc
ac_ct_DUMPBIN =
am__include = include
am__leading_dot = .
am__quote =
am__tar = ${AMTAR} chof - "$$tardir"
am__untar = ${AMTAR} xf -
bindir = ${exec_prefix}/bin
build = i686-pc-mingw32
build_alias =
build_cpu = i686
build_os = mingw32
build_vendor = pc
builddir = .
datadir = ${datarootdir}
datarootdir = ${prefix}/share
docdir = ${datarootdir}/doc/${PACKAGE}
dvidir = ${docdir}
exec_prefix = ${prefix}
host = i686-pc-mingw32
host_alias =
host_cpu = i686
host_os = mingw32
host_vendor = pc
htmldir = ${docdir}
includedir = ${prefix}/include
infodir = ${datarootdir}/info
install_sh = ${SHELL} '/D/Visual Studio 2010/Projects/Matomat/librfid/install-sh'
libdir = ${exec_prefix}/lib
libexecdir = ${exec_prefix}/libexec
localedir = ${datarootdir}/locale
localstatedir = ${prefix}/var
mandir = ${datarootdir}/man
mkdir_p = /bin/mkdir -p
oldincludedir = /usr/include
pdfdir = ${docdir}
prefix = /usr/local
program_transform_name = s,x,x,
psdir = ${docdir}
sbindir = ${exec_prefix}/sbin
sharedstatedir = ${prefix}/com
srcdir = .
sysconfdir = ${prefix}/etc
target = i686-pc-mingw32
target_alias =
target_cpu = i686
target_os = mingw32
target_vendor = pc
top_build_prefix = ../
top_builddir = ..
top_srcdir = ..
LIBVERSION = 0:0:0
AM_CFLAGS = -std=gnu99 $(am__append_1) $(am__append_3) $(am__append_4)
INCLUDES = $(all_includes) -I$(top_srcdir)/include
#AM_LDFLAGS = -mno-cygwin
man_MANS = librfid-tool.1 mifare-tool.1 librfid-send_script.1
EXTRA_DIST = $(man_MANS)
noinst_HEADERS = librfid-tool.h common.h
librfid_tool_SOURCES = librfid-tool.c librfid-tool.h common.c common.h
librfid_tool_LDADD = ../src/librfid.la
librfid_send_script_SOURCES = send_script.c
librfid_send_script_LDADD = ../src/librfid.la
mifare_tool_SOURCES = mifare-tool.c common.c
mifare_tool_LDADD = ../src/librfid.la
#LINKOPTS = -dynamic -mno-cygwin
#librfid_send_script_LDFLAGS = $(LINKOPTS)
#librfid_tool_LDFLAGS = $(LINKOPTS)
#mifare_tool_LDFLAGS = $(LINKOPTS)
all: all-am
.SUFFIXES:
.SUFFIXES: .c .lo .o .obj
$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(top_srcdir)/Makefile.flags.am $(am__configure_deps)
@for dep in $?; do \
case '$(am__configure_deps)' in \
*$$dep*) \
( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
&& { if test -f $@; then exit 0; else break; fi; }; \
exit 1;; \
esac; \
done; \
echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu utils/Makefile'; \
$(am__cd) $(top_srcdir) && \
$(AUTOMAKE) --gnu utils/Makefile
.PRECIOUS: Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@case '$?' in \
*config.status*) \
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
*) \
echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
esac;
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(top_srcdir)/configure: $(am__configure_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(ACLOCAL_M4): $(am__aclocal_m4_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(am__aclocal_m4_deps):
install-binPROGRAMS: $(bin_PROGRAMS)
@$(NORMAL_INSTALL)
test -z "$(bindir)" || $(MKDIR_P) "$(DESTDIR)$(bindir)"
@list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \
for p in $$list; do echo "$$p $$p"; done | \
sed 's/$(EXEEXT)$$//' | \
while read p p1; do if test -f $$p || test -f $$p1; \
then echo "$$p"; echo "$$p"; else :; fi; \
done | \
sed -e 'p;s,.*/,,;n;h' -e 's|.*|.|' \
-e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \
sed 'N;N;N;s,\n, ,g' | \
$(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \
{ d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \
if ($$2 == $$4) files[d] = files[d] " " $$1; \
else { print "f", $$3 "/" $$4, $$1; } } \
END { for (d in files) print "f", d, files[d] }' | \
while read type dir files; do \
if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \
test -z "$$files" || { \
echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \
$(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \
} \
; done
uninstall-binPROGRAMS:
@$(NORMAL_UNINSTALL)
@list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \
files=`for p in $$list; do echo "$$p"; done | \
sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \
-e 's/$$/$(EXEEXT)/' `; \
test -n "$$list" || exit 0; \
echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \
cd "$(DESTDIR)$(bindir)" && rm -f $$files
clean-binPROGRAMS:
@list='$(bin_PROGRAMS)'; test -n "$$list" || exit 0; \
echo " rm -f" $$list; \
rm -f $$list || exit $$?; \
test -n "$(EXEEXT)" || exit 0; \
list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \
echo " rm -f" $$list; \
rm -f $$list
librfid-send_script$(EXEEXT): $(librfid_send_script_OBJECTS) $(librfid_send_script_DEPENDENCIES)
@rm -f librfid-send_script$(EXEEXT)
$(librfid_send_script_LINK) $(librfid_send_script_OBJECTS) $(librfid_send_script_LDADD) $(LIBS)
librfid-tool$(EXEEXT): $(librfid_tool_OBJECTS) $(librfid_tool_DEPENDENCIES)
@rm -f librfid-tool$(EXEEXT)
$(librfid_tool_LINK) $(librfid_tool_OBJECTS) $(librfid_tool_LDADD) $(LIBS)
mifare-tool$(EXEEXT): $(mifare_tool_OBJECTS) $(mifare_tool_DEPENDENCIES)
@rm -f mifare-tool$(EXEEXT)
$(mifare_tool_LINK) $(mifare_tool_OBJECTS) $(mifare_tool_LDADD) $(LIBS)
mostlyclean-compile:
-rm -f *.$(OBJEXT)
distclean-compile:
-rm -f *.tab.c
include ./$(DEPDIR)/common.Po
include ./$(DEPDIR)/librfid-tool.Po
include ./$(DEPDIR)/mifare-tool.Po
include ./$(DEPDIR)/send_script.Po
.c.o:
$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
# source='$<' object='$@' libtool=no \
# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \
# $(COMPILE) -c $<
.c.obj:
$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
# source='$<' object='$@' libtool=no \
# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \
# $(COMPILE) -c `$(CYGPATH_W) '$<'`
.c.lo:
$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
# source='$<' object='$@' libtool=yes \
# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \
# $(LTCOMPILE) -c -o $@ $<
mostlyclean-libtool:
-rm -f *.lo
clean-libtool:
-rm -rf .libs _libs
install-man1: $(man_MANS)
@$(NORMAL_INSTALL)
test -z "$(man1dir)" || $(MKDIR_P) "$(DESTDIR)$(man1dir)"
@list=''; test -n "$(man1dir)" || exit 0; \
{ for i in $$list; do echo "$$i"; done; \
l2='$(man_MANS)'; for i in $$l2; do echo "$$i"; done | \
sed -n '/\.1[a-z]*$$/p'; \
} | while read p; do \
if test -f $$p; then d=; else d="$(srcdir)/"; fi; \
echo "$$d$$p"; echo "$$p"; \
done | \
sed -e 'n;s,.*/,,;p;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \
-e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,' | \
sed 'N;N;s,\n, ,g' | { \
list=; while read file base inst; do \
if test "$$base" = "$$inst"; then list="$$list $$file"; else \
echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man1dir)/$$inst'"; \
$(INSTALL_DATA) "$$file" "$(DESTDIR)$(man1dir)/$$inst" || exit $$?; \
fi; \
done; \
for i in $$list; do echo "$$i"; done | $(am__base_list) | \
while read files; do \
test -z "$$files" || { \
echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(man1dir)'"; \
$(INSTALL_DATA) $$files "$(DESTDIR)$(man1dir)" || exit $$?; }; \
done; }
uninstall-man1:
@$(NORMAL_UNINSTALL)
@list=''; test -n "$(man1dir)" || exit 0; \
files=`{ for i in $$list; do echo "$$i"; done; \
l2='$(man_MANS)'; for i in $$l2; do echo "$$i"; done | \
sed -n '/\.1[a-z]*$$/p'; \
} | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \
-e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \
test -z "$$files" || { \
echo " ( cd '$(DESTDIR)$(man1dir)' && rm -f" $$files ")"; \
cd "$(DESTDIR)$(man1dir)" && rm -f $$files; }
ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) '{ files[$$0] = 1; nonempty = 1; } \
END { if (nonempty) { for (i in files) print i; }; }'`; \
mkid -fID $$unique
tags: TAGS
TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
$(TAGS_FILES) $(LISP)
set x; \
here=`pwd`; \
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) '{ files[$$0] = 1; nonempty = 1; } \
END { if (nonempty) { for (i in files) print i; }; }'`; \
shift; \
if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
test -n "$$unique" || unique=$$empty_fix; \
if test $$# -gt 0; then \
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
"$$@" $$unique; \
else \
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
$$unique; \
fi; \
fi
ctags: CTAGS
CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
$(TAGS_FILES) $(LISP)
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) '{ files[$$0] = 1; nonempty = 1; } \
END { if (nonempty) { for (i in files) print i; }; }'`; \
test -z "$(CTAGS_ARGS)$$unique" \
|| $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
$$unique
GTAGS:
here=`$(am__cd) $(top_builddir) && pwd` \
&& $(am__cd) $(top_srcdir) \
&& gtags -i $(GTAGS_ARGS) "$$here"
distclean-tags:
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
distdir: $(DISTFILES)
@list='$(MANS)'; if test -n "$$list"; then \
list=`for p in $$list; do \
if test -f $$p; then d=; else d="$(srcdir)/"; fi; \
if test -f "$$d$$p"; then echo "$$d$$p"; else :; fi; done`; \
if test -n "$$list" && \
grep 'ab help2man is required to generate this page' $$list >/dev/null; then \
echo "error: found man pages containing the \`missing help2man' replacement text:" >&2; \
grep -l 'ab help2man is required to generate this page' $$list | sed 's/^/ /' >&2; \
echo " to fix them, install help2man, remove and regenerate the man pages;" >&2; \
echo " typically \`make maintainer-clean' will remove them" >&2; \
exit 1; \
else :; fi; \
else :; fi
@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
list='$(DISTFILES)'; \
dist_files=`for file in $$list; do echo $$file; done | \
sed -e "s|^$$srcdirstrip/||;t" \
-e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
case $$dist_files in \
*/*) $(MKDIR_P) `echo "$$dist_files" | \
sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
sort -u` ;; \
esac; \
for file in $$dist_files; do \
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
if test -d $$d/$$file; then \
dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
if test -d "$(distdir)/$$file"; then \
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
fi; \
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
fi; \
cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
else \
test -f "$(distdir)/$$file" \
|| cp -p $$d/$$file "$(distdir)/$$file" \
|| exit 1; \
fi; \
done
check-am: all-am
check: check-am
all-am: Makefile $(PROGRAMS) $(MANS) $(HEADERS)
installdirs:
for dir in "$(DESTDIR)$(bindir)" "$(DESTDIR)$(man1dir)"; do \
test -z "$$dir" || $(MKDIR_P) "$$dir"; \
done
install: install-am
install-exec: install-exec-am
install-data: install-data-am
uninstall: uninstall-am
install-am: all-am
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
installcheck: installcheck-am
install-strip:
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
`test -z '$(STRIP)' || \
echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
mostlyclean-generic:
clean-generic:
distclean-generic:
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
maintainer-clean-generic:
@echo "This command is intended for maintainers to use"
@echo "it deletes files that may require special tools to rebuild."
clean: clean-am
clean-am: clean-binPROGRAMS clean-generic clean-libtool mostlyclean-am
distclean: distclean-am
-rm -rf ./$(DEPDIR)
-rm -f Makefile
distclean-am: clean-am distclean-compile distclean-generic \
distclean-tags
dvi: dvi-am
dvi-am:
html: html-am
html-am:
info: info-am
info-am:
install-data-am: install-man
install-dvi: install-dvi-am
install-dvi-am:
install-exec-am: install-binPROGRAMS
install-html: install-html-am
install-html-am:
install-info: install-info-am
install-info-am:
install-man: install-man1
install-pdf: install-pdf-am
install-pdf-am:
install-ps: install-ps-am
install-ps-am:
installcheck-am:
maintainer-clean: maintainer-clean-am
-rm -rf ./$(DEPDIR)
-rm -f Makefile
maintainer-clean-am: distclean-am maintainer-clean-generic
mostlyclean: mostlyclean-am
mostlyclean-am: mostlyclean-compile mostlyclean-generic \
mostlyclean-libtool
pdf: pdf-am
pdf-am:
ps: ps-am
ps-am:
uninstall-am: uninstall-binPROGRAMS uninstall-man
uninstall-man: uninstall-man1
.MAKE: install-am install-strip
.PHONY: CTAGS GTAGS all all-am check check-am clean clean-binPROGRAMS \
clean-generic clean-libtool ctags distclean distclean-compile \
distclean-generic distclean-libtool distclean-tags distdir dvi \
dvi-am html html-am info info-am install install-am \
install-binPROGRAMS install-data install-data-am install-dvi \
install-dvi-am install-exec install-exec-am install-html \
install-html-am install-info install-info-am install-man \
install-man1 install-pdf install-pdf-am install-ps \
install-ps-am install-strip installcheck installcheck-am \
installdirs maintainer-clean maintainer-clean-generic \
mostlyclean mostlyclean-compile mostlyclean-generic \
mostlyclean-libtool pdf pdf-am ps ps-am tags uninstall \
uninstall-am uninstall-binPROGRAMS uninstall-man \
uninstall-man1
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:
+25
View File
@@ -0,0 +1,25 @@
include $(top_srcdir)/Makefile.flags.am
man_MANS = librfid-tool.1 mifare-tool.1 librfid-send_script.1
EXTRA_DIST = $(man_MANS)
bin_PROGRAMS = librfid-tool mifare-tool librfid-send_script
noinst_HEADERS = librfid-tool.h common.h
librfid_tool_SOURCES = librfid-tool.c librfid-tool.h common.c common.h
librfid_tool_LDADD = ../src/librfid.la
librfid_send_script_SOURCES= send_script.c
librfid_send_script_LDADD = ../src/librfid.la
mifare_tool_SOURCES = mifare-tool.c common.c
mifare_tool_LDADD = ../src/librfid.la
if ENABLE_WIN32
LINKOPTS = -dynamic -mno-cygwin
librfid_send_script_LDFLAGS = $(LINKOPTS)
librfid_tool_LDFLAGS = $(LINKOPTS)
mifare_tool_LDFLAGS = $(LINKOPTS)
endif
+642
View File
@@ -0,0 +1,642 @@
# Makefile.in generated by automake 1.11.1 from Makefile.am.
# @configure_input@
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation,
# Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE.
@SET_MAKE@
VPATH = @srcdir@
pkgdatadir = $(datadir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
pkglibexecdir = $(libexecdir)/@PACKAGE@
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
install_sh_DATA = $(install_sh) -c -m 644
install_sh_PROGRAM = $(install_sh) -c
install_sh_SCRIPT = $(install_sh) -c
INSTALL_HEADER = $(INSTALL_DATA)
transform = $(program_transform_name)
NORMAL_INSTALL = :
PRE_INSTALL = :
POST_INSTALL = :
NORMAL_UNINSTALL = :
PRE_UNINSTALL = :
POST_UNINSTALL = :
build_triplet = @build@
host_triplet = @host@
target_triplet = @target@
DIST_COMMON = $(noinst_HEADERS) $(srcdir)/Makefile.am \
$(srcdir)/Makefile.in $(top_srcdir)/Makefile.flags.am
@ENABLE_WIN32_TRUE@am__append_1 = -mno-cygwin
@ENABLE_WIN32_FALSE@@HAVE_LIBUSB_TRUE@am__append_2 = -lusb
@ENABLE_WIN32_FALSE@@HAVE_LIBUSB_TRUE@am__append_3 = -DHAVE_LIBUSB
@ENABLE_FIRMWARE_TRUE@am__append_4 = -DLIBRFID_FIRMWARE
bin_PROGRAMS = librfid-tool$(EXEEXT) mifare-tool$(EXEEXT) \
librfid-send_script$(EXEEXT)
subdir = utils
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/configure.in
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
mkinstalldirs = $(install_sh) -d
CONFIG_CLEAN_FILES =
CONFIG_CLEAN_VPATH_FILES =
am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(man1dir)"
PROGRAMS = $(bin_PROGRAMS)
am_librfid_send_script_OBJECTS = send_script.$(OBJEXT)
librfid_send_script_OBJECTS = $(am_librfid_send_script_OBJECTS)
librfid_send_script_DEPENDENCIES = ../src/librfid.la
librfid_send_script_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \
$(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
$(librfid_send_script_LDFLAGS) $(LDFLAGS) -o $@
am_librfid_tool_OBJECTS = librfid-tool.$(OBJEXT) common.$(OBJEXT)
librfid_tool_OBJECTS = $(am_librfid_tool_OBJECTS)
librfid_tool_DEPENDENCIES = ../src/librfid.la
librfid_tool_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \
$(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
$(librfid_tool_LDFLAGS) $(LDFLAGS) -o $@
am_mifare_tool_OBJECTS = mifare-tool.$(OBJEXT) common.$(OBJEXT)
mifare_tool_OBJECTS = $(am_mifare_tool_OBJECTS)
mifare_tool_DEPENDENCIES = ../src/librfid.la
mifare_tool_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \
$(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
$(mifare_tool_LDFLAGS) $(LDFLAGS) -o $@
DEFAULT_INCLUDES = -I.@am__isrc@
depcomp = $(SHELL) $(top_srcdir)/depcomp
am__depfiles_maybe = depfiles
am__mv = mv -f
COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
--mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
CCLD = $(CC)
LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
--mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \
$(LDFLAGS) -o $@
SOURCES = $(librfid_send_script_SOURCES) $(librfid_tool_SOURCES) \
$(mifare_tool_SOURCES)
DIST_SOURCES = $(librfid_send_script_SOURCES) $(librfid_tool_SOURCES) \
$(mifare_tool_SOURCES)
am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
am__vpath_adj = case $$p in \
$(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
*) f=$$p;; \
esac;
am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
am__install_max = 40
am__nobase_strip_setup = \
srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
am__nobase_strip = \
for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
am__nobase_list = $(am__nobase_strip_setup); \
for p in $$list; do echo "$$p $$p"; done | \
sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
$(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
if (++n[$$2] == $(am__install_max)) \
{ print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
END { for (dir in files) print dir, files[dir] }'
am__base_list = \
sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
man1dir = $(mandir)/man1
NROFF = nroff
MANS = $(man_MANS)
HEADERS = $(noinst_HEADERS)
ETAGS = etags
CTAGS = ctags
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
ACLOCAL = @ACLOCAL@
AMTAR = @AMTAR@
AR = @AR@
AS = @AS@
AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
AWK = @AWK@
BUILDENV = @BUILDENV@
CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
CYGPATH_W = @CYGPATH_W@
DEFS = @DEFS@
DEPDIR = @DEPDIR@
DLLTOOL = @DLLTOOL@
DSYMUTIL = @DSYMUTIL@
DUMPBIN = @DUMPBIN@
ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
EGREP = @EGREP@
EXEEXT = @EXEEXT@
FGREP = @FGREP@
FIRMWARE_PATH = @FIRMWARE_PATH@
GREP = @GREP@
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
LD = @LD@
LDFLAGS = @LDFLAGS@
LIBOBJS = @LIBOBJS@
LIBS = @LIBS@ $(am__append_2)
LIBTOOL = @LIBTOOL@
LIBTOOL_DEPS = @LIBTOOL_DEPS@
LIPO = @LIPO@
LN_S = @LN_S@
LTLIBOBJS = @LTLIBOBJS@
MAKEINFO = @MAKEINFO@
MANIFEST_TOOL = @MANIFEST_TOOL@
MKDIR_P = @MKDIR_P@
NM = @NM@
NMEDIT = @NMEDIT@
OBJDUMP = @OBJDUMP@
OBJEXT = @OBJEXT@
OPENCT_CFLAGS = @OPENCT_CFLAGS@
OPENCT_LIBS = @OPENCT_LIBS@
OTOOL = @OTOOL@
OTOOL64 = @OTOOL64@
PACKAGE = @PACKAGE@
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
PACKAGE_NAME = @PACKAGE_NAME@
PACKAGE_STRING = @PACKAGE_STRING@
PACKAGE_TARNAME = @PACKAGE_TARNAME@
PACKAGE_URL = @PACKAGE_URL@
PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
RANLIB = @RANLIB@
SED = @SED@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
STRIP = @STRIP@
VERSION = @VERSION@
abs_builddir = @abs_builddir@
abs_srcdir = @abs_srcdir@
abs_top_builddir = @abs_top_builddir@
abs_top_srcdir = @abs_top_srcdir@
ac_ct_AR = @ac_ct_AR@
ac_ct_CC = @ac_ct_CC@
ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
am__include = @am__include@
am__leading_dot = @am__leading_dot@
am__quote = @am__quote@
am__tar = @am__tar@
am__untar = @am__untar@
bindir = @bindir@
build = @build@
build_alias = @build_alias@
build_cpu = @build_cpu@
build_os = @build_os@
build_vendor = @build_vendor@
builddir = @builddir@
datadir = @datadir@
datarootdir = @datarootdir@
docdir = @docdir@
dvidir = @dvidir@
exec_prefix = @exec_prefix@
host = @host@
host_alias = @host_alias@
host_cpu = @host_cpu@
host_os = @host_os@
host_vendor = @host_vendor@
htmldir = @htmldir@
includedir = @includedir@
infodir = @infodir@
install_sh = @install_sh@
libdir = @libdir@
libexecdir = @libexecdir@
localedir = @localedir@
localstatedir = @localstatedir@
mandir = @mandir@
mkdir_p = @mkdir_p@
oldincludedir = @oldincludedir@
pdfdir = @pdfdir@
prefix = @prefix@
program_transform_name = @program_transform_name@
psdir = @psdir@
sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
srcdir = @srcdir@
sysconfdir = @sysconfdir@
target = @target@
target_alias = @target_alias@
target_cpu = @target_cpu@
target_os = @target_os@
target_vendor = @target_vendor@
top_build_prefix = @top_build_prefix@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
LIBVERSION = 0:0:0
AM_CFLAGS = -std=gnu99 $(am__append_1) $(am__append_3) $(am__append_4)
INCLUDES = $(all_includes) -I$(top_srcdir)/include
@ENABLE_WIN32_TRUE@AM_LDFLAGS = -mno-cygwin
man_MANS = librfid-tool.1 mifare-tool.1 librfid-send_script.1
EXTRA_DIST = $(man_MANS)
noinst_HEADERS = librfid-tool.h common.h
librfid_tool_SOURCES = librfid-tool.c librfid-tool.h common.c common.h
librfid_tool_LDADD = ../src/librfid.la
librfid_send_script_SOURCES = send_script.c
librfid_send_script_LDADD = ../src/librfid.la
mifare_tool_SOURCES = mifare-tool.c common.c
mifare_tool_LDADD = ../src/librfid.la
@ENABLE_WIN32_TRUE@LINKOPTS = -dynamic -mno-cygwin
@ENABLE_WIN32_TRUE@librfid_send_script_LDFLAGS = $(LINKOPTS)
@ENABLE_WIN32_TRUE@librfid_tool_LDFLAGS = $(LINKOPTS)
@ENABLE_WIN32_TRUE@mifare_tool_LDFLAGS = $(LINKOPTS)
all: all-am
.SUFFIXES:
.SUFFIXES: .c .lo .o .obj
$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(top_srcdir)/Makefile.flags.am $(am__configure_deps)
@for dep in $?; do \
case '$(am__configure_deps)' in \
*$$dep*) \
( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
&& { if test -f $@; then exit 0; else break; fi; }; \
exit 1;; \
esac; \
done; \
echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu utils/Makefile'; \
$(am__cd) $(top_srcdir) && \
$(AUTOMAKE) --gnu utils/Makefile
.PRECIOUS: Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@case '$?' in \
*config.status*) \
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
*) \
echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
esac;
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(top_srcdir)/configure: $(am__configure_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(ACLOCAL_M4): $(am__aclocal_m4_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(am__aclocal_m4_deps):
install-binPROGRAMS: $(bin_PROGRAMS)
@$(NORMAL_INSTALL)
test -z "$(bindir)" || $(MKDIR_P) "$(DESTDIR)$(bindir)"
@list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \
for p in $$list; do echo "$$p $$p"; done | \
sed 's/$(EXEEXT)$$//' | \
while read p p1; do if test -f $$p || test -f $$p1; \
then echo "$$p"; echo "$$p"; else :; fi; \
done | \
sed -e 'p;s,.*/,,;n;h' -e 's|.*|.|' \
-e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \
sed 'N;N;N;s,\n, ,g' | \
$(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \
{ d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \
if ($$2 == $$4) files[d] = files[d] " " $$1; \
else { print "f", $$3 "/" $$4, $$1; } } \
END { for (d in files) print "f", d, files[d] }' | \
while read type dir files; do \
if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \
test -z "$$files" || { \
echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \
$(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \
} \
; done
uninstall-binPROGRAMS:
@$(NORMAL_UNINSTALL)
@list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \
files=`for p in $$list; do echo "$$p"; done | \
sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \
-e 's/$$/$(EXEEXT)/' `; \
test -n "$$list" || exit 0; \
echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \
cd "$(DESTDIR)$(bindir)" && rm -f $$files
clean-binPROGRAMS:
@list='$(bin_PROGRAMS)'; test -n "$$list" || exit 0; \
echo " rm -f" $$list; \
rm -f $$list || exit $$?; \
test -n "$(EXEEXT)" || exit 0; \
list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \
echo " rm -f" $$list; \
rm -f $$list
librfid-send_script$(EXEEXT): $(librfid_send_script_OBJECTS) $(librfid_send_script_DEPENDENCIES)
@rm -f librfid-send_script$(EXEEXT)
$(librfid_send_script_LINK) $(librfid_send_script_OBJECTS) $(librfid_send_script_LDADD) $(LIBS)
librfid-tool$(EXEEXT): $(librfid_tool_OBJECTS) $(librfid_tool_DEPENDENCIES)
@rm -f librfid-tool$(EXEEXT)
$(librfid_tool_LINK) $(librfid_tool_OBJECTS) $(librfid_tool_LDADD) $(LIBS)
mifare-tool$(EXEEXT): $(mifare_tool_OBJECTS) $(mifare_tool_DEPENDENCIES)
@rm -f mifare-tool$(EXEEXT)
$(mifare_tool_LINK) $(mifare_tool_OBJECTS) $(mifare_tool_LDADD) $(LIBS)
mostlyclean-compile:
-rm -f *.$(OBJEXT)
distclean-compile:
-rm -f *.tab.c
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/common.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/librfid-tool.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mifare-tool.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/send_script.Po@am__quote@
.c.o:
@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(COMPILE) -c $<
.c.obj:
@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'`
.c.lo:
@am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $<
mostlyclean-libtool:
-rm -f *.lo
clean-libtool:
-rm -rf .libs _libs
install-man1: $(man_MANS)
@$(NORMAL_INSTALL)
test -z "$(man1dir)" || $(MKDIR_P) "$(DESTDIR)$(man1dir)"
@list=''; test -n "$(man1dir)" || exit 0; \
{ for i in $$list; do echo "$$i"; done; \
l2='$(man_MANS)'; for i in $$l2; do echo "$$i"; done | \
sed -n '/\.1[a-z]*$$/p'; \
} | while read p; do \
if test -f $$p; then d=; else d="$(srcdir)/"; fi; \
echo "$$d$$p"; echo "$$p"; \
done | \
sed -e 'n;s,.*/,,;p;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \
-e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,' | \
sed 'N;N;s,\n, ,g' | { \
list=; while read file base inst; do \
if test "$$base" = "$$inst"; then list="$$list $$file"; else \
echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man1dir)/$$inst'"; \
$(INSTALL_DATA) "$$file" "$(DESTDIR)$(man1dir)/$$inst" || exit $$?; \
fi; \
done; \
for i in $$list; do echo "$$i"; done | $(am__base_list) | \
while read files; do \
test -z "$$files" || { \
echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(man1dir)'"; \
$(INSTALL_DATA) $$files "$(DESTDIR)$(man1dir)" || exit $$?; }; \
done; }
uninstall-man1:
@$(NORMAL_UNINSTALL)
@list=''; test -n "$(man1dir)" || exit 0; \
files=`{ for i in $$list; do echo "$$i"; done; \
l2='$(man_MANS)'; for i in $$l2; do echo "$$i"; done | \
sed -n '/\.1[a-z]*$$/p'; \
} | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \
-e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \
test -z "$$files" || { \
echo " ( cd '$(DESTDIR)$(man1dir)' && rm -f" $$files ")"; \
cd "$(DESTDIR)$(man1dir)" && rm -f $$files; }
ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) '{ files[$$0] = 1; nonempty = 1; } \
END { if (nonempty) { for (i in files) print i; }; }'`; \
mkid -fID $$unique
tags: TAGS
TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
$(TAGS_FILES) $(LISP)
set x; \
here=`pwd`; \
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) '{ files[$$0] = 1; nonempty = 1; } \
END { if (nonempty) { for (i in files) print i; }; }'`; \
shift; \
if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
test -n "$$unique" || unique=$$empty_fix; \
if test $$# -gt 0; then \
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
"$$@" $$unique; \
else \
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
$$unique; \
fi; \
fi
ctags: CTAGS
CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
$(TAGS_FILES) $(LISP)
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) '{ files[$$0] = 1; nonempty = 1; } \
END { if (nonempty) { for (i in files) print i; }; }'`; \
test -z "$(CTAGS_ARGS)$$unique" \
|| $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
$$unique
GTAGS:
here=`$(am__cd) $(top_builddir) && pwd` \
&& $(am__cd) $(top_srcdir) \
&& gtags -i $(GTAGS_ARGS) "$$here"
distclean-tags:
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
distdir: $(DISTFILES)
@list='$(MANS)'; if test -n "$$list"; then \
list=`for p in $$list; do \
if test -f $$p; then d=; else d="$(srcdir)/"; fi; \
if test -f "$$d$$p"; then echo "$$d$$p"; else :; fi; done`; \
if test -n "$$list" && \
grep 'ab help2man is required to generate this page' $$list >/dev/null; then \
echo "error: found man pages containing the \`missing help2man' replacement text:" >&2; \
grep -l 'ab help2man is required to generate this page' $$list | sed 's/^/ /' >&2; \
echo " to fix them, install help2man, remove and regenerate the man pages;" >&2; \
echo " typically \`make maintainer-clean' will remove them" >&2; \
exit 1; \
else :; fi; \
else :; fi
@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
list='$(DISTFILES)'; \
dist_files=`for file in $$list; do echo $$file; done | \
sed -e "s|^$$srcdirstrip/||;t" \
-e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
case $$dist_files in \
*/*) $(MKDIR_P) `echo "$$dist_files" | \
sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
sort -u` ;; \
esac; \
for file in $$dist_files; do \
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
if test -d $$d/$$file; then \
dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
if test -d "$(distdir)/$$file"; then \
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
fi; \
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
fi; \
cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
else \
test -f "$(distdir)/$$file" \
|| cp -p $$d/$$file "$(distdir)/$$file" \
|| exit 1; \
fi; \
done
check-am: all-am
check: check-am
all-am: Makefile $(PROGRAMS) $(MANS) $(HEADERS)
installdirs:
for dir in "$(DESTDIR)$(bindir)" "$(DESTDIR)$(man1dir)"; do \
test -z "$$dir" || $(MKDIR_P) "$$dir"; \
done
install: install-am
install-exec: install-exec-am
install-data: install-data-am
uninstall: uninstall-am
install-am: all-am
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
installcheck: installcheck-am
install-strip:
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
`test -z '$(STRIP)' || \
echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
mostlyclean-generic:
clean-generic:
distclean-generic:
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
maintainer-clean-generic:
@echo "This command is intended for maintainers to use"
@echo "it deletes files that may require special tools to rebuild."
clean: clean-am
clean-am: clean-binPROGRAMS clean-generic clean-libtool mostlyclean-am
distclean: distclean-am
-rm -rf ./$(DEPDIR)
-rm -f Makefile
distclean-am: clean-am distclean-compile distclean-generic \
distclean-tags
dvi: dvi-am
dvi-am:
html: html-am
html-am:
info: info-am
info-am:
install-data-am: install-man
install-dvi: install-dvi-am
install-dvi-am:
install-exec-am: install-binPROGRAMS
install-html: install-html-am
install-html-am:
install-info: install-info-am
install-info-am:
install-man: install-man1
install-pdf: install-pdf-am
install-pdf-am:
install-ps: install-ps-am
install-ps-am:
installcheck-am:
maintainer-clean: maintainer-clean-am
-rm -rf ./$(DEPDIR)
-rm -f Makefile
maintainer-clean-am: distclean-am maintainer-clean-generic
mostlyclean: mostlyclean-am
mostlyclean-am: mostlyclean-compile mostlyclean-generic \
mostlyclean-libtool
pdf: pdf-am
pdf-am:
ps: ps-am
ps-am:
uninstall-am: uninstall-binPROGRAMS uninstall-man
uninstall-man: uninstall-man1
.MAKE: install-am install-strip
.PHONY: CTAGS GTAGS all all-am check check-am clean clean-binPROGRAMS \
clean-generic clean-libtool ctags distclean distclean-compile \
distclean-generic distclean-libtool distclean-tags distdir dvi \
dvi-am html html-am info info-am install install-am \
install-binPROGRAMS install-data install-data-am install-dvi \
install-dvi-am install-exec install-exec-am install-html \
install-html-am install-info install-info-am install-man \
install-man1 install-pdf install-pdf-am install-ps \
install-ps-am install-strip installcheck installcheck-am \
installdirs maintainer-clean maintainer-clean-generic \
mostlyclean mostlyclean-compile mostlyclean-generic \
mostlyclean-libtool pdf pdf-am ps ps-am tags uninstall \
uninstall-am uninstall-binPROGRAMS uninstall-man \
uninstall-man1
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:
+126
View File
@@ -0,0 +1,126 @@
#include <stdio.h>
#include <unistd.h>
#include <stdlib.h>
#include <string.h>
#include <errno.h>
#ifndef __MINGW32__
#include <libgen.h>
#endif
#include <librfid/rfid.h>
#include <librfid/rfid_scan.h>
#include <librfid/rfid_reader.h>
#include <librfid/rfid_layer2.h>
#include <librfid/rfid_protocol.h>
#include <librfid/rfid_protocol_mifare_classic.h>
#include <librfid/rfid_protocol_mifare_ul.h>
#include "librfid-tool.h"
#include "common.h"
const char *
hexdump(const void *data, unsigned int len)
{
static char string[1024];
unsigned char *d = (unsigned char *) data;
unsigned int i, left;
string[0] = '\0';
left = sizeof(string);
for (i = 0; len--; i += 3) {
if (i >= sizeof(string) -4)
break;
snprintf(string+i, 4, " %02x", *d++);
}
return string;
}
static char parse_hexdigit(const char hexdigit)
{
if (hexdigit <= '9' && hexdigit >= '0')
return hexdigit - '0';
if (hexdigit <= 'f' && hexdigit >= 'a')
return 10 + (hexdigit - 'a');
return 0;
}
int
hexread(unsigned char *result, const unsigned char *in, unsigned int len)
{
const unsigned char *pos;
char dig1, dig2;
unsigned char *res = result;
for (pos = in; pos-in <= len-2; pos+=2) {
if (*pos == ':')
pos++;
dig1 = *pos;
dig2 = *(pos+1);
*res++ = parse_hexdigit(dig1) << 4 | parse_hexdigit(dig2);
}
return (res - result);
}
struct rfid_reader_handle *rh;
struct rfid_layer2_handle *l2h;
struct rfid_protocol_handle *ph;
int reader_init(void)
{
printf("opening reader handle OpenPCD, CM5x21\n");
rh = rfid_reader_open(NULL, RFID_READER_OPENPCD);
if (!rh) {
fprintf(stderr, "No OpenPCD found\n");
rh = rfid_reader_open(NULL, RFID_READER_CM5121);
if (!rh) {
fprintf(stderr, "No Omnikey Cardman 5x21 found\n");
return -1;
}
}
return 0;
}
int l2_init(int layer2)
{
int rc;
printf("opening layer2 handle\n");
l2h = rfid_layer2_init(rh, layer2);
if (!l2h) {
fprintf(stderr, "error during layer2(%d)_init (0=14a,1=14b,3=15)\n",layer2);
return -1;
}
printf("running layer2 anticol(_open)\n");
rc = rfid_layer2_open(l2h);
if (rc < 0) {
fprintf(stderr, "error during layer2_open\n");
return rc;
}
return 0;
}
int l3_init(int protocol)
{
printf("running layer3 (ats)\n");
ph = rfid_protocol_init(l2h, protocol);
if (!ph) {
fprintf(stderr, "error during protocol_init\n");
return -1;
}
if (rfid_protocol_open(ph) < 0) {
fprintf(stderr, "error during protocol_open\n");
return -1;
}
printf("we now have layer3 up and running\n");
return 0;
}
+7
View File
@@ -0,0 +1,7 @@
#ifndef __COMMON_H__
#define __COMMON_H__
extern const char * hexdump(const void *data, unsigned int len);
extern int hexread(unsigned char *result, const unsigned char *in, unsigned int len);
#endif/*__COMMON_H__*/
+23
View File
@@ -0,0 +1,23 @@
.TH librfid-send_script 1 "January 24, 2008"
.SH NAME
librfid-send_script \- Command line tool for testing librfid
.SH SYNOPSIS
.BR librfid-send_script " scriptfile"
.SH DESCRIPTION
.B librfid-send_script
is a command line tool for testing librfid.
.SH OPTIONS
None.
.SH BUGS
Please report any bugs on the
.B librfid-devel
mailing list at
.BR https://lists.gnumonks.org/mailman/listinfo/librfid-devel/ "."
.SH LICENCE
.B librfid-send_script
is covered by the GNU General Public License (GPL), version 2.
.SH AUTHORS
Harald Welte <laforge@gnumonks.org>
.PP
This manual page was written by Uwe Hermann <uwe@hermann-uwe.de>.
It is licensed under the terms of the GNU GPL (version 2 or later).
Binary file not shown.
+44
View File
@@ -0,0 +1,44 @@
.TH LIBRFID-TOOL 1 "January 24, 2008"
.SH NAME
librfid-tool \- Low-level RFID access command line tool based on librfid
.SH SYNOPSIS
.B librfid-tool \fR[\fB\-sSplh\fR]
.SH DESCRIPTION
.B librfid-tool
is a command line tool which gives you low-level RFID access using one
of the RFID reader devices supported by librfid.
.SH OPTIONS
.B "\-s, \-\-scan"
Scan for RFID tags until the first tag is found.
.TP
.B "\-S, \-\-scan-loop"
Scan for RFID tags in an endless loop. Show information on the detected
RFID tags (if any).
.TP
.B "\-p, \-\-protocol"
Specify the RFID protocol to use. Possible values are:
.BR tcl ,
.BR mifare-ultralight ", and "
.BR mifare-classic "."
.TP
.B "\-l, \-\-layer2"
Specify the layer 2 protocol to use. Possible values are:
.BR iso14443a ,
.BR iso14443b ", and "
.BR iso15693 "."
.TP
.B "\-h, \-\-help"
Show a help text and exit.
.SH BUGS
Please report any bugs on the
.B librfid-devel
mailing list at
.BR https://lists.gnumonks.org/mailman/listinfo/librfid-devel/ "."
.SH LICENCE
.B librfid-tool
is covered by the GNU General Public License (GPL), version 2.
.SH AUTHORS
Harald Welte <laforge@gnumonks.org>
.PP
This manual page was written by Uwe Hermann <uwe@hermann-uwe.de>.
It is licensed under the terms of the GNU GPL (version 2 or later).
+917
View File
@@ -0,0 +1,917 @@
/* librfid-tool - a small command-line tool for librfid testing
*
* (C) 2005-2008 by Harald Welte <laforge@gnumonks.org>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2
* as published by the Free Software Foundation
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include <stdio.h>
#include <unistd.h>
#include <stdlib.h>
#include <string.h>
#include <errno.h>
#ifndef __MINGW32__
#include <libgen.h>
#endif
#define _GNU_SOURCE
#include <getopt.h>
#include <librfid/rfid.h>
#include <librfid/rfid_scan.h>
#include <librfid/rfid_reader.h>
#include <librfid/rfid_layer2.h>
#include <librfid/rfid_protocol.h>
#include <librfid/rfid_layer2_iso14443a.h>
#include <librfid/rfid_layer2_iso15693.h>
#include <librfid/rfid_protocol_mifare_classic.h>
#include <librfid/rfid_protocol_mifare_ul.h>
#include <librfid/rfid_protocol_tagit.h>
#include <librfid/rfid_protocol_icode.h>
#include <librfid/rfid_protocol_tcl.h>
#include "librfid-tool.h"
static int select_mf(void)
{
unsigned char cmd[] = { 0x00, 0xa4, 0x00, 0x00, 0x02, 0x3f, 0x00, 0x00 };
unsigned char ret[256];
unsigned int rlen = sizeof(ret);
int rv;
rv = rfid_protocol_transceive(ph, cmd, sizeof(cmd), ret, &rlen, 0, 0);
if (rv < 0)
return rv;
printf("%d: [%s]\n", rlen, hexdump(ret, rlen));
return 0;
}
static int iso7816_get_challenge(unsigned char len)
{
unsigned char cmd[] = { 0x00, 0x84, 0x00, 0x00, 0x08 };
unsigned char ret[256];
unsigned int rlen = sizeof(ret);
cmd[4] = len;
int rv;
rv = rfid_protocol_transceive(ph, cmd, sizeof(cmd), ret, &rlen, 0, 0);
if (rv < 0)
return rv;
printf("%d: [%s]\n", rlen, hexdump(ret, rlen));
return 0;
}
int
iso7816_select_application(void)
{
unsigned char cmd[] = { 0x00, 0xa4, 0x04, 0x0c, 0x07,
0xa0, 0x00, 0x00, 0x02, 0x47, 0x10, 0x01 };
unsigned char resp[7];
unsigned int rlen = sizeof(resp);
int rv;
rv = rfid_protocol_transceive(ph, cmd, sizeof(cmd), resp, &rlen, 0, 0);
if (rv < 0)
return rv;
/* FIXME: parse response */
printf("%s\n", hexdump(resp, rlen));
return 0;
}
int
iso7816_select_ef(u_int16_t fid)
{
unsigned char cmd[7] = { 0x00, 0xa4, 0x02, 0x0c, 0x02, 0x00, 0x00 };
unsigned char resp[7];
unsigned int rlen = sizeof(resp);
int rv;
cmd[5] = (fid >> 8) & 0xff;
cmd[6] = fid & 0xff;
rv = rfid_protocol_transceive(ph, cmd, sizeof(cmd), resp, &rlen, 0, 0);
if (rv < 0)
return rv;
/* FIXME: parse response */
printf("%s\n", hexdump(resp, rlen));
return 0;
}
int
iso7816_read_binary(unsigned char *buf, unsigned int *len)
{
unsigned char cmd[] = { 0x00, 0xb0, 0x00, 0x00, 0x00 };
unsigned char resp[256];
unsigned int rlen = sizeof(resp);
int rv;
rv = rfid_protocol_transceive(ph, cmd, sizeof(cmd), resp, &rlen, 0, 0);
if (rv < 0)
return rv;
printf("%s\n", hexdump(resp, rlen));
/* FIXME: parse response, determine whether we need additional reads */
/* FIXME: copy 'len' number of response bytes to 'buf' */
return 0;
}
/* wrapper function around SELECT EF and READ BINARY */
int
iso7816_read_ef(u_int16_t fid, unsigned char *buf, unsigned int *len)
{
int rv;
rv = iso7816_select_ef(fid);
if (rv < 0)
return rv;
return iso7816_read_binary(buf, len);
}
/* mifare ultralight helpers */
int
mifare_ulight_write(struct rfid_protocol_handle *ph)
{
unsigned char buf[4] = { 0xa1, 0xa2, 0xa3, 0xa4 };
return rfid_protocol_write(ph, 10, buf, 4);
}
int
mifare_ulight_blank(struct rfid_protocol_handle *ph)
{
unsigned char buf[4] = { 0x00, 0x00, 0x00, 0x00 };
int i, ret;
for (i = 4; i <= MIFARE_UL_PAGE_MAX; i++) {
ret = rfid_protocol_write(ph, i, buf, 4);
if (ret < 0)
return ret;
}
return 0;
}
static int
mifare_ulight_read(struct rfid_protocol_handle *ph)
{
unsigned char buf[20];
unsigned int len = sizeof(buf);
int ret;
int i;
for (i = 0; i <= MIFARE_UL_PAGE_MAX; i++) {
ret = rfid_protocol_read(ph, i, buf, &len);
if (ret < 0)
return ret;
printf("Page 0x%x: %s\n", i, hexdump(buf, 4));
}
return 0;
}
/* mifare classic helpers */
static int
mifare_classic_read_sector(struct rfid_protocol_handle *ph, int sector)
{
unsigned char buf[20];
unsigned int len = sizeof(buf);
int ret;
int block, blocks_per_sector, first_block;
printf("Reading sector %u\n", sector);
first_block = mfcl_sector2block(sector);
blocks_per_sector = mfcl_sector_blocks(sector);
if (first_block < 0 || blocks_per_sector < 0)
return -EINVAL;
for (block = first_block; block < first_block + blocks_per_sector;
block++) {
printf("Reading block %u: ", block);
ret = rfid_protocol_read(ph, block, buf, &len);
if (ret == -ETIMEDOUT)
fprintf(stderr, "TIMEOUT\n");
if (ret < 0) {
printf("Error %d reading\n", ret);
return ret;
}
printf("Page 0x%x: %s\n", block, hexdump(buf, len));
}
return 0;
}
static int
mifare_classic_dump(struct rfid_protocol_handle *ph)
{
unsigned int size;
unsigned int size_len = sizeof(size);
int sector, num_sectors;
if (rfid_protocol_getopt(ph, RFID_OPT_PROTO_SIZE,
&size, &size_len) == 0) {
printf("Size: %u bytes\n", size);
} else {
printf("Size: unknown ?!?\n");
return -EINVAL;
}
switch (size) {
case 320:
num_sectors = 5;
break;
case 1024:
num_sectors = 16;
break;
case 4096:
num_sectors = 40;
break;
default:
return -EINVAL;
}
for (sector = 0; sector < num_sectors; sector++) {
int rc;
printf("Authenticating sector %u: ", sector);
fflush(stdout);
rc = mfcl_set_key(ph, MIFARE_CL_KEYA_DEFAULT_INFINEON);
if (rc < 0) {
printf("key format error\n");
exit(1);
}
rc = mfcl_auth(ph, RFID_CMD_MIFARE_AUTH1A,
mfcl_sector2block(sector));
if (rc < 0) {
printf("mifare auth error\n");
exit(1);
} else
printf("mifare auth succeeded!\n");
mifare_classic_read_sector(ph, sector);
}
}
void
iso15693_write(struct rfid_reader_handle *rh,int layer2,int sector,
unsigned char *data, unsigned int len)
{
int rc;
unsigned char uid_buf[16];
unsigned int uid_len = sizeof(uid_buf);
if (rh->reader->l2_supported & (1 << layer2)) {
l2h = rfid_layer2_init(rh, layer2);
if (!l2h) {
printf("error during layer2(%d)_init (0=14a,1=14b,3=15)\n",layer2);
return;
}
printf("Layer2 init ok\n");
rc = rfid_layer2_open(l2h);
if (rc>0){
rfid_layer2_getopt(l2h, RFID_OPT_LAYER2_UID, &uid_buf, &uid_len);
printf("Layer 2 success (%s)[%d]: '%s'\n", rfid_layer2_name(l2h), uid_len, hexdump(uid_buf, uid_len));
rc = iso15693_write_block(l2h,sector,data,len);
printf("write>>rc: %d\n",rc);
}else {
printf("error during layer2_open\n");
return ;
}
rfid_layer2_close(l2h);
rfid_layer2_fini(l2h);
}
}
void iso15693_dump(struct rfid_reader_handle *rh,int layer2,int sector){
unsigned int size;
unsigned int size_len = sizeof(size);
unsigned char buf[1024];
int rc,i;
unsigned char uid_buf[16], block_sec;
unsigned int uid_len = sizeof(uid_buf);
if (rh->reader->l2_supported & (1 << layer2)) {
l2h = rfid_layer2_init(rh, layer2);
if (!l2h) {
printf("error during layer2(%d)_init (0=14a,1=14b,3=15)\n",layer2);
return;
}
printf("Layer2 init ok\n");
rc = rfid_layer2_open(l2h);
if (rc>0){
rfid_layer2_getopt(l2h, RFID_OPT_LAYER2_UID, &uid_buf, &uid_len);
printf("Layer 2 success (%s)[%d]: '%s'\n", rfid_layer2_name(l2h), uid_len, hexdump(uid_buf, uid_len));
if (sector < 0){
if (sector<=-3)
iso15693_select(l2h);
for(i=0;i<=255;i++){
rc = iso15693_read_block(l2h,i,buf,sizeof(buf),&block_sec);
if (rc>=0)
printf("block[%3d:%02x]sec:0x%0x data(%d): %s\n",i,i,block_sec,rc,rfid_hexdump(buf,rc));
else{
printf("no data(read_block(%d)>> %d)\n",i,rc);
if ((sector == -1)||(sector == -3))
break;
}
}
}else{
if (sector>255)
sector=255;
rc = iso15693_read_block(l2h,sector,buf,sizeof(buf));
if (rc>=0)
printf("block[%d]data(%d): %s\n",i,rc,rfid_hexdump(buf,rc));
else
printf("no data(read_block(%d)>> %d)\n",i,rc);
}
} else {
printf("error during layer2_open\n");
return ;
}
rfid_layer2_close(l2h);
rfid_layer2_fini(l2h);
}
}
static char *proto_names[] = {
[RFID_PROTOCOL_TCL] = "tcl",
[RFID_PROTOCOL_MIFARE_UL] = "mifare-ultralight",
[RFID_PROTOCOL_MIFARE_CLASSIC] = "mifare-classic",
[RFID_PROTOCOL_ICODE_SLI] = "icode",
[RFID_PROTOCOL_TAGIT] = "tagit",
};
static int proto_by_name(const char *name)
{
int i;
for (i = 0; i < ARRAY_SIZE(proto_names); i++) {
if (proto_names[i] == NULL)
continue;
if (!strcasecmp(name, proto_names[i]))
return i;
}
return -1;
}
static char *l2_names[] = {
[RFID_LAYER2_ISO14443A] = "iso14443a",
[RFID_LAYER2_ISO14443B] = "iso14443b",
[RFID_LAYER2_ISO15693] = "iso15693",
[RFID_LAYER2_ICODE1] = "icode1",
};
static int l2_by_name(const char *name)
{
int i;
for (i = 0; i < ARRAY_SIZE(l2_names); i++) {
if (l2_names[i] == NULL)
continue;
if (!strcasecmp(name, l2_names[i]))
return i;
}
return -1;
}
static int do_scan(int first)
{
int rc;
unsigned int size;
unsigned int size_len = sizeof(size);
char *data;
unsigned int data_len;
if (first) {
unsigned int opt;
unsigned int optlen = sizeof(opt);
/* turn off RF */
opt = 1;
rfid_reader_setopt(rh, RFID_OPT_RDR_RF_KILL, &opt, optlen);
usleep(10*1000);
/* turn on RF */
opt = 0;
rfid_reader_setopt(rh, RFID_OPT_RDR_RF_KILL, &opt, optlen);
}
printf("scanning for RFID token...\n");
rc = rfid_scan(rh, &l2h, &ph);
if (rc >= 2) {
unsigned char uid_buf[16];
unsigned int uid_len = sizeof(uid_buf);
rfid_layer2_getopt(l2h, RFID_OPT_LAYER2_UID, &uid_buf,
&uid_len);
printf("Layer 2 success (%s): %s\n", rfid_layer2_name(l2h),
hexdump(uid_buf, uid_len));
}
if (rc >= 3) {
printf("Protocol success (%s)\n", rfid_protocol_name(ph));
if (rfid_protocol_getopt(ph, RFID_OPT_PROTO_SIZE,
&size, &size_len) == 0)
printf("Size: %u bytes\n", size);
size_len = sizeof(size);
size = 0;
if (rfid_protocol_getopt(ph, RFID_OPT_P_TCL_ATS_LEN,
&size, &size_len) == 0) {
data_len = size + 1;
data = malloc(data_len);
if (data) {
if (rfid_protocol_getopt(ph, RFID_OPT_P_TCL_ATS,
data, &data_len) == 0) {
printf("Got ATS of %u bytes: %s\n", size,
hexdump(data, data_len));
}
}
}
}
return rc;
}
static void do_endless_scan()
{
int rc;
int first = 1;
while (1) {
if (first)
putc('\n', stdout);
printf("==> doing %s scan\n", first ? "first" : "successive");
rc = do_scan(first);
if (rc >= 3) {
printf("closing proto\n");
rfid_protocol_close(ph);
}
if (rc >= 2) {
printf("closing layer2\n");
rfid_layer2_close(l2h);
first = 0;
} else
first = 1;
}
}
static void do_regdump(void)
{
u_int8_t buffer[0xff];
int i;
printf("dumping rc632 regs...\n");
rc632_register_dump(rh->ah, buffer);
printf("\n ");
for (i=0; i<=0x0f; i++)
printf(" 0x_%01X",i);
printf("\n-----------------------------------------------------------------------------------\n");
for (i=0; i <= 0x3f; i++) {
if ((i % 0x10) == 0)
printf("0x%01X_:",i/0x10);
printf(" 0x%02X", buffer[i]);
if ((i% 0x10) == 0x0f)
printf("\n");
}
/* print regdump as c-style array*/
printf("u_int8_t rc632_regs[] = {");
for (i = 0; i <= 0x3f; i++) {
if (((i+1) % 0x08) == 1) {
if (i > 7)
printf("//%2d..%2d",i-8,i-1);
printf("\n\t");
}
printf(" 0x%02X, ",buffer[i]);
}
printf("//%2d..%2d\n\t 0 };\n",i-8,i-1);
}
static void do_enum(int layer2)
{
int rc;
//unsigned int size;
//unsigned int size_len = sizeof(size);
unsigned char uid_buf[16];
unsigned int uid_len;
printf("scanning for RFID token on layer %s...\n", l2_names[layer2]);
if (rh->reader->l2_supported & (1 << layer2)) {
l2h = rfid_layer2_init(rh, layer2);
if (!l2h) {
printf("error during layer2(%s)_init\n",
l2_names[layer2]);
return;
}
printf("Layer2 init ok\n");
rc = rfid_layer2_open(l2h);
} else {
printf("error during layer2_open\n");
return ;
}
while (rc>=0) {
if (l2h) {
uid_len = sizeof(uid_buf);
rfid_layer2_getopt(l2h, RFID_OPT_LAYER2_UID, &uid_buf, &uid_len);
printf("Layer 2 success (%s)[%d]: '%s'\n", rfid_layer2_name(l2h), uid_len, hexdump(uid_buf, uid_len));
}
/*
ph = rfid_protocol_scan(l2h);
if (ph) {
printf("Protocol success (%s)\n", rfid_protocol_name(ph));
if (rfid_protocol_getopt(ph, RFID_OPT_PROTO_SIZE,
&size, &size_len) == 0)
printf("Size: %u bytes\n", size);
} else
printf("##############\n");
*/
if (rc >= 0) {
rfid_layer2_close(l2h);
}
rc = rfid_layer2_open(l2h);
}
}
static void do_enum_loop(int layer2, unsigned int delay)
{
while (1) {
do_enum(layer2);
{
unsigned int opt;
unsigned int optlen = sizeof(opt);
/* turn off RF */
opt = 1;
rfid_reader_setopt(rh, RFID_OPT_RDR_RF_KILL, &opt, optlen);
usleep(10 * 1000);
/* turn on RF */
opt = 0;
rfid_reader_setopt(rh, RFID_OPT_RDR_RF_KILL, &opt, optlen);
}
usleep(delay * 1000);
printf("--- next run ---\n");
}
}
#define OPTION_OFFSET 256
static struct option original_opts[] = {
{ "help", 0, 0, 'h' },
{ "layer2", 1, 0, 'l' },
{ "protocol", 1, 0, 'p' },
{ "scan", 0, 0, 's' },
{ "scan-loop", 0, 0, 'S' },
{ "dump", 0, 0, 'd' },
{ "enum", 0, 0, 'e' },
{ "read", 1, 0, 'r' },
{ "write", 1, 0, 'w'},
{ "enum-loop", 1, 0, 'E' },
{0, 0, 0, 0}
};
/* module / option merging code */
static struct option *opts = original_opts;
static unsigned int global_option_offset = 0;
static char *program_name;
static char *program_version = LIBRFID_TOOL_VERSION;
static void free_opts(int reset_offset)
{
if (opts != original_opts) {
free(opts);
opts = original_opts;
if (reset_offset)
global_option_offset = 0;
}
}
static struct option *
merge_options(struct option *oldopts, const struct option *newopts,
unsigned int *option_offset)
{
unsigned int num_old, num_new, i;
struct option *merge;
for (num_old = 0; oldopts[num_old].name; num_old++);
for (num_new = 0; oldopts[num_new].name; num_new++);
global_option_offset += OPTION_OFFSET;
*option_offset = global_option_offset;
merge = malloc(sizeof(struct option) * (num_new + num_old + 1));
memcpy(merge, oldopts, num_old * sizeof(struct option));
free_opts(0); /* Release previous options merged if any */
for (i = 0; i < num_new; i++) {
merge[num_old + i] = newopts[i];
merge[num_old + i].val += *option_offset;
}
memset(merge + num_old + num_new, 0, sizeof(struct option));
return merge;
}
struct rfidtool_module *find_module(const char *name)
{
return NULL;
}
void register_module(struct rfidtool_module *me)
{
struct rfidtool_module *old;
if (strcmp(me->version, program_version) != 0) {
fprintf(stderr, "%s: target `%s' v%s (I'm v%s).\n",
program_name, me->name, me->version, program_version);
exit(1);
}
old = find_module(me->name);
if (old) {
fprintf(stderr, "%s: target `%s' already registered.\n",
program_name, me->name);
exit(1);
}
}
static void help(void)
{
printf( " -s --scan scan until first RFID tag is found\n"
" -S --scan-loop endless scanning loop\n"
" -p --protocol {tcl,mifare-ultralight,mifare-classic,tagit,icode}\n"
" -l --layer2 {iso14443a,iso14443b,iso15693,icode1}\n"
" -d --dump dump rc632 registers\n"
" -e --enum enumerate all tag's in field \n"
" -E --enum-loop <delay> (ms) enumerate endless\n"
" -r --read <secror> read iso15693 sector \n\t\t\t(-1:0-255 stop on error, -2: 0-255 no stop)\n"
" -w --write <sector> write to iso15693 sector data: 01:02:03:04\n"
" -h --help\n");
}
int main(int argc, char **argv)
{
int rc;
char buf[0x100];
int i, len, protocol = -1, layer2 = -1;
#ifdef __MINGW32__
program_name = argv[0];
#else /*__MINGW32__*/
program_name = basename(argv[0]);
#endif/*__MINGW32__*/
printf("%s - (C) 2005-2008 by Harald Welte\n"
"This program is Free Software and has "
"ABSOLUTELY NO WARRANTY\n\n", program_name);
printf("initializing librfid\n");
rfid_init();
while (1) {
int c, option_index = 0;
c = getopt_long(argc, argv, "hp:l:sSdeE:r:w:", opts, &option_index);
if (c == -1)
break;
switch (c) {
case 'w':
//hexread(key, optarg, strlen(optarg));
i = strtol(optarg, NULL, 10);
if (reader_init() < 0)
exit(1);
layer2 = RFID_LAYER2_ISO15693;
iso15693_write(rh,layer2,i,"\x1\x2\x3\x4",4);
rfid_reader_close(rh);
exit(0);
break;
case 'r':
i = strtol(optarg, NULL, 10);
if (reader_init() < 0)
exit(1);
//if (layer2 < 0)
layer2 = RFID_LAYER2_ISO15693;
iso15693_dump(rh,layer2,i);
rfid_reader_close(rh);
exit(0);
break;
case 'E':
i = strtol(optarg, NULL, 10);
if (reader_init() < 0)
exit(1);
if (layer2<0)
layer2 = RFID_LAYER2_ISO14443A;
do_enum_loop(layer2, i>1? i : 500);
rfid_reader_close(rh);
exit(0);
break;
case 'e':
if (reader_init() < 0)
exit(1);
if (layer2 < 0)
layer2 = RFID_LAYER2_ISO14443A;
do_enum(layer2);
rfid_reader_close(rh);
exit(0);
break;
case 'd':
if (reader_init() < 0)
exit(1);
do_regdump();
rfid_reader_close(rh);
break;
case 's':
if (reader_init() < 0)
exit(1);
do_scan(0);
rfid_reader_close(rh);
exit(0);
break;
case 'S':
if (reader_init() < 0)
exit(1);
do_endless_scan();
exit(0);
break;
case 'p':
protocol = proto_by_name(optarg);
if (protocol < 0) {
fprintf(stderr, "unknown protocol `%s'\n",
optarg);
exit(2);
}
break;
case 'l':
layer2 = l2_by_name(optarg);
if (layer2 < 0) {
fprintf(stderr, "unknown layer2 `%s'\n",
optarg);
exit(2);
}
break;
default:
printf("unknown cmd: %c\n",c);
case 'h':
help();
exit(0);
break;
case '?':
exit(0);
}
}
switch (protocol) {
case RFID_PROTOCOL_MIFARE_UL:
case RFID_PROTOCOL_MIFARE_CLASSIC:
layer2 = RFID_LAYER2_ISO14443A;
break;
case -1:
fprintf(stderr, "you have to specify --protocol\n");
exit(2);
}
if (layer2 < 0) {
fprintf(stderr, "you have to specify --layer2\n");
exit(2);
}
if (reader_init() < 0)
exit(1);
if (l2_init(layer2) < 0) {
rfid_reader_close(rh);
exit(1);
}
if (l3_init(protocol) < 0) {
rfid_reader_close(rh);
exit(1);
}
switch (protocol) {
case RFID_PROTOCOL_TCL:
printf("Protocol T=CL\n");
/* we've established T=CL at this point */
printf("selecting Master File\n");
rc = select_mf();
if (rc < 0) {
printf("error selecting MF\n");
break;
}
printf("Getting random challenge, length 255\n");
rc = iso7816_get_challenge(0xff);
if (rc < 0) {
printf("error getting random challenge\n");
break;
}
printf("selecting Passport application\n");
rc = iso7816_select_application();
if (rc < 0) {
printf("error selecting passport application\n");
break;
}
printf("selecting EF 0x1e\n");
rc = iso7816_select_ef(0x011e);
if (rc < 0) {
printf("error selecting EF 0x1e\n");
break;
}
printf("selecting EF 0x01\n");
rc = iso7816_select_ef(0x0101);
if (rc < 0) {
printf("error selecting EF 0x01\n");
break;
}
while (1) {
printf("reading EF1\n");
len = sizeof(buf);
printf("reading ef\n");
rc = iso7816_read_binary(buf, &len);
if (rc < 0) {
printf("error reading EF\n");
break;
}
}
#if 0
for (i = 0; i < 4; i++)
iso7816_get_challenge(0xff);
#endif
break;
case RFID_PROTOCOL_MIFARE_UL:
printf("Protocol Mifare Ultralight\n");
mifare_ulight_read(ph);
#if 0
mifare_ulight_blank(ph);
mifare_ulight_write(ph);
mifare_ulight_read(ph);
#endif
break;
case RFID_PROTOCOL_MIFARE_CLASSIC:
printf("Protocol Mifare Classic\n");
mifare_classic_dump(ph);
break;
default:
printf("unknown protocol %u\n", protocol);
exit(1);
break;
}
rfid_reader_close(rh);
exit(0);
}
Binary file not shown.
+35
View File
@@ -0,0 +1,35 @@
#ifndef _RFIDTOOL_H
#define _RFIDTOOL_H
#define _GNU_SOURCE
#include <getopt.h>
#define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0]))
extern const char *
hexdump(const void *data, unsigned int len);
extern int
hexread(unsigned char *result, const unsigned char *in, unsigned int len);
extern struct rfid_reader_handle *rh;
extern struct rfid_layer2_handle *l2h;
extern struct rfid_protocol_handle *ph;
extern int reader_init(void);
extern int l2_init(int layer2);
extern int l3_init(int protocol);
#define LIBRFID_TOOL_VERSION "0.1"
struct rfidtool_module {
struct rfidtool_module *next;
char *name;
char *version;
const struct option *extra_opts;
unsigned int option_offset;
};
#endif /* _REFIDTOOL_H */
+39
View File
@@ -0,0 +1,39 @@
.TH mifare-tool 1 "January 24, 2008"
.SH NAME
mifare-tool \- Low-level mifare tag command line tool based on librfid
.SH SYNOPSIS
.B mifare-tool \fR[\fB\-rlwkbh\fR]
.SH DESCRIPTION
.B mifare-tool
is a command line tool for testing low-level mifare tag support in librfid.
.SH OPTIONS
.B "\-r, \-\-read"
Read a mifare sector.
.TP
.B "\-l, \-\-loop-read"
Loop reading a mifare sector.
.TP
.B "\-w, \-\-write"
Write a mifare sector.
.TP
.B "\-k, \-\-key"
Specify a mifare access key (in hex tuples).
.TP
.B "\-b, \-\-brute-force N"
Brute-force read sector N.
.TP
.B "\-h, \-\-help"
Show a help text and exit.
.SH BUGS
Please report any bugs on the
.B librfid-devel
mailing list at
.BR https://lists.gnumonks.org/mailman/listinfo/librfid-devel/ "."
.SH LICENCE
.B mifare-tool
is covered by the GNU General Public License (GPL), version 2.
.SH AUTHORS
Harald Welte <laforge@gnumonks.org>
.PP
This manual page was written by Uwe Hermann <uwe@hermann-uwe.de>.
It is licensed under the terms of the GNU GPL (version 2 or later).
+248
View File
@@ -0,0 +1,248 @@
/* mifare-tool - a small command-line tool for librfid mifare testing
*
* (C) 2006 by Harald Welte <laforge@gnumonks.org>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2
* as published by the Free Software Foundation
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include <stdio.h>
#include <unistd.h>
#include <stdlib.h>
#include <string.h>
#include <errno.h>
#ifndef __MINGW32__
#include <libgen.h>
#endif
#define _GNU_SOURCE
#include <getopt.h>
#include <librfid/rfid.h>
#include <librfid/rfid_scan.h>
#include <librfid/rfid_reader.h>
#include <librfid/rfid_layer2.h>
#include <librfid/rfid_protocol.h>
#include <librfid/rfid_protocol_mifare_classic.h>
#include <librfid/rfid_protocol_mifare_ul.h>
#include <librfid/rfid_access_mifare_classic.h>
#include "librfid-tool.h"
static char *program_name;
static void help(void)
{
printf( " -h --help Print this help message\n"
" -r --read Read a mifare sector\n"
" -l --loop-read Loop reading a mifare sector\n"
" -w --write Write a mifare sector\n"
" -k --key Specify mifare access key (in hex tuples)\n"
" -b --brute-force n Brute Force read sector n\n");
}
static struct option mifare_opts[] = {
{ "key", 1, 0, 'k' },
{ "read", 1, 0, 'r' },
{ "loop-read", 1, 0, 'l' },
{ "write", 1 ,0, 'w' },
{ "help", 0, 0, 'h' },
{ "brute-force", 1, 0, 'b' },
{ 0, 0, 0, 0 }
};
static int mifare_cl_auth(unsigned char *key, int page)
{
int rc;
rc = mfcl_set_key(ph, key);
if (rc < 0) {
fprintf(stderr, "key format error\n");
return rc;
}
rc = mfcl_auth(ph, RFID_CMD_MIFARE_AUTH1A, page);
if (rc < 0) {
fprintf(stderr, "mifare auth error\n");
return rc;
} else
printf("mifare auth succeeded!\n");
return 0;
}
static void mifare_l3(void)
{
while (l2_init(RFID_LAYER2_ISO14443A) < 0) ;
printf("ISO14443-3A anticollision succeeded\n");
while (l3_init(RFID_PROTOCOL_MIFARE_CLASSIC) < 0) ;
printf("Mifare card available\n");
}
int main(int argc, char **argv)
{
int len, rc, c, option_index = 0;
unsigned int page,uid,uid_len;
char key[MIFARE_CL_KEY_LEN];
char buf[MIFARE_CL_PAGE_SIZE];
#ifdef __MINGW32__
program_name = argv[0];
#else
program_name = basename(argv[0]);
#endif/*__MINGW32__*/
memcpy(key, MIFARE_CL_KEYA_DEFAULT_INFINEON, MIFARE_CL_KEY_LEN);
printf("%s - (C) 2006 by Harald Welte\n"
"This program is Free Software and has "
"ABSOLUTELY NO WARRANTY\n\n", program_name);
printf("initializing librfid\n");
rfid_init();
if (reader_init() < 0) {
fprintf(stderr, "error opening reader\n");
exit(1);
}
while (1) {
c = getopt_long(argc, argv, "k:r:l:w:b:h", mifare_opts,
&option_index);
if (c == -1)
break;
switch (c) {
int i;
case 'b':
page = atoi(optarg);
printf("key: %s\n", hexdump(key, MIFARE_CL_KEY_LEN));
len = MIFARE_CL_PAGE_SIZE;
mifare_l3();
for (i = 0; i <= 0xff; i++) {
key[MIFARE_CL_KEY_LEN-1]=i;
if (mifare_cl_auth(key, page) >= 0)
printf("KEY: %s\n",hexdump(key, MIFARE_CL_KEY_LEN));
}
break;
case 'k':
hexread(key, optarg, strlen(optarg));
printf("key: %s\n", hexdump(key, MIFARE_CL_KEY_LEN));
break;
case 'r':
page = atoi(optarg);
printf("read(key='%s',page=%u):",
hexdump(key, MIFARE_CL_KEY_LEN), page);
len = MIFARE_CL_PAGE_SIZE;
mifare_l3();
if (mifare_cl_auth(key, page) < 0)
exit(1);
uid_len=sizeof(uid);
uid=0;
if(rfid_layer2_getopt(l2h,RFID_OPT_LAYER2_UID,&uid,&uid_len)>=0)
printf("UID=%08X (len=%u)\n",uid,uid_len);
len=MIFARE_CL_PAGE_SIZE;
rc = rfid_protocol_read(ph, page, buf, &len);
if (rc < 0) {
printf("\n");
fprintf(stderr, "error during read\n");
break;
}
printf("len=%u data=%s\n", len, hexdump(buf, len));
if (page & 0x3 == 0x3) {
struct mfcl_access_sect s;
struct mfcl_access_exp_sect es;
int b;
u_int8_t recreated[4];
mfcl_parse_access(&s, buf+6);
printf("access b0:%u b1:%u b2:%u b3:%u\n",
s.block[0], s.block[1],
s.block[2], s.block[3]);
mfcl_access_to_exp(&es, &s);
for (b = 0; b < 3; b++)
printf("%u: %s\n", b, mfcl_access_exp_stringify(&es.block[b]));
printf("3: %s\n", mfcl_access_exp_acc_stringify(&es.acc));
#if 0
mfcl_compile_access(recreated, &s);
printf("recreated; %s\n", hexdump(recreated,4));
#endif
}
break;
case 'l':
page = atoi(optarg);
printf("read_loop(key='%s',page=%u):\n",
hexdump(key, MIFARE_CL_KEY_LEN), page);
while (1) {
mifare_l3();
if (mifare_cl_auth(key, page) < 0)
continue;
uid_len=sizeof(uid);
uid=0;
if(rfid_layer2_getopt(l2h,RFID_OPT_LAYER2_UID,&uid,&uid_len)>=0)
printf("UID=%08X (len=%u)\n",uid,uid_len);
len=MIFARE_CL_PAGE_SIZE;
rc = rfid_protocol_read(ph, page, buf, &len);
if (rc < 0) {
printf("\n");
fprintf(stderr, "error during read\n");
continue;
}
printf("%s\n", hexdump(buf, len));
}
break;
case 'w':
page = atoi(optarg);
len = strlen(argv[optind]);
len = hexread(buf, argv[optind], len);
printf("write(key='%s',page=%u):",
hexdump(key, MIFARE_CL_KEY_LEN), page);
printf(" '%s'(%u):", hexdump(buf, len), len);
mifare_l3();
if (mifare_cl_auth(key, page) < 0)
exit(1);
rc = rfid_protocol_write(ph, page, buf, len);
if (rc < 0) {
printf("\n");
fprintf(stderr, "error during write\n");
break;
}
printf("success\n");
break;
case 'h':
default:
help();
}
}
#if 0
rfid_protocol_close(ph);
rfid_protocol_fini(ph);
rfid_layer2_close(l2h);
rfid_layer2_fini(l2h);
#endif
rfid_reader_close(rh);
exit(0);
}
Binary file not shown.
+292
View File
@@ -0,0 +1,292 @@
/*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2
* as published by the Free Software Foundation
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include <stdio.h>
#include <unistd.h>
#include <stdlib.h>
#include <string.h>
#include <errno.h>
#include <ctype.h>
#define _GNU_SOURCE
#include <getopt.h>
#include <librfid/rfid.h>
#include <librfid/rfid_reader.h>
#include <librfid/rfid_layer2.h>
#include <librfid/rfid_protocol.h>
#include <librfid/rfid_protocol_mifare_classic.h>
#include <librfid/rfid_protocol_mifare_ul.h>
#define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0]))
static const char *
hexdump(const void *data, unsigned int len)
{
static char string[2048];
unsigned char *d = (unsigned char *) data;
unsigned int i, left, llen = len;
string[0] = '\0';
left = sizeof(string);
for (i = 0; llen--; i += 3) {
if (i >= sizeof(string) -4)
break;
snprintf(string+i, 4, " %02x", *d++);
} return string;
if (i >= sizeof(string) -2)
return string;
snprintf(string+i, 2, " ");
i++; llen = len;
d = (unsigned char *) data;
for (; llen--; i += 1) {
if (i >= sizeof(string) -2)
break;
snprintf(string+i, 2, "%c", isprint(*d) ? *d : '.');
d++;
}
return string;
}
static struct rfid_reader_handle *rh;
static struct rfid_layer2_handle *l2h;
static struct rfid_protocol_handle *ph;
static int init()
{
unsigned char buf[0x3f];
int rc;
printf("initializing librfid\n");
rfid_init();
printf("opening reader handle\n");
rh = rfid_reader_open(NULL, RFID_READER_CM5121);
if (!rh) {
fprintf(stderr, "error, no cm5121 handle\n");
return -1;
}
printf("opening layer2 handle\n");
l2h = rfid_layer2_init(rh, RFID_LAYER2_ISO14443A);
//l2h = rfid_layer2_init(rh, RFID_LAYER2_ISO14443B);
if (!l2h) {
fprintf(stderr, "error during iso14443a_init\n");
return -1;
}
//rc632_register_dump(rh->ah, buf);
printf("running layer2 anticol\n");
rc = rfid_layer2_open(l2h);
if (rc < 0) {
fprintf(stderr, "error during layer2_open\n");
return rc;
}
return 0;
}
static int l3(int protocol)
{
printf("running layer3 (ats)\n");
ph = rfid_protocol_init(l2h, protocol);
if (!ph) {
fprintf(stderr, "error during protocol_init\n");
return -1;
}
if (rfid_protocol_open(ph) < 0) {
fprintf(stderr, "error during protocol_open\n");
return -1;
}
printf("we now have layer3 up and running\n");
return 0;
}
static int send_command(char* sbuf, int slen, char* rbuf, int rlen)
{
int rv;
static int doit;
int answer, c = 0;
if(doit == 0) {
fprintf(stderr, "?? %s (%i bytes)\n", hexdump(sbuf, slen), slen);
fprintf(stderr, "Execute? (Yes/No/All/Exit) ");
answer = getc(stdin);
if(answer != '\n') do {
c = getc(stdin);
} while(c != '\n' && c != EOF);
switch(answer) {
case 'y': // Fall-through
case 'Y':
case '\n':
// Do nothing
break;
case 'n': // Fall-through
case 'N':
return 0;
break;
case 'a': // Fall-through
case 'A':
doit = 1;
break;
case 'e': // Fall-through
case 'E':
return -1;
break;
default:
return 0; // Default to 'n'
break;
}
}
printf(">> %s (%i bytes)\n", hexdump(sbuf, slen), slen);
rv = rfid_protocol_transceive(ph, sbuf, slen, rbuf, &rlen, 0, 0);
if (rv < 0) {
fprintf(stderr, "Error from transceive: %i\n", rv);
return rv;
}
printf("<< %s (%i bytes)\n", hexdump(rbuf, rlen), rlen);
if(rlen < 2 || rbuf[rlen-2] != (char)0x90 || rbuf[rlen-1] != 0x00) {
fprintf(stderr, "SW is not 90 00. Ignore (i) or Abort (a)? ");
answer = getc(stdin);
if(answer != '\n') do {
c = getc(stdin);
} while(c != '\n' && c != EOF);
switch(answer) {
case 'i': // Fall-through
case 'I':
case '\n':
// Do nothing
break;
case 'a': // Fall-through
case 'A':
return -1;
break;
default:
return -1; // Default to 'a'
}
}
return rlen;
}
static char *nextline(FILE* fh)
{
int buflen = 1024; // FIXME Might want to increase dynamically?
char *buffer = malloc(buflen);
if (!buffer) {
perror("malloc");
return 0;
}
if (!fgets(buffer, buflen, fh)) {
perror("fgets");
free(buffer);
return 0;
}
return buffer;
}
static int unhexchar(char c) {
if ((c - '0') >= 0 && (c - '0') < 10)
return c-'0';
if ((c - 'a') >= 0 && (c - 'a') < 6)
return 10 + c-'a';
if ((c - 'A') >= 0 && (c - 'A') < 6)
return 10 + c-'A';
return -1;
}
int make_command( const char *line, char **buffer, int *blen )
{
int len = strlen(line), pos;
*buffer = malloc( len );
*blen = 0;
if(!*buffer) {
perror("malloc");
return 0;
}
for(pos = 0; pos < len; pos++) {
if(!isxdigit(line[pos]))
continue;
if(! (pos+1 < len) )
continue;
(*buffer)[*blen] = unhexchar(line[pos]) * 16 + unhexchar(line[pos+1]);
pos += 1;
*blen += 1;
}
return 1;
}
int main(int argc, char **argv)
{
FILE *fh;
int slen, rlen, retval = 0;
char *next, *sbuf, *rbuf;
if (argc != 2) {
fprintf(stderr, "Syntax: %s scriptfile\n", argv[0]);
exit(1);
}
fh = fopen(argv[1], "r");
if (!fh) {
perror("fopen");
exit(1);
}
if (init() < 0)
exit(1);
if (l3(RFID_PROTOCOL_TCL) < 0)
exit(1);
printf("Protocol T=CL\n");
/* we've established T=CL at this point */
while (next = nextline(fh)) {
if (!(strlen(next) >= 2 && strncmp(next, "//", 2) == 0)) {
if (make_command(next, &sbuf, &slen)) {
rlen = 1024;
rbuf = calloc(rlen, 1);
retval = send_command(sbuf, slen, rbuf, rlen);
free(sbuf);
free(rbuf);
}
}
free(next);
if (retval < 0)
break;
}
rfid_reader_close(rh);
exit(0);
}