Skip to content

Instantly share code, notes, and snippets.

@doegox
Last active August 1, 2019 09:19
Show Gist options
  • Save doegox/c35925b14c7b8dc4baf42d61d9c71f1b to your computer and use it in GitHub Desktop.
Save doegox/c35925b14c7b8dc4baf42d61d9c71f1b to your computer and use it in GitHub Desktop.
Testing script for Proxmark3 RDV4 external flash
#!/bin/bash
for ((i=0; i<100; i++)); do
echo -e "\n\nIteration $i"
rm -f test_flash_in.bin test_flash_out.bin
dd if=/dev/urandom of=test_flash_in.bin bs=65536 count=3
./proxmark3.sh -c "
mem wipe p 0;
mem wipe p 1;
mem wipe p 2;
mem load f test_flash_in o 0;
mem dump f test_flash_out o 0 l 196608"
rm test_flash_out.eml
HASH1=$(cat test_flash_in.bin|sha1sum)
HASH2=$(cat test_flash_out.bin|sha1sum)
if [ "$HASH1" != "$HASH2" ]; then
echo FAIL
exit 1
fi
rm -f test_flash_in.bin test_flash_out.bin
done
echo SUCCESS
@iceman1001
Copy link

and here I thought I was atleast going to see the semicolon at work :)
./proxmark3.sh -c 'mem wipe p 0; mem wipe p 1; mem wipe p 2"

@iceman1001
Copy link

but nice script.. Working with the pm3 client isnt that bad anymore from the bash shell. Of course like slurdge mentioned that assigning values from commands would be better.

@doegox
Copy link
Author

doegox commented Jul 14, 2019

Hi @iceman1001 as said in RfidResearchGroup/proxmark3#244 we've still the issue that we should add some delay after erase and write operations, still need to figure how much...
So the easy trick was to call mem wipe in several calls to the client.
I'll add a msleep command in the client commands, it'll ease scripts.

@doegox
Copy link
Author

doegox commented Jul 14, 2019

updated with msleep command

@doegox
Copy link
Author

doegox commented Jul 14, 2019

removed msleep as now BUSY_TIMEOUT was increased

@iceman1001
Copy link

you can remove that sleep command you added ;)
Look at those semi colons... mm mm mm

@doegox
Copy link
Author

doegox commented Jul 15, 2019

you can remove that sleep command you added ;)

already done tonight, sir...

@luminouw
Copy link

luminouw commented Aug 1, 2019

mem save no longer works, replaced it with mem dump : )

@doegox
Copy link
Author

doegox commented Aug 1, 2019

my bad, fixed, thanks @luminouw

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment