Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Re: Searching a file for an undetermined hexadecimal string

by ikegami (Patriarch)
on May 13, 2005 at 04:28 UTC ( #456601=note: print w/replies, xml ) Need Help??


in reply to Searching a file for an undetermined hexadecimal string

binmode STDIN; binmode STDOUT; # Could read in the entire file, # but read in chunks ending with # 00h to save memory. $/ = "\x00"; while (<>) { s/(\x31\x33\x39\x37.*?\x00)/"\x00" x length($1)/e; # Or the following if you don't want # to replace the start and the end: #s/(\x31\x33\x39\x37)(.*?)(\x00)/ # $1 . ("\x00" x length($2)) . $3 #/e; print; }

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://456601]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (4)
As of 2023-01-30 08:50 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?