hi,
I require some assistance in understanding how to accomplish replacing a particular hex value in a binary file on aix.
in a binary file I need to find the following combination:
5A 00 10 D3 A9 XX XX XX XX XX XX XX XX XX XX XX XX 0C 5A
XX represents any valid HEX value
then replace this with the following HEX value
5A 00 10 D3 A9 XX XX XX XX XX XX XX XX XX XX XX XX 5A
I am trying to delete the 0C hex value from the binary file when it matches certain conditions:
I tried the following command with spaces and without... it doesn't do anything.
perl -pe 's/\x5A\x00\x10\xD 3\xA9\x[0-9a-fA-F]\{24\}\x0C\x5A/\x5A\x00\x10\xD 3\xA9\x[0-9a-fA-F]\{24\}\x5A/g' source > destination
I viewed the source file in an HEX editor and it definately has 1 occurance of the HEX sequence
5A 00 10 D3 A9 XX XX XX XX XX XX XX XX XX XX XX XX 0C 5A
I would greatly appreciate any assistance
regards,
Duncan
I require some assistance in understanding how to accomplish replacing a particular hex value in a binary file on aix.
in a binary file I need to find the following combination:
5A 00 10 D3 A9 XX XX XX XX XX XX XX XX XX XX XX XX 0C 5A
XX represents any valid HEX value
then replace this with the following HEX value
5A 00 10 D3 A9 XX XX XX XX XX XX XX XX XX XX XX XX 5A
I am trying to delete the 0C hex value from the binary file when it matches certain conditions:
I tried the following command with spaces and without... it doesn't do anything.
perl -pe 's/\x5A\x00\x10\xD 3\xA9\x[0-9a-fA-F]\{24\}\x0C\x5A/\x5A\x00\x10\xD 3\xA9\x[0-9a-fA-F]\{24\}\x5A/g' source > destination
I viewed the source file in an HEX editor and it definately has 1 occurance of the HEX sequence
5A 00 10 D3 A9 XX XX XX XX XX XX XX XX XX XX XX XX 0C 5A
I would greatly appreciate any assistance
regards,
Duncan
Comment