Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re: Searching a file for an undetermined hexadecimal string

by ikegami (Patriarch)
on May 13, 2005 at 04:28 UTC ( [id://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?Last hourOther CB clients
Other Users?
Others goofing around in the Monastery: (1)
As of 2024-04-19 00:26 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found