Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 10 Aug 2007 09:52:53 -0500
From:      Erik Osterholm <freebsd-lists-erik@erikosterholm.org>
To:        Jerry McAllister <jerrymc@msu.edu>
Cc:        "V.I.Victor" <idmc_vivr@intgdev.com>, freebsd-questions@freebsd.org
Subject:   Re: Utility to change a byte in a binary file?
Message-ID:  <20070810145253.GA85496@idoru.cepheid.org>
In-Reply-To: <20070809220254.GA81490@gizmo.acns.msu.edu>
References:  <W896404648215141186691117@webmail30> <20070809220254.GA81490@gizmo.acns.msu.edu>

Next in thread | Previous in thread | Raw E-Mail | Index | Archive | Help
On Thu, Aug 09, 2007 at 06:02:54PM -0400, Jerry McAllister wrote:
> On Thu, Aug 09, 2007 at 08:25:17PM +0000, V.I.Victor wrote:
> 
> > 
> > It sure seems that this should be simple, but my searches have only 
> > turned up inter-active hex/disk editors.  I'm probably "asking" wrong.
> > 
> > I have a large binary file (>700 meg) and I know that there is a 
> > single wrong byte.  I also know it's exact location in the file.
> > 
> > Is there a command-line utility to write a byte at a specified offset 
> > into a file? 
> 
> You could try 'dd' and manipulate the skip/offset and size arguments.
> 
> ////jerry

If you use vim, you can do this using vim and xxd:

http://www.vim.org/htmldoc/usr_23.html#23.4

Skip down to the section entitled "USING XXD."  Don't forget to
convert it back before you save!

Erik



Want to link to this message? Use this URL: <http://docs.FreeBSD.org/cgi/mid.cgi?20070810145253.GA85496>