Skip to content

Commit

Permalink
Fix bug because xxd is picky at its args
Browse files Browse the repository at this point in the history
  • Loading branch information
merces committed Nov 28, 2024
1 parent d99f7ed commit a8d16fc
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/reversing/bh_replacestring.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ bh_replacestring() {

local tmpfile=$(mktemp)

xxd -p $fil | tr -d \\n | sed "s/${srchex::-2}/${dsthex::-2}/g" | xxd -rp > $tmpfile
# xxd -r -p works, while xxd -rp or xxd -pr doesn't O.o
xxd -p $fil | tr -d \\n | sed "s/${srchex::-2}/${dsthex::-2}/g" | xxd -r -p > $tmpfile

[[ -s $tmpfile ]] && mv $tmpfile $fil
}

0 comments on commit a8d16fc

Please sign in to comment.