From 5818f369da46fa49268dae0cecf3f6f94a233722 Mon Sep 17 00:00:00 2001 From: Aram Date: Sun, 18 Feb 2018 20:40:54 +0100 Subject: [PATCH 1/2] Fixed issue #27 --- libnfc_crypto1_crack.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libnfc_crypto1_crack.c b/libnfc_crypto1_crack.c index 1b41542..2015dcb 100755 --- a/libnfc_crypto1_crack.c +++ b/libnfc_crypto1_crack.c @@ -640,7 +640,7 @@ int main (int argc, const char * argv[]) { } char filename[21]; - sprintf(filename, "0x%04x_%03u%s.txt", uid, target_block, target_key == MC_AUTH_A ? "A" : "B"); + sprintf(filename, "0x%08x_%03u%s.txt", uid, target_block, target_key == MC_AUTH_A ? "A" : "B"); fp = fopen(filename, "wb"); printf("Found tag with uid %04x, collecting nonces for key %s of block %u (sector %u) using known key %s %012"PRIx64" for block %u (sector %u)\n", From 98593da4767826ad84989719e2cb157126795dc3 Mon Sep 17 00:00:00 2001 From: dkgitdev <36101416+dkgitdev@users.noreply.github.com> Date: Mon, 23 Apr 2018 01:16:10 +0700 Subject: [PATCH 2/2] better name handling --- txttobin.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/txttobin.py b/txttobin.py index 670e9ed..ac53400 100644 --- a/txttobin.py +++ b/txttobin.py @@ -1,6 +1,7 @@ import sys data = file(sys.argv[1], 'rb').readlines() -uid = sys.argv[1].replace('.txt','') +if sys.argv[1].endswith('.txt'): + uid = sys.argv[1][:-4] def parity(x): return ("{0:08b}".format(x).count('1') & 1)