Init
This commit is contained in:
commit
d23a3e49ff
22 changed files with 979 additions and 0 deletions
20
hexer.sh
Executable file
20
hexer.sh
Executable file
|
|
@ -0,0 +1,20 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
set -e
|
||||
|
||||
if [ $# -lt 1 ]; then
|
||||
echo "Usage: $0 input.hex [output.bin]"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
input="$1"
|
||||
|
||||
if [ $# -ge 2 ]; then
|
||||
output="$2"
|
||||
else
|
||||
output="${input%.*}.bin"
|
||||
fi
|
||||
|
||||
perl -ne 's/#.*//; print pack("H*", $_ =~ s/\s+//gr)' "$input" > "$output"
|
||||
|
||||
echo "Wrote $output"
|
||||
Loading…
Add table
Add a link
Reference in a new issue