Beefy Boxes and Bandwidth Generously Provided by pair Networks
Come for the quick hacks, stay for the epiphanies.
 
PerlMonks  

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

by choroba (Cardinal)
on Jul 16, 2020 at 16:37 UTC ( [id://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
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11119412]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others rifling through the Monastery: (3)
As of 2024-04-24 16:40 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found