Skip to content

Instantly share code, notes, and snippets.

@oxagast
Created May 22, 2016 20:24
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save oxagast/56c4cd2405a45d7a7c1b554817a008ef to your computer and use it in GitHub Desktop.
Save oxagast/56c4cd2405a45d7a7c1b554817a008ef to your computer and use it in GitHub Desktop.
echo AAAABCCCC | perl -e '$change = $ARGV[1]; $findme = $ARGV[0]; $let = <STDIN>; $hex = unpack("H*", $let); $reg = qr/$findme/; if ($hex =~ s/(.*)${reg}(.*)/\1$change\2/){$newhex = pack("H*", $hex);} print $newhex;' 414243 444546
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment