[nzlug] Find and replace within a binary file?

Karl. kmw1 at free.net.nz
Thu Jul 3 12:23:03 NZST 2008


On Thu, Jul 03, 2008 at 11:13:57AM +1200, Simon wrote:
> Hi There, Im trying to compile a driver and have these instructions...
> 
> Now copy lib/fcpci-lib.o to lib/f2pci-lib.o and replace all occurences
> of "fcpci" in
> f2pci-lib.o by "f2pci". (It's a binary file, so be careful)
> Replace all occurences of __fcpci__ in src.drv/* by __f2pci__. (quite many)
> In src.drv/defs.h, replace
> 
> Im wondering if someone could assist me to do the find and replace for
> the binary file. Im ok with the rest of it :)

I'd try BBE - the man page says:
"bbe - binary block editor.
bbe is a sed-like editor for binary files. It performs binary 
transformations on the blocks of input stream."

Look at http://bbe-.sourceforge.net/ or find it in Debian, and 
presumably Ubuntu.

Karl.
-- 
http://mowson.org/karl



More information about the NZLUG mailing list