Add: two perl scripts from https://github.com/samyk/samytools/. Thanks @samyk! \n pm3_cs8.pl converts pm3 files to wave. \npm3_amii_bin2eml.pl convert / decrypts amiiboo dumps to eml format used when simulating.

This commit is contained in:
iceman1001 2019-12-23 22:52:50 +01:00
commit 1472922c9e
2 changed files with 724 additions and 0 deletions

43
tools/pm3_cs8.pl Executable file
View file

@ -0,0 +1,43 @@
#!/usr/bin/perl
use strict;
die "usage: $0 <pm3.trace/file.wav>\n" unless @ARGV == 1;
# Convert proxmark3 trace to cs8 (complex int8/hackrf fmt) for inspectrum
# From miek
if ($ARGV[0] =~ /wav$/)
{
system("sox $ARGV[0] -t raw -e signed-integer -b 16 $ARGV[0].cs16");
}
else
{
#perl -ne 'chomp; print pack "c", $_' p.trace > p.c8
my $f = "/tmp/pm3.trace." . rand();
open(F, ">$f") || die $!;
open(IN, "<$ARGV[0]");
while (<IN>)
{
chomp;
print F pack "c", $_;
}
close(IN);
close(F);
# upsample 100x and pad 2nd channel with zeroes
system("sox -t s8 -r 1 -c 1 -v 0.5 $f -t s8 -r 100 -c 2 $f.cs8 remix 1 0");
open(OUT, ">$ARGV[0].cs8") || die $!;
open(IN, "<$f.cs8") || die $!;
print OUT while <IN>;
print OUT "\0" x (1024 * 1024);
close(IN);
close(OUT);
unlink($f, "$f.cs8");
# pad file since inspectrum doesn't handle small files so well
#system("dd if=/dev/zero of=$f.pad bs=1m count=1 >>/dev/null");
#system("cat $f.cs8 $f.pad > $ARGV[1]");
}