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

Re: search and replace (in-place) strings in binary

by choroba (Archbishop)
on Jul 16, 2020 at 16:37 UTC ( #11119412=note: print w/replies, xml ) Need Help??


in reply to search and replace (in-place) strings in binary

Might be.

What's the actual string you want to replace? If it contains some special characters, they might need escaping.

Also, what's the format of the files? Some binary formats might contain CRC checks which would be invalidated by changing some bytes. Also, if the binary format is fixed length or records the lengths of dynamic parts, you might need to pad the inserted string or update the recorded length.

map{substr$_->[0],$_->[1]||0,1}[\*||{},3],[[]],[ref qr-1,-,-1],[{}],[sub{}^*ARGV,3]

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others contemplating the Monastery: (3)
As of 2021-03-02 02:52 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My favorite kind of desktop background is:











    Results (36 votes). Check out past polls.

    Notices?