perl -Mopen=IN,:raw -wnE '/(\R)/; say unpack "H*", $1' file