diff --git a/Makefile b/Makefile index 3e612a3e4..6b041b54a 100644 --- a/Makefile +++ b/Makefile @@ -268,8 +268,8 @@ style: [ -x client/proxmark3 ] && client/proxmark3 -m > doc/commands.md # Make sure python3 is installed @command -v python3 >/dev/null || ( echo "Please install 'python3' package first" ; exit 1 ) - # Update commands.json - [ -x client/proxmark3 ] && client/proxmark3 --fulltext | python3 client/pyscripts/pm3_help2json.py - doc/commands.json + # Update commands.json, patch port in cas it was run under Windows + [ -x client/proxmark3 ] && client/proxmark3 --fulltext | sed 's#com[0-9]#/dev/ttyacm0#'|python3 client/pyscripts/pm3_help2json.py - doc/commands.json # Update the readline autocomplete autogenerated code [ -x client/proxmark3 ] && client/proxmark3 --fulltext | python3 client/pyscripts/pm3_help2list.py - client/src/rl_vocabulory.h diff --git a/armsrc/hitag2crack.c b/armsrc/hitag2crack.c index f4943ec57..ed7daecd5 100644 --- a/armsrc/hitag2crack.c +++ b/armsrc/hitag2crack.c @@ -1,5 +1,6 @@ //----------------------------------------------------------------------------- -// Borrowed initially from hitag2crack +// Borrowed initially from https://github.com/factoritbv/hitag2hell +// and https://github.com/AdamLaurie/RFIDler/blob/master/firmware/Pic32/RFIDler.X/src/hitag2crack.c // Copyright (C) Kevin Sheldrake , Aug 2018 // Copyright (C) Proxmark3 contributors. See AUTHORS.md for details. // diff --git a/armsrc/hitag2crack.h b/armsrc/hitag2crack.h index 570635f9b..9a123ec30 100644 --- a/armsrc/hitag2crack.h +++ b/armsrc/hitag2crack.h @@ -1,5 +1,6 @@ //----------------------------------------------------------------------------- -// Borrowed initially from hitag2crack +// Borrowed initially from https://github.com/factoritbv/hitag2hell +// and https://github.com/AdamLaurie/RFIDler/blob/master/firmware/Pic32/RFIDler.X/src/hitag2crack.c // Copyright (C) Kevin Sheldrake , Aug 2018 // Copyright (C) Proxmark3 contributors. See AUTHORS.md for details. // diff --git a/armsrc/lfops.c b/armsrc/lfops.c index f5cc439ba..d19e61d65 100644 --- a/armsrc/lfops.c +++ b/armsrc/lfops.c @@ -1,4 +1,5 @@ //----------------------------------------------------------------------------- +// Copyright (C) Jonathan Westhues, 2005 // Copyright (C) Proxmark3 contributors. See AUTHORS.md for details. // // This program is free software: you can redistribute it and/or modify diff --git a/armsrc/lfops.h b/armsrc/lfops.h index 8d80120c9..0d6b7e342 100644 --- a/armsrc/lfops.h +++ b/armsrc/lfops.h @@ -1,4 +1,5 @@ //----------------------------------------------------------------------------- +// Copyright (C) Jonathan Westhues, 2005 // Copyright (C) Proxmark3 contributors. See AUTHORS.md for details. // // This program is free software: you can redistribute it and/or modify diff --git a/armsrc/mifarecmd.c b/armsrc/mifarecmd.c index 0dbc1e446..76312a702 100644 --- a/armsrc/mifarecmd.c +++ b/armsrc/mifarecmd.c @@ -1,4 +1,5 @@ //----------------------------------------------------------------------------- +// Copyright (C) Gerhard de Koning Gans - May 2008 // Copyright (C) Proxmark3 contributors. See AUTHORS.md for details. // // This program is free software: you can redistribute it and/or modify diff --git a/armsrc/mifarecmd.h b/armsrc/mifarecmd.h index e59fec29b..c854cd136 100644 --- a/armsrc/mifarecmd.h +++ b/armsrc/mifarecmd.h @@ -1,4 +1,5 @@ //----------------------------------------------------------------------------- +// Copyright (C) Gerhard de Koning Gans - May 2008 // Copyright (C) Proxmark3 contributors. See AUTHORS.md for details. // // This program is free software: you can redistribute it and/or modify diff --git a/armsrc/mifaresim.c b/armsrc/mifaresim.c index d5737b976..a4691ccb8 100644 --- a/armsrc/mifaresim.c +++ b/armsrc/mifaresim.c @@ -1,4 +1,5 @@ //----------------------------------------------------------------------------- +// Copyright (C) Gerhard de Koning Gans - May 2008 // Copyright (C) Proxmark3 contributors. See AUTHORS.md for details. // // This program is free software: you can redistribute it and/or modify diff --git a/armsrc/mifaresim.h b/armsrc/mifaresim.h index 7decfa3ce..b22659df6 100644 --- a/armsrc/mifaresim.h +++ b/armsrc/mifaresim.h @@ -1,4 +1,5 @@ //----------------------------------------------------------------------------- +// Copyright (C) Gerhard de Koning Gans - May 2008 // Copyright (C) Proxmark3 contributors. See AUTHORS.md for details. // // This program is free software: you can redistribute it and/or modify diff --git a/armsrc/mifaresniff_disabled.c b/armsrc/mifaresniff_disabled.c index 05927bc6d..75a5b9524 100644 --- a/armsrc/mifaresniff_disabled.c +++ b/armsrc/mifaresniff_disabled.c @@ -1,4 +1,5 @@ //----------------------------------------------------------------------------- +// Copyright (C) Gerhard de Koning Gans - May 2008 // Copyright (C) Proxmark3 contributors. See AUTHORS.md for details. // // This program is free software: you can redistribute it and/or modify diff --git a/armsrc/mifaresniff_disabled.h b/armsrc/mifaresniff_disabled.h index 4f2f43076..8911ea268 100644 --- a/armsrc/mifaresniff_disabled.h +++ b/armsrc/mifaresniff_disabled.h @@ -1,4 +1,5 @@ //----------------------------------------------------------------------------- +// Copyright (C) Gerhard de Koning Gans - May 2008 // Copyright (C) Proxmark3 contributors. See AUTHORS.md for details. // // This program is free software: you can redistribute it and/or modify diff --git a/armsrc/mifareutil.c b/armsrc/mifareutil.c index 2de686589..d0da3191e 100644 --- a/armsrc/mifareutil.c +++ b/armsrc/mifareutil.c @@ -1,4 +1,5 @@ //----------------------------------------------------------------------------- +// Copyright (C) Gerhard de Koning Gans - May 2008 // Copyright (C) Proxmark3 contributors. See AUTHORS.md for details. // // This program is free software: you can redistribute it and/or modify diff --git a/armsrc/mifareutil.h b/armsrc/mifareutil.h index 1d19b9036..dddb76c98 100644 --- a/armsrc/mifareutil.h +++ b/armsrc/mifareutil.h @@ -1,4 +1,5 @@ //----------------------------------------------------------------------------- +// Copyright (C) Gerhard de Koning Gans - May 2008 // Copyright (C) Proxmark3 contributors. See AUTHORS.md for details. // // This program is free software: you can redistribute it and/or modify diff --git a/armsrc/radixsort.c b/armsrc/radixsort.c deleted file mode 100644 index 058683f05..000000000 --- a/armsrc/radixsort.c +++ /dev/null @@ -1,114 +0,0 @@ -//----------------------------------------------------------------------------- -// Copyright (C) Proxmark3 contributors. See AUTHORS.md for details. -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// 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. -// -// See LICENSE.txt for the text of the license. -//----------------------------------------------------------------------------- -#include "radixsort.h" - -uint64_t *radixSort(uint64_t *array, uint32_t size) { - rscounts_t counts; - memset(&counts, 0, 256 * 8 * sizeof(uint32_t)); - uint64_t *cpy = (uint64_t *)calloc(size * sizeof(uint64_t), sizeof(uint8_t)); - uint32_t o8 = 0, o7 = 0, o6 = 0, o5 = 0, o4 = 0, o3 = 0, o2 = 0, o1 = 0; - uint32_t t8, t7, t6, t5, t4, t3, t2, t1; - uint32_t x; - // calculate counts - for (x = 0; x < size; ++x) { - t8 = array[x] & 0xff; - t7 = (array[x] >> 8) & 0xff; - t6 = (array[x] >> 16) & 0xff; - t5 = (array[x] >> 24) & 0xff; - t4 = (array[x] >> 32) & 0xff; - t3 = (array[x] >> 40) & 0xff; - t2 = (array[x] >> 48) & 0xff; - t1 = (array[x] >> 56) & 0xff; - counts.c8[t8]++; - counts.c7[t7]++; - counts.c6[t6]++; - counts.c5[t5]++; - counts.c4[t4]++; - counts.c3[t3]++; - counts.c2[t2]++; - counts.c1[t1]++; - } - // convert counts to offsets - for (x = 0; x < 256; ++x) { - t8 = o8 + counts.c8[x]; - t7 = o7 + counts.c7[x]; - t6 = o6 + counts.c6[x]; - t5 = o5 + counts.c5[x]; - t4 = o4 + counts.c4[x]; - t3 = o3 + counts.c3[x]; - t2 = o2 + counts.c2[x]; - t1 = o1 + counts.c1[x]; - counts.c8[x] = o8; - counts.c7[x] = o7; - counts.c6[x] = o6; - counts.c5[x] = o5; - counts.c4[x] = o4; - counts.c3[x] = o3; - counts.c2[x] = o2; - counts.c1[x] = o1; - o8 = t8; - o7 = t7; - o6 = t6; - o5 = t5; - o4 = t4; - o3 = t3; - o2 = t2; - o1 = t1; - } - // radix - for (x = 0; x < size; ++x) { - t8 = array[x] & 0xff; - cpy[counts.c8[t8]] = array[x]; - counts.c8[t8]++; - } - for (x = 0; x < size; ++x) { - t7 = (cpy[x] >> 8) & 0xff; - array[counts.c7[t7]] = cpy[x]; - counts.c7[t7]++; - } - for (x = 0; x < size; ++x) { - t6 = (array[x] >> 16) & 0xff; - cpy[counts.c6[t6]] = array[x]; - counts.c6[t6]++; - } - for (x = 0; x < size; ++x) { - t5 = (cpy[x] >> 24) & 0xff; - array[counts.c5[t5]] = cpy[x]; - counts.c5[t5]++; - } - for (x = 0; x < size; ++x) { - t4 = (array[x] >> 32) & 0xff; - cpy[counts.c4[t4]] = array[x]; - counts.c4[t4]++; - } - for (x = 0; x < size; ++x) { - t3 = (cpy[x] >> 40) & 0xff; - array[counts.c3[t3]] = cpy[x]; - counts.c3[t3]++; - } - for (x = 0; x < size; ++x) { - t2 = (array[x] >> 48) & 0xff; - cpy[counts.c2[t2]] = array[x]; - counts.c2[t2]++; - } - for (x = 0; x < size; ++x) { - t1 = (cpy[x] >> 56) & 0xff; - array[counts.c1[t1]] = cpy[x]; - counts.c1[t1]++; - } - free(cpy); - return array; -} diff --git a/armsrc/radixsort.h b/armsrc/radixsort.h deleted file mode 100644 index fd02ef681..000000000 --- a/armsrc/radixsort.h +++ /dev/null @@ -1,37 +0,0 @@ -//----------------------------------------------------------------------------- -// Copyright (C) Proxmark3 contributors. See AUTHORS.md for details. -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// 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. -// -// See LICENSE.txt for the text of the license. -//----------------------------------------------------------------------------- -#ifndef RADIXSORT_H__ -#define RADIXSORT_H__ - -#include "common.h" - -typedef union { - struct { - uint32_t c8[256]; - uint32_t c7[256]; - uint32_t c6[256]; - uint32_t c5[256]; - uint32_t c4[256]; - uint32_t c3[256]; - uint32_t c2[256]; - uint32_t c1[256]; - }; - uint32_t counts[256 * 8]; -} rscounts_t; - -uint64_t *radixSort(uint64_t *array, uint32_t size); - -#endif // RADIXSORT_H__