Added LF frequency adjustments from d18c7db, cleaned up code,
typo fixes in iso14443a code, added the missing "tools" directory, added initial elements for online/offline detection for commands.
This commit is contained in:
39
tools/rbt2c.pl
Normal file
39
tools/rbt2c.pl
Normal file
@@ -0,0 +1,39 @@
|
||||
#!/usr/bin/perl
|
||||
|
||||
# This tool converts a Xilinx xxx.rbt FPGA bitstream to a table that will
|
||||
# compile as C source code. The output format is DWORDs, MSB first.
|
||||
|
||||
print "// Generated by rbt2c.pl, do not edit!\n\n";
|
||||
|
||||
for(1..7) {
|
||||
chomp($_ = <>);
|
||||
print "//// $_\n";
|
||||
}
|
||||
|
||||
print <<EOT;
|
||||
|
||||
#include <proxmark3.h>
|
||||
|
||||
const DWORD FpgaImage[] = {
|
||||
EOT
|
||||
|
||||
while(<>) {
|
||||
chomp;
|
||||
$v = 0;
|
||||
for $b (split(//, $_)) {
|
||||
$v <<= 1;
|
||||
if($b eq '1') {
|
||||
$v |= 1;
|
||||
} elsif($b ne '0') {
|
||||
die;
|
||||
}
|
||||
}
|
||||
printf("\t0x%08x,\n", $v);
|
||||
}
|
||||
|
||||
print <<EOT;
|
||||
};
|
||||
|
||||
const DWORD FpgaImageLen = sizeof(FpgaImage) / sizeof(FpgaImage[0]);
|
||||
|
||||
EOT
|
||||
Reference in New Issue
Block a user