If I want to perform a binary search and replace on a file on a typical
Linux install, any suggestions? I could install hexedit but I'm trying
to work out a generic solution.

Specifically, I want to replace bytes "EC 10 00 00 69 81 00 00" with "86
11 00 00 00 43 00 00" in a driver module. I though sed could cope with
binary but it doesn't look like it can now I've looked into it. But it
may just be that I haven't worked out how to construct the commandline...

(I'm trying to get a D-Link gigabit card working, and the r8169 driver
supports it but doesn't have its PCI-ID in it, so won't load. The above
hack swaps out an ID I don't need and puts in the one I do so that it'll
load. Changing the driver source and recompiling is the "correct" way to
do this but the system in question doesn't have a compiler.)

I can do this a number of other ways (like pulling the file onto another
system that has a binary editor on it) so this is more for my own
curiosity than anything else.

Ingenious solutions involving converting to ASCII before running sed,
then converting back to binary, are all welcome, provided they work from
a typical commandline. I can use hexdump to go one way but not back again.

-- 
Mark Rogers
More Solutions Ltd :: 0845 45 89 555



_______________________________________________
Peterboro mailing list
Peterboro@mailman.lug.org.uk
https://mailman.lug.org.uk/mailman/listinfo/peterboro

Reply via email to