pbyfire has asked for the wisdom of the Perl Monks concerning the following question:
After much research and trying examples of pack,unpack and hex editing I still cannot edit a binary file.
In the example below I need a perl routine to change all instances of the ASCII string "P200000976" in a binary file to read "Test123456" by replacing the hex values that define the target string (50 32 30 30 30 30 30 39 37 36) with values that represent the replacement string (54 65 73 74 31 32 33 34 35 36).
00002A00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 01 80 00 0A 50 32 30 30 30 30 30 39 37 36 00 00 00 01 ..................P200000976....
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: binary edit
by BrowserUk (Patriarch) on Apr 24, 2012 at 18:02 UTC | |
by pbyfire (Novice) on Apr 24, 2012 at 18:23 UTC | |
by dave_the_m (Monsignor) on Apr 24, 2012 at 18:43 UTC | |
by johngg (Canon) on Apr 24, 2012 at 19:00 UTC | |
by pbyfire (Novice) on Apr 24, 2012 at 19:30 UTC |