From owner-freebsd-questions@FreeBSD.ORG Fri Aug 10 15:29:35 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 ED29416A417 for ; Fri, 10 Aug 2007 15:29:35 +0000 (UTC) (envelope-from r.rajamani@gmail.com) Received: from nz-out-0506.google.com (nz-out-0506.google.com [64.233.162.239]) by mx1.freebsd.org (Postfix) with ESMTP id A913613C4CE for ; Fri, 10 Aug 2007 15:29:35 +0000 (UTC) (envelope-from r.rajamani@gmail.com) Received: by nz-out-0506.google.com with SMTP id l8so359898nzf for ; Fri, 10 Aug 2007 08:29:35 -0700 (PDT) DKIM-Signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=QgmizT5ZnT5PFp+ikRZnHmcpfBJ7tf9RiUn1s0SuczX4d8+OCcL1PrC72rJTy/2KJHIh+58nibEbEvBO5jdiwu+flcKc9bKHOQWtG0HkIUFl+ZVJC6y0tYYkX/54b2AmNwRN1vh61oYW1DFWnWF5a6U2wDbQo4GgS6qknSgE1UE= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=jdcD69JZSeagPZ/g4HOWVAarGNZ6I94hM5MR+e1/XIdEFtAVDJyz1Uu4hVp+3ceQtpDrQuzzZWu2T8aXkTRapoQggSc52nzxS/hY39hXgQhHKDqT4sEPdlyYi5vhD7vkqnV5tVO2+e1T5unxhJC2alilUKIdUHkOm4MMFMb+U00= Received: by 10.64.213.3 with SMTP id l3mr5184822qbg.1186758236850; Fri, 10 Aug 2007 08:03:56 -0700 (PDT) Received: by 10.64.251.15 with HTTP; Fri, 10 Aug 2007 08:03:56 -0700 (PDT) Message-ID: <4af955a20708100803k6f7ed623yc1ac15b3214129d0@mail.gmail.com> Date: Fri, 10 Aug 2007 11:03:56 -0400 From: "Rajarajan Rajamani" To: "Erik Osterholm" , "Jerry McAllister" , V.I.Victor , freebsd-questions@freebsd.org In-Reply-To: <20070810145253.GA85496@idoru.cepheid.org> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <20070809220254.GA81490@gizmo.acns.msu.edu> <20070810145253.GA85496@idoru.cepheid.org> Cc: 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 15:29:36 -0000 On 8/10/07, Erik Osterholm wrote: > 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. > > ////jerry > > If you use vim, you can do this using vim and xxd: > > http://www.vim.org/htmldoc/usr_23.html#23.4 > Using vim is one way to do it and in case you are not familiar with vi/vim you can use xxd on the command line to change your binary file into text, edit the byte you want to change (since you know the byte to be changed) and reconvert back to binary. % xxd infile outfile_txt edit the outfile using your favorite editor (assuming it will take the big file) % xxd -r outfile_txt fixed_infile That should do it too. Raj