summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--easytool/easytool.c26
1 files changed, 23 insertions, 3 deletions
diff --git a/easytool/easytool.c b/easytool/easytool.c
index f8da4e0..a65ea22 100644
--- a/easytool/easytool.c
+++ b/easytool/easytool.c
@@ -41,6 +41,13 @@
/* Easycard specific includes */
#include "easycard.h"
+#define VERSION "0.01"
+#define COPYRIGHT \
+ "EasyTool "VERSION"\n" \
+ "(C) 2010 by Harald Welte <laforge@gnumonks.org>\n" \
+ "This is FREE SOFTWARE with ABSOLUTELY NO VARRANTY\n\n" \
+ "Use of this software is only authorized for RESEARCH PURPOSE!\n\n"
+
struct {
int fd;
unsigned long size;
@@ -175,24 +182,37 @@ static void dump_easycard(mifare_tag *mft)
}
}
+static void print_help(void)
+{
+}
+
int main(int argc, char **argv)
{
struct stat st;
+ printf(COPYRIGHT);
+
+ if (argc < 2) {
+ fprintf(stderr, "ERROR: You must specify the file name of "
+ "a mifare dump file (.mfd)\n");
+ print_help();
+ exit(2);
+ }
+
global.fd = open(argv[1], O_RDONLY);
if (global.fd < 0) {
- perror("open");
+ perror("Error opening the MFD file");
exit(1);
}
if (fstat(global.fd, &st) < 0) {
- perror("stat");
+ perror("Error stat()ing the MFD file");
exit(1);
}
global.size = st.st_size;
global.mft = mmap(NULL, global.size, PROT_READ, MAP_SHARED,
global.fd, 0);
if (!global.mft) {
- perror("mmap");
+ perror("Error mmap()ing the MFD file");
exit(1);
}
personal git repositories of Harald Welte. Your mileage may vary