From owner-freebsd-questions@FreeBSD.ORG Fri Aug 10 14:52:54 2007 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0C1D316A418 for ; Fri, 10 Aug 2007 14:52:54 +0000 (UTC) (envelope-from erik@cepheid.org) Received: from mail.cepheid.org (wintermute.cepheid.org [64.92.165.98]) by mx1.freebsd.org (Postfix) with ESMTP id E22D113C4A3 for ; Fri, 10 Aug 2007 14:52:53 +0000 (UTC) (envelope-from erik@cepheid.org) Received: by mail.cepheid.org (Postfix, from userid 1006) id 6FA791710C; Fri, 10 Aug 2007 09:52:53 -0500 (CDT) Date: Fri, 10 Aug 2007 09:52:53 -0500 From: Erik Osterholm To: Jerry McAllister Message-ID: <20070810145253.GA85496@idoru.cepheid.org> Mail-Followup-To: Erik Osterholm , Jerry McAllister , "V.I.Victor" , freebsd-questions@freebsd.org References: <20070809220254.GA81490@gizmo.acns.msu.edu> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20070809220254.GA81490@gizmo.acns.msu.edu> User-Agent: Mutt/1.4.2.2i Cc: "V.I.Victor" , freebsd-questions@freebsd.org Subject: Re: Utility to change a byte in a binary file? X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Aug 2007 14:52:54 -0000 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