3 PM3PATH
="$(dirname "$0")/.."
4 cd "$PM3PATH" ||
exit 1
6 DICPATH
="./client/dictionaries"
7 RESOURCEPATH
="./client/resources"
14 TESTMFNONCEBRUTE
=false
16 TESTFPGACOMPRESS
=false
23 # https://medium.com/@Drew_Stokes/bash-argument-parsing-54f3b81a6a8f
29 Usage: $0 [--long] [--gpu] [--clientbin /path/to/proxmark3] [mfkey|nonce2key|mf_nonce_brute|fpga_compress|bootrom|armsrc|client|recovery|common]
30 --long: Enable slow tests
31 --gpu: Enable tests requiring GPU
32 --clientbin ...: Specify path to proxmark3 binary to test
33 If no target given, all targets will be tested
46 if [ -n "$2" ] && [ ${2:0:1} != "-" ]; then
50 echo "Error: Argument for $1 is missing" >&2
104 -*|
--*=) # unsupported flags
105 echo "Error: Unsupported flag $1" >&2
108 *) # preserve positional arguments
114 # set positional arguments in their proper place
115 eval set -- "$PARAMS"
119 C_YELLOW
='\033[0;33m'
121 C_NC
='\033[0m' # No Color
122 C_OK
='\xe2\x9c\x94\xef\xb8\x8f'
123 C_FAIL
='\xe2\x9d\x8c'
125 # title, file name or file wildcard to check
126 function CheckFileExist
() {
131 echo -e "[ ${C_GREEN}OK${C_NC} ] ${C_OK}"
135 if ls "$2" 1> /dev
/null
2>&1; then
136 echo -e "[ ${C_GREEN}OK${C_NC} ] ${C_OK}"
140 echo -e "[ ${C_RED}FAIL${C_NC} ] ${C_FAIL}"
144 # [slow] [gpu] [retry] [ignore] <title> <command_line> <check_result_regex>
145 # slow: test takes more than ~5s
146 # gpu: test requires GPU presence
147 # retry: test repeated up to 3 times in case of failure
148 # ignore: test failure is not fatal
149 function CheckExecute
() {
150 if [ "$1" == "slow" ]; then
156 if [ "$1" == "gpu" ]; then
162 if [ "$1" == "retry" ]; then
163 local RETRY
="1 2 3 e"
168 if [ "$1" == "ignore" ]; then
169 local IGNOREFAILURE
=true
172 local IGNOREFAILURE
=false
177 if $SLOWTEST && ! $SLOWTESTS; then
178 echo -e "[ ${C_YELLOW}SKIPPED${C_NC} ] ( slow )"
181 if $GPUTEST && ! $GPUTESTS; then
182 echo -e "[ ${C_YELLOW}SKIPPED${C_NC} ] ( gpu )"
189 if echo "$RES" |
grep -q "$3"; then
190 echo -e "[ ${C_GREEN}OK${C_NC} ] ${C_OK}"
193 if [ ! $I == "e" ]; then echo "retry $I"; fi
196 if $IGNOREFAILURE; then
197 echo -e "[ ${C_YELLOW}IGNORED${C_NC} ]"
201 echo -e "[ ${C_RED}FAIL${C_NC} ] ${C_FAIL}"
202 echo -e "Execution trace:\n$RES"
206 echo -e "\n${C_BLUE}RRG/Iceman Proxmark3 test tool ${C_NC}\n"
208 echo -n "work directory: "
211 if [ "$TRAVIS_COMMIT" ]; then
212 if [ "$TRAVIS_PULL_REQUEST" == "false" ]; then
213 echo "Travis branch: $TRAVIS_BRANCH slug: $TRAVIS_REPO_SLUG commit: $TRAVIS_COMMIT"
215 echo "Travis pull request: $TRAVIS_PULL_REQUEST branch: $TRAVIS_BRANCH slug: $TRAVIS_PULL_REQUEST_SLUG commit: $TRAVIS_COMMIT"
219 echo -n "git branch: "
226 if $TESTALL ||
$TESTCOMMON; then
227 echo -e "\n${C_BLUE}Testing common:${C_NC}"
228 if ! CheckFileExist
"hardnested tables exists" "$RESOURCEPATH/hardnested_tables/bitflip_0_001_states.bin.bz2"; then break; fi
229 if ! CheckFileExist
"simmodule fw file exists" "$RESOURCEPATH/sim011.bin"; then break; fi
230 if ! CheckFileExist
"iCLASS dictionary exists" "$DICPATH/iclass_default_keys.dic"; then break; fi
231 if ! CheckFileExist
"MFC dictionary exists" "$DICPATH/mfc_default_keys.dic"; then break; fi
232 if ! CheckFileExist
"MFDES dictionary exists" "$DICPATH/mfdes_default_keys.dic"; then break; fi
233 if ! CheckFileExist
"MFP dictionary exists" "$DICPATH/mfp_default_keys.dic"; then break; fi
234 if ! CheckFileExist
"MFULC dictionary exists" "$DICPATH/mfulc_default_keys.dic"; then break; fi
235 if ! CheckFileExist
"T55XX dictionary exists" "$DICPATH/t55xx_default_pwds.dic"; then break; fi
237 echo -e "\n${C_BLUE}Testing tools:${C_NC}"
238 if ! CheckExecute
"xorcheck test" "tools/xorcheck.py 04 00 80 64 ba" "final LRC XOR byte value: 5A"; then break; fi
239 if ! CheckExecute
"findbits test" "tools/findbits.py 73 0110010101110011" "Match at bit 9: 011001010"; then break; fi
240 if ! CheckExecute
"findbits_test test" "tools/findbits_test.py 2>&1" "OK"; then break; fi
241 if ! CheckExecute
"pm3_eml_mfd test" "tools/pm3_eml_mfd_test.py 2>&1" "OK"; then break; fi
242 if ! CheckExecute
"recover_pk test" "tools/recover_pk.py selftests 2>&1" "Tests:.*\[OK\]"; then break; fi
244 if $TESTALL ||
$TESTBOOTROM; then
245 echo -e "\n${C_BLUE}Testing bootrom:${C_NC}"
246 if ! CheckFileExist
"bootrom exists" "./bootrom/obj/bootrom.elf"; then break; fi
248 if $TESTALL ||
$TESTARMSRC; then
249 echo -e "\n${C_BLUE}Testing armsrc:${C_NC}"
250 if ! CheckFileExist
"arm image exists" "./armsrc/obj/fullimage.elf"; then break; fi
252 if $TESTALL ||
$TESTRECOVERY; then
253 echo -e "\n${C_BLUE}Testing recovery:${C_NC}"
254 if ! CheckFileExist
"recovery image exists" "./recovery/proxmark3_recovery.bin"; then break; fi
257 if $TESTALL ||
$TESTFPGACOMPRESS; then
258 echo -e "\n${C_BLUE}Testing fpgacompress:${C_NC} ${FPGACPMPRESSBIN:=./tools/fpga_compress/fpga_compress}"
259 if ! CheckFileExist
"fpgacompress exists" "$FPGACPMPRESSBIN"; then break; fi
261 if $TESTALL ||
$TESTMFKEY; then
262 echo -e "\n${C_BLUE}Testing mfkey:${C_NC} ${MFKEY32V2BIN:=./tools/mfkey/mfkey32v2} ${MFKEY64BIN:=./tools/mfkey/mfkey64}"
263 if ! CheckFileExist
"mfkey32v2 exists" "$MFKEY32V2BIN"; then break; fi
264 if ! CheckFileExist
"mfkey64 exists" "$MFKEY64BIN"; then break; fi
265 # Need a decent example for mfkey32...
266 if ! CheckExecute
"mfkey32v2 test" "$MFKEY32V2BIN 12345678 1AD8DF2B 1D316024 620EF048 30D6CB07 C52077E2 837AC61A" "Found Key: \[a0a1a2a3a4a5\]"; then break; fi
267 if ! CheckExecute
"mfkey64 test" "$MFKEY64BIN 9c599b32 82a4166c a1e458ce 6eea41e0 5cadf439" "Found Key: \[ffffffffffff\]"; then break; fi
268 if ! CheckExecute
"mfkey64 long trace test" "$MFKEY64BIN 14579f69 ce844261 f8049ccb 0525c84f 9431cc40 7093df99 9972428ce2e8523f456b99c831e769dced09 8ca6827b ab797fd369e8b93a86776b40dae3ef686efd c3c381ba 49e2c9def4868d1777670e584c27230286f4 fbdcd7c1 4abd964b07d3563aa066ed0a2eac7f6312bf 9f9149ea" "Found Key: \[091e639cb715\]"; then break; fi
270 if $TESTALL ||
$TESTNONCE2KEY; then
271 echo -e "\n${C_BLUE}Testing nonce2key:${C_NC} ${NONCE2KEYBIN:=./tools/nonce2key/nonce2key}"
272 if ! CheckFileExist
"nonce2key exists" "$NONCE2KEYBIN"; then break; fi
273 if ! CheckExecute
"nonce2key test" "$NONCE2KEYBIN e9cadd9c a8bf4a12 a020a8285858b090 050f010607060e07 5693be6c00000000" "key recovered: fc00018778f7"; then break; fi
275 if $TESTALL ||
$TESTMFNONCEBRUTE; then
276 echo -e "\n${C_BLUE}Testing mf_nonce_brute:${C_NC} ${MFNONCEBRUTEBIN:=./tools/mf_nonce_brute/mf_nonce_brute}"
277 if ! CheckFileExist
"mf_nonce_brute exists" "$MFNONCEBRUTEBIN"; then break; fi
278 if ! CheckExecute slow
"mf_nonce_brute test 1/2" "$MFNONCEBRUTEBIN 9c599b32 5a920d85 1011 98d76b77 d6c6e870 0000 ca7e0b63 0111 3e709c8a" "Key found \[.*ffffffffffff.*\]"; then break; fi
279 if ! CheckExecute slow
"mf_nonce_brute test 2/2" "$MFNONCEBRUTEBIN 96519578 d7e3c6ac 0011 cd311951 9da49e49 0010 2bb22e00 0100 a4f7f398" "Key found \[.*3b7e4fd575ad.*\]"; then break; fi
281 # hitag2crack not yet part of "all"
282 # if $TESTALL || $TESTHITAG2CRACK; then
283 if $TESTHITAG2CRACK; then
284 echo -e "\n${C_BLUE}Testing ht2crack2:${C_NC} ${HT2CRACK2PATH:=./tools/hitag2crack/crack2/}"
285 if ! CheckFileExist
"ht2crack2buildtable exists" "$HT2CRACK2PATH/ht2crack2buildtable"; then break; fi
286 if ! CheckFileExist
"ht2crack2gentest exists" "$HT2CRACK2PATH/ht2crack2gentest"; then break; fi
287 if ! CheckFileExist
"ht2crack2search exists" "$HT2CRACK2PATH/ht2crack2search"; then break; fi
288 # 1.5Tb tables are supposed to be absent, so it's just a fast check without real cracking
289 if ! CheckExecute
"ht2crack2 quick test" "cd $HT2CRACK2PATH; ./ht2crack2gentest 1 && ./runalltests.sh; rm keystream*" "searching on bit"; then break; fi
291 echo -e "\n${C_BLUE}Testing ht2crack3:${C_NC} ${HT2CRACK3PATH:=./tools/hitag2crack/crack3/}"
292 if ! CheckFileExist
"ht2crack3 exists" "$HT2CRACK3PATH/ht2crack3"; then break; fi
293 if ! CheckFileExist
"ht2crack3test exists" "$HT2CRACK3PATH/ht2crack3test"; then break; fi
294 HT2CRACK3UID
=AABBCCDD
295 # Test fast only for HT2CRACK3KEY in begin of keyspace!
296 HT2CRACK3KEY
=000102030405
298 HT2CRACK3NRAR
=hitag2_
${HT2CRACK3UID}_nrar_
${HT2CRACK3N}emul.txt
299 if ! CheckExecute
"ht2crack3 gen testfile" "cd $HT2CRACK3PATH; python3 ../hitag2_gen_nRaR.py $HT2CRACK3KEY $HT2CRACK3UID $HT2CRACK3N > $HT2CRACK3NRAR && echo SUCCESS" "SUCCESS"; then break; fi
300 if ! CheckExecute
"ht2crack3test test" "cd $HT2CRACK3PATH; ./ht2crack3test $HT2CRACK3NRAR $HT2CRACK3KEY $HT2CRACK3UID|grep -v SUCCESS||echo SUCCESS" "SUCCESS"; then break; fi
301 if ! CheckExecute
"ht2crack3 test" "cd $HT2CRACK3PATH; ./ht2crack3 $HT2CRACK3UID $HT2CRACK3NRAR |egrep -v '(trying|partial)'" "key = $HT2CRACK3KEY"; then break; fi
302 if ! CheckExecute
"ht2crack3 rm testfile" "cd $HT2CRACK3PATH; rm $HT2CRACK3NRAR && echo SUCCESS" "SUCCESS"; then break; fi
304 echo -e "\n${C_BLUE}Testing ht2crack4:${C_NC} ${HT2CRACK4PATH:=./tools/hitag2crack/crack4/}"
305 if ! CheckFileExist
"ht2crack4 exists" "$HT2CRACK4PATH/ht2crack4"; then break; fi
306 HT2CRACK4UID
=12345678
307 HT2CRACK4KEY
=AABBCCDDEEFF
309 HT2CRACK4NRAR
=hitag2_
${HT2CRACK4UID}_nrar_
${HT2CRACK4N}emul.txt
310 # The success is probabilistic: a fresh random nRaR file is required for each run
311 # Order of magnitude to crack it: ~15s -> tagged as "slow"
312 if ! CheckExecute slow retry ignore
"ht2crack4 test" "cd $HT2CRACK4PATH; \
313 python3 ../hitag2_gen_nRaR.py $HT2CRACK4KEY $HT2CRACK4UID $HT2CRACK4N > $HT2CRACK4NRAR; \
314 ./ht2crack4 -u $HT2CRACK4UID -n $HT2CRACK4NRAR -N 16 -t 500000 2>&1; \
315 rm $HT2CRACK4NRAR" "key = $HT2CRACK4KEY"; then break; fi
317 echo -e "\n${C_BLUE}Testing ht2crack5:${C_NC} ${HT2CRACK5PATH:=./tools/hitag2crack/crack5/}"
318 if ! CheckFileExist
"ht2crack5 exists" "$HT2CRACK5PATH/ht2crack5"; then break; fi
319 HT2CRACK5UID
=12345678
320 HT2CRACK5KEY
=AABBCCDDEEFF
321 # The speed depends on the nRaR so we'll use two pairs known to work fast
322 HT2CRACK5NRAR
="71DA20AA 7EFDF3FA 2A4265F9 59653B07"
323 # Order of magnitude to crack it: ~12s on 1 core, ~3s on 4 cores -> tagged as "slow"
324 if ! CheckExecute slow
"ht2crack5 test" "cd $HT2CRACK5PATH; ./ht2crack5 $HT2CRACK5UID $HT2CRACK5NRAR" "Key: $HT2CRACK5KEY"; then break; fi
326 echo -e "\n${C_BLUE}Testing ht2crack5gpu:${C_NC} ${HT2CRACK5GPUPATH:=./tools/hitag2crack/crack5gpu/}"
327 if ! CheckFileExist
"ht2crack5gpu exists" "$HT2CRACK5GPUPATH/ht2crack5gpu"; then break; fi
328 HT2CRACK5GPUUID
=12345678
329 HT2CRACK5GPUKEY
=AABBCCDDEEFF
330 # The speed depends on the nRaR so we'll use two pairs known to work fast
331 HT2CRACK5GPUNRAR
="B438220C 944FFD74 942C59E3 3D450B34"
332 # Order of magnitude to crack it: ~15s -> tagged as "slow"
333 if ! CheckExecute slow gpu
"ht2crack5gpu test" "cd $HT2CRACK5GPUPATH; ./ht2crack5gpu $HT2CRACK5GPUUID $HT2CRACK5GPUNRAR" "Key: $HT2CRACK5GPUKEY"; then break; fi
335 echo -e "\n${C_BLUE}Testing ht2crack5opencl:${C_NC} ${HT2CRACK5OPENCLPATH:=./tools/hitag2crack/crack5opencl/}"
336 if ! CheckFileExist
"ht2crack5opencl exists" "$HT2CRACK5OPENCLPATH/ht2crack5opencl"; then break; fi
337 HT2CRACK5OPENCLUID
=12345678
338 HT2CRACK5OPENCLKEY
=AABBCCDDEEFF
339 # The speed depends on the nRaR so we'll use two pairs known to work fast
340 HT2CRACK5OPENCLNRAR
="B438220C 944FFD74 942C59E3 3D450B34"
341 # Order of magnitude to crack it: ~15s -> tagged as "slow"
342 if ! CheckExecute slow gpu
"ht2crack5opencl test" "cd $HT2CRACK5OPENCLPATH; ./ht2crack5opencl $HT2CRACK5OPENCLUID $HT2CRACK5OPENCLNRAR" "Key found.*: $HT2CRACK5OPENCLKEY"; then break; fi
344 if $TESTALL ||
$TESTCLIENT; then
345 echo -e "\n${C_BLUE}Testing client:${C_NC} ${CLIENTBIN:=./client/proxmark3}"
346 if ! CheckFileExist
"proxmark3 exists" "$CLIENTBIN"; then break; fi
347 # Avoid mangling history and logs
348 CLIENTBIN
="$CLIENTBIN --incognito"
349 echo -e "\n${C_BLUE}Testing basic help:${C_NC}"
350 if ! CheckExecute
"proxmark help" "$CLIENTBIN -h" "wait"; then break; fi
351 if ! CheckExecute
"proxmark help text ISO7816" "$CLIENTBIN -t 2>&1" "ISO7816"; then break; fi
352 if ! CheckExecute
"proxmark help text hardnested" "$CLIENTBIN -t 2>&1" "hardnested"; then break; fi
353 if ! CheckExecute
"proxmark full help dump" "$CLIENTBIN --fulltext 2>&1" "Full help dump done"; then break; fi
354 if ! CheckExecute
"proxmark multi cmds 1/2" "$CLIENTBIN -c 'rem foo;rem bar'" "remark: foo"; then break; fi
355 if ! CheckExecute
"proxmark multi cmds 2/2" "$CLIENTBIN -c 'rem foo;rem bar'" "remark: bar"; then break; fi
356 if ! CheckExecute
"proxmark multi stdin 1/4" "echo 'rem foo;rem bar;quit' |$CLIENTBIN" "remark: foo"; then break; fi
357 if ! CheckExecute
"proxmark multi stdin 2/4" "echo 'rem foo;rem bar;quit' |$CLIENTBIN" "remark: bar"; then break; fi
358 if ! CheckExecute
"proxmark multi stdin 3/4" "echo -e 'rem foo\nrem bar;quit' |$CLIENTBIN" "remark: foo"; then break; fi
359 if ! CheckExecute
"proxmark multi stdin 4/4" "echo -e 'rem foo\nrem bar;quit' |$CLIENTBIN" "remark: bar"; then break; fi
361 echo -e "\n${C_BLUE}Testing data manipulation:${C_NC}"
362 if ! CheckExecute
"reveng readline test" "$CLIENTBIN -c 'reveng -h;reveng -D'" "CRC-64/GO-ISO"; then break; fi
363 if ! CheckExecute
"reveng -g test" "$CLIENTBIN -c 'reveng -g abda202c'" "CRC-16/ISO-IEC-14443-3-A"; then break; fi
364 if ! CheckExecute
"reveng -w test" "$CLIENTBIN -c 'reveng -w 8 -s 01020304e3 010204039d'" "CRC-8/SMBUS"; then break; fi
365 if ! CheckExecute
"mfu pwdgen test" "$CLIENTBIN -c 'hf mfu pwdgen -t'" "Selftest OK"; then break; fi
366 if ! CheckExecute
"mfu keygen test" "$CLIENTBIN -c 'hf mfu keygen --uid 11223344556677'" "80 B1 C2 71 D8 A0"; then break; fi
367 if ! CheckExecute
"jooki encode test" "$CLIENTBIN -c 'hf jooki encode -t'" "04 28 F4 DA F0 4A 81 ( ok )"; then break; fi
368 if ! CheckExecute
"trace load/list 14a" "$CLIENTBIN -c 'trace load -f traces/hf_14a_mfu.trace; trace list -1 -t 14a;'" "READBLOCK(8)"; then break; fi
369 if ! CheckExecute
"trace load/list x" "$CLIENTBIN -c 'trace load -f traces/hf_14a_mfu.trace; trace list -x1 -t 14a;'" "0.0101840425"; then break; fi
371 echo -e "\n${C_BLUE}Testing LF:${C_NC}"
372 if ! CheckExecute
"lf AWID test" "$CLIENTBIN -c 'data load -f traces/lf_AWID-15-259.pm3;lf search -1'" "AWID ID found"; then break; fi
373 if ! CheckExecute
"lf EM410x test" "$CLIENTBIN -c 'data load -f traces/lf_EM4102-1.pm3;lf search -1'" "EM410x ID found"; then break; fi
374 if ! CheckExecute
"lf EM4x05 test" "$CLIENTBIN -c 'data load -f traces/lf_EM4x05.pm3;lf search -1'" "FDX-B ID found"; then break; fi
375 if ! CheckExecute
"lf FDX-A FECAVA test" "$CLIENTBIN -c 'data load -f traces/lf_EM4305_fdxa_destron.pm3;lf search -1'" "FDX-A FECAVA Destron ID found"; then break; fi
376 if ! CheckExecute
"lf FDX-B test" "$CLIENTBIN -c 'data load -f traces/lf_HomeAgain1600.pm3;lf search -1'" "FDX-B ID found"; then break; fi
377 if ! CheckExecute
"lf FDX/BioThermo test" "$CLIENTBIN -c 'data load -f traces/lf_FDXB_Bio-Thermo.pm3; lf fdxb demod'" "95.2 F / 35.1 C"; then break; fi
378 if ! CheckExecute
"lf GPROXII test" "$CLIENTBIN -c 'data load -f traces/lf_GProx_36_30_14489.pm3; lf search -1'" "Guardall G-Prox II ID found"; then break; fi
379 if ! CheckExecute
"lf HID Prox test" "$CLIENTBIN -c 'data load -f traces/lf_HID-proxCardII-05512-11432784-1.pm3;lf search -1'" "HID Prox ID found"; then break; fi
380 if ! CheckExecute
"lf IDTECK test" "$CLIENTBIN -c 'data load -f traces/lf_IDTECK_4944544BAC40E069.pm3; lf search -1'" "Idteck ID found"; then break; fi
381 if ! CheckExecute
"lf INDALA test" "$CLIENTBIN -c 'data load -f traces/lf_Indala-504278295.pm3;lf search -1'" "Indala ID found"; then break; fi
382 if ! CheckExecute
"lf KERI test" "$CLIENTBIN -c 'data load -f traces/lf_Keri.pm3;lf search -1'" "Pyramid ID found"; then break; fi
383 if ! CheckExecute
"lf NEXWATCH test" "$CLIENTBIN -c 'data load -f traces/lf_NEXWATCH_Quadrakey-521512301.pm3;lf search -1 '" "NexWatch ID found"; then break; fi
384 if ! CheckExecute
"lf SECURAKEY test" "$CLIENTBIN -c 'data load -f traces/lf_NEXWATCH_Securakey-64169.pm3;lf search -1 '" "Securakey ID found"; then break; fi
385 if ! CheckExecute
"lf PAC test" "$CLIENTBIN -c 'data load -f traces/lf_PAC-8E4C058E.pm3;lf search -1'" "PAC/Stanley ID found"; then break; fi
386 if ! CheckExecute
"lf PARADOX test" "$CLIENTBIN -c 'data load -f traces/lf_Paradox-96_40426-APJN08.pm3;lf search -1'" "Paradox ID found"; then break; fi
387 if ! CheckExecute
"lf VIKING test" "$CLIENTBIN -c 'data load -f traces/lf_Transit999-best.pm3;lf search -1'" "Viking ID found"; then break; fi
388 if ! CheckExecute
"lf VISA2000 test" "$CLIENTBIN -c 'data load -f traces/lf_VISA2000.pm3;lf search -1'" "Visa2000 ID found"; then break; fi
390 if ! CheckExecute slow
"lf T55 awid 26 test" "$CLIENTBIN -c 'data load -f traces/lf_ATA5577_awid_26.pm3; lf search -1'" "AWID ID found"; then break; fi
391 if ! CheckExecute slow
"lf T55 awid 26 test2" "$CLIENTBIN -c 'data load -f traces/lf_ATA5577_awid_26.pm3; lf awid demod'" \
392 "AWID - len: 26 FC: 224 Card: 1337 - Wiegand: 3c00a73"; then break; fi
393 if ! CheckExecute slow
"lf T55 awid 50 test" "$CLIENTBIN -c 'data load -f traces/lf_ATA5577_awid_50.pm3; lf search -1'" "AWID ID found"; then break; fi
394 if ! CheckExecute slow
"lf T55 awid 50 test2" "$CLIENTBIN -c 'data load -f traces/lf_ATA5577_awid_50.pm3; lf awid demod'" \
395 "AWID - len: 50 FC: 2001 Card: 13371337 - Wiegand: 20fa201980f92, Raw: 0128b12eb1811d7117e22111"; then break; fi
396 if ! CheckExecute slow
"lf T55 em410x test" "$CLIENTBIN -c 'data load -f traces/lf_ATA5577_em410x.pm3; lf search -1'" "EM410x ID found"; then break; fi
397 if ! CheckExecute slow
"lf T55 em410x test2" "$CLIENTBIN -c 'data load -f traces/lf_ATA5577_em410x.pm3; lf em 410x demod'" \
398 "EM 410x ID 0F0368568B"; then break; fi
399 if ! CheckExecute slow
"lf T55 fdxb_animal test" "$CLIENTBIN -c 'data load -f traces/lf_ATA5577_fdxb_animal.pm3; lf search -1'" "FDX-B ID found"; then break; fi
400 if ! CheckExecute slow
"lf T55 fdxb_animal test2" "$CLIENTBIN -c 'data load -f traces/lf_ATA5577_fdxb_animal.pm3; lf fdxb demod'" \
401 "Animal ID 999-000000112233"; then break; fi
402 if ! CheckExecute slow
"lf T55 fdxb_extended test" "$CLIENTBIN -c 'data load -f traces/lf_ATA5577_fdxb_extended.pm3; lf search -1'" "FDX-B ID found"; then break; fi
403 if ! CheckExecute slow
"lf T55 fdxb_extended test2" "$CLIENTBIN -c 'data load -f traces/lf_ATA5577_fdxb_extended.pm3; lf fdxb demod'" \
404 "temperature 95.2 F / 35.1 C"; then break; fi
405 if ! CheckExecute slow
"lf T55 gallagher test" "$CLIENTBIN -c 'data load -f traces/lf_ATA5577_gallagher.pm3; lf search -1'" "GALLAGHER ID found"; then break; fi
406 if ! CheckExecute slow
"lf T55 gallagher test2" "$CLIENTBIN -c 'data load -f traces/lf_ATA5577_gallagher.pm3; lf gallagher demod'" \
407 "GALLAGHER - Region: 1 FC: 16640 CN: 201 Issue Level: 1"; then break; fi
408 if ! CheckExecute slow
"lf T55 gproxii test" "$CLIENTBIN -c 'data load -f traces/lf_ATA5577_gproxii.pm3; lf search -1'" "Guardall G-Prox II ID found"; then break; fi
409 if ! CheckExecute slow
"lf T55 gproxii test2" "$CLIENTBIN -c 'data load -f traces/lf_ATA5577_gproxii.pm3; lf gproxii demod'" \
410 "G-Prox-II - len: 26 FC: 123 Card: 11223, Raw: f98c7038c63356c7ac26398c"; then break; fi
411 if ! CheckExecute slow
"lf T55 hid test" "$CLIENTBIN -c 'data load -f traces/lf_ATA5577_hid.pm3; lf search -1'" "HID Prox ID found"; then break; fi
412 if ! CheckExecute slow
"lf T55 hid test2" "$CLIENTBIN -c 'data load -f traces/lf_ATA5577_hid.pm3; lf hid demod'" \
413 "FC: 118 CN: 1603"; then break; fi
414 if ! CheckExecute slow
"lf T55 hid_48 test" "$CLIENTBIN -c 'data load -f traces/lf_ATA5577_hid_48.pm3; lf search -1'" "HID Prox ID found"; then break; fi
415 if ! CheckExecute slow
"lf T55 hid_48 test2" "$CLIENTBIN -c 'data load -f traces/lf_ATA5577_hid_48.pm3; lf hid demod'" \
416 "HID Corporate 1000 48-bit"; then break; fi
417 if ! CheckExecute slow
"lf T55 indala_hedem test" "$CLIENTBIN -c 'data load -f traces/lf_ATA5577_indala_hedem.pm3; lf search -1'" "Indala ID found"; then break; fi
418 if ! CheckExecute slow
"lf T55 indala_hedem test2" "$CLIENTBIN -c 'data load -f traces/lf_ATA5577_indala_hedem.pm3; lf indala demod'" \
419 "Heden-2L \| 888"; then break; fi
420 if ! CheckExecute slow
"lf T55 indala test" "$CLIENTBIN -c 'data load -f traces/lf_ATA5577_indala.pm3; lf search -1'" "Indala ID found"; then break; fi
421 if ! CheckExecute slow
"lf T55 indala test2" "$CLIENTBIN -c 'data load -f traces/lf_ATA5577_indala.pm3; lf indala demod'" \
422 "Fmt 26 FC: 123 Card: 1337 checksum: 10"; then break; fi
423 if ! CheckExecute slow
"lf T55 indala_224 test" "$CLIENTBIN -c 'data load -f traces/lf_ATA5577_indala_224.pm3; lf search -1'" "Indala ID found"; then break; fi
424 if ! CheckExecute slow
"lf T55 indala_224 test2" "$CLIENTBIN -c 'data load -f traces/lf_ATA5577_indala_224.pm3; lf indala demod'" \
425 "Indala (len 224) Raw: 80000001b23523a6c2e31eba3cbee4afb3c6ad1fcf649393928c14e5"; then break; fi
426 if ! CheckExecute slow
"lf T55 io test" "$CLIENTBIN -c 'data load -f traces/lf_ATA5577_io.pm3; lf search -1'" "IO Prox ID found"; then break; fi
427 if ! CheckExecute slow
"lf T55 io test2" "$CLIENTBIN -c 'data load -f traces/lf_ATA5577_io.pm3; lf io demod'" \
428 "IO Prox - XSF(01)01:01337, Raw: 007840603059cf3f (ok)"; then break; fi
429 if ! CheckExecute slow
"lf T55 jablotron test" "$CLIENTBIN -c 'data load -f traces/lf_ATA5577_jablotron.pm3; lf search -1'" "Jablotron ID found"; then break; fi
430 if ! CheckExecute slow
"lf T55 jablotron test2" "$CLIENTBIN -c 'data load -f traces/lf_ATA5577_jablotron.pm3; lf jablotron demod'" \
431 "Printed: 1410-00-0011-2233"; then break; fi
432 if ! CheckExecute slow
"lf T55 keri test" "$CLIENTBIN -c 'data load -f traces/lf_ATA5577_keri.pm3; lf search -1'" "KERI ID found"; then break; fi
433 if ! CheckExecute slow
"lf T55 keri test2" "$CLIENTBIN -c 'data load -f traces/lf_ATA5577_keri.pm3; lf keri demod'" \
434 "KERI - Internal ID: 112233, Raw: E00000008001B669"; then break; fi
435 if ! CheckExecute slow
"lf T55 keri_internalid test" "$CLIENTBIN -c 'data load -f traces/lf_ATA5577_keri_internalid.pm3; lf search -1'" "KERI ID found"; then break; fi
436 if ! CheckExecute slow
"lf T55 keri_internalid test2" "$CLIENTBIN -c 'data load -f traces/lf_ATA5577_keri_internalid.pm3; lf keri demod'" \
437 "KERI - Internal ID: 12345, Raw: E000000080003039"; then break; fi
438 if ! CheckExecute slow
"lf T55 keri_msid test" "$CLIENTBIN -c 'data load -f traces/lf_ATA5577_keri_msid.pm3; lf search -1'" "KERI ID found"; then break; fi
439 if ! CheckExecute slow
"lf T55 keri_msid test2" "$CLIENTBIN -c 'data load -f traces/lf_ATA5577_keri_msid.pm3; lf keri demod'" \
440 "Descrambled MS - FC: 6 Card: 12345"; then break; fi
441 # if ! CheckExecute slow "lf T55 motorola test" "$CLIENTBIN -c 'data load -f traces/lf_ATA5577_motorola.pm3; lf search -1'" "Indala ID found"; then break; fi
442 if ! CheckExecute slow
"lf T55 motorola test2" "$CLIENTBIN -c 'data load -f traces/lf_ATA5577_motorola.pm3; lf motorola demod'" \
443 "Motorola - fmt: 26 FC: 258 Card: 2, Raw: A0000000A0002021"; then break; fi
444 if ! CheckExecute slow
"lf T55 nedap test" "$CLIENTBIN -c 'data load -f traces/lf_ATA5577_nedap.pm3; lf search -1'" "NEDAP ID found"; then break; fi
445 if ! CheckExecute slow
"lf T55 nedap test2" "$CLIENTBIN -c 'data load -f traces/lf_ATA5577_nedap.pm3; lf nedap demod'" \
446 "NEDAP (64b) - ID: 12345 subtype: 1 customer code: 291 / 0x123 Raw: FF82246508209953"; then break; fi
447 if ! CheckExecute slow
"lf T55 nexwatch test" "$CLIENTBIN -c 'data load -f traces/lf_ATA5577_nexwatch.pm3; lf search -1'" "NexWatch ID found"; then break; fi
448 if ! CheckExecute slow
"lf T55 nexwatch test2" "$CLIENTBIN -c 'data load -f traces/lf_ATA5577_nexwatch.pm3; lf nexwatch demod'" \
449 "Raw : 5600000000213C9F8F150C00"; then break; fi
450 if ! CheckExecute slow
"lf T55 nexwatch_nexkey test" "$CLIENTBIN -c 'data load -f traces/lf_ATA5577_nexwatch_nexkey.pm3; lf search -1'" "NexWatch ID found"; then break; fi
451 if ! CheckExecute slow
"lf T55 nexwatch_nexkey test2" "$CLIENTBIN -c 'data load -f traces/lf_ATA5577_nexwatch_nexkey.pm3; lf nexwatch demod'" \
452 "88bit id : 521512301 (0x1f15a56d)"; then break; fi
453 if ! CheckExecute slow
"lf T55 nexwatch_quadrakey test" "$CLIENTBIN -c 'data load -f traces/lf_ATA5577_nexwatch_quadrakey.pm3; lf search -1'" "NexWatch ID found"; then break; fi
454 if ! CheckExecute slow
"lf T55 nexwatch_quadrakey test2" "$CLIENTBIN -c 'data load -f traces/lf_ATA5577_nexwatch_quadrakey.pm3; lf nexwatch demod'" \
455 "88bit id : 521512301 (0x1f15a56d)"; then break; fi
456 if ! CheckExecute slow
"lf T55 noralsy test" "$CLIENTBIN -c 'data load -f traces/lf_ATA5577_noralsy.pm3; lf search -1'" "Noralsy ID found"; then break; fi
457 if ! CheckExecute slow
"lf T55 noralsy test2" "$CLIENTBIN -c 'data load -f traces/lf_ATA5577_noralsy.pm3; lf noralsy demod'" \
458 "Noralsy - Card: 112233, Year: 2000, Raw: BB0214FF0110002233070000"; then break; fi
459 if ! CheckExecute slow
"lf T55 pac test" "$CLIENTBIN -c 'data load -f traces/lf_ATA5577_pac.pm3; lf search -1'" "PAC/Stanley ID found"; then break; fi
460 if ! CheckExecute slow
"lf T55 pac test2" "$CLIENTBIN -c 'data load -f traces/lf_ATA5577_pac.pm3; lf pac demod'" \
461 "PAC/Stanley - Card: CD4F5552, Raw: FF2049906D8511C593155B56D5B2649F"; then break; fi
462 if ! CheckExecute slow
"lf T55 paradox test" "$CLIENTBIN -c 'data load -f traces/lf_ATA5577_paradox.pm3; lf search -1'" "Paradox ID found"; then break; fi
463 if ! CheckExecute slow
"lf T55 paradox test2" "$CLIENTBIN -c 'data load -f traces/lf_ATA5577_paradox.pm3; lf paradox demod'" \
464 "Paradox - ID: 004209dea FC: 96 Card: 40426, Checksum: b2, Raw: 0f55555695596a6a9999a59a"; then break; fi
465 if ! CheckExecute slow
"lf T55 presco test" "$CLIENTBIN -c 'data load -f traces/lf_ATA5577_presco.pm3; lf search -1'" "Presco ID found"; then break; fi
466 if ! CheckExecute slow
"lf T55 presco test2" "$CLIENTBIN -c 'data load -f traces/lf_ATA5577_presco.pm3; lf presco demod'" \
467 "Presco Site code: 30 User code: 8665 Full code: 1E8021D9 Raw: 10D0000000000000000000001E8021D9"; then break; fi
468 if ! CheckExecute slow
"lf T55 pyramid test" "$CLIENTBIN -c 'data load -f traces/lf_ATA5577_pyramid.pm3; lf search -1'" "Pyramid ID found"; then break; fi
469 if ! CheckExecute slow
"lf T55 pyramid test2" "$CLIENTBIN -c 'data load -f traces/lf_ATA5577_pyramid.pm3; lf pyramid demod'" \
470 "Pyramid - len: 26, FC: 123 Card: 11223 - Wiegand: 2f657ae, Raw: 00010101010101010101016eb35e5da4"; then break; fi
471 if ! CheckExecute slow
"lf T55 securakey test" "$CLIENTBIN -c 'data load -f traces/lf_ATA5577_securakey.pm3; lf search -1'" "Securakey ID found"; then break; fi
472 if ! CheckExecute slow
"lf T55 securakey test2" "$CLIENTBIN -c 'data load -f traces/lf_ATA5577_securakey.pm3; lf securakey demod'" \
473 "Securakey - len: 26 FC: 0x35 Card: 64169, Raw: 7FCB400001ADEA5344300000"; then break; fi
474 if ! CheckExecute slow
"lf T55 viking test" "$CLIENTBIN -c 'data load -f traces/lf_ATA5577_viking.pm3; lf search -1'" "Viking ID found"; then break; fi
475 if ! CheckExecute slow
"lf T55 viking test2" "$CLIENTBIN -c 'data load -f traces/lf_ATA5577_viking.pm3; lf viking demod'" \
476 "Viking - Card 0001A337, Raw: F200000001A337CF"; then break; fi
477 if ! CheckExecute slow
"lf T55 visa2000 test" "$CLIENTBIN -c 'data load -f traces/lf_ATA5577_visa2000.pm3; lf search -1'" "Visa2000 ID found"; then break; fi
478 if ! CheckExecute slow
"lf T55 visa2000 test2" "$CLIENTBIN -c 'data load -f traces/lf_ATA5577_visa2000.pm3; lf visa2000 demod'" \
479 "Visa2000 - Card 112233, Raw: 564953320001B66900000183"; then break; fi
481 echo -e "\n${C_BLUE}Testing HF:${C_NC}"
482 if ! CheckExecute
"hf mf offline text" "$CLIENTBIN -c 'hf mf'" "at_enc"; then break; fi
483 if ! CheckExecute slow retry ignore
"hf mf hardnested long test" "$CLIENTBIN -c 'hf mf hardnested -t --tk 000000000000'" "found:"; then break; fi
484 if ! CheckExecute slow
"hf iclass loclass long test" "$CLIENTBIN -c 'hf iclass loclass --long'" "verified (ok)"; then break; fi
485 if ! CheckExecute slow
"emv long test" "$CLIENTBIN -c 'emv test -l'" "Test(s) \[ ok"; then break; fi
486 if ! CheckExecute
"hf iclass lookup test" "$CLIENTBIN -c 'hf iclass lookup --csn 9655a400f8ff12e0 --epurse f0ffffffffffffff --macs 0000000089cb984b -f $DICPATH/iclass_default_keys.dic'" \
487 "valid key AE A6 84 A6 DA B2 32 78"; then break; fi
489 if ! $SLOWTESTS; then
490 if ! CheckExecute
"hf iclass loclass test" "$CLIENTBIN -c 'hf iclass loclass --test'" "key diversification (ok)"; then break; fi
491 if ! CheckExecute
"emv test" "$CLIENTBIN -c 'emv test'" "Test(s) \[ ok"; then break; fi
494 echo -e "\n------------------------------------------------------------"
495 echo -e "Tests [ ${C_GREEN}OK${C_NC} ] ${C_OK}\n"
498 echo -e "\n------------------------------------------------------------"
499 echo -e "\nTests [ ${C_RED}FAIL${C_NC} ] ${C_FAIL}\n"