From owner-freebsd-questions Mon Jun 17 8:31: 2 2002 Delivered-To: freebsd-questions@freebsd.org Received: from mailsrv.otenet.gr (mailsrv.otenet.gr [195.170.0.5]) by hub.freebsd.org (Postfix) with ESMTP id 63A9D37B42A for ; Mon, 17 Jun 2002 08:30:54 -0700 (PDT) Received: from hades.hell.gr (patr364-a22.otenet.gr [195.167.109.54]) by mailsrv.otenet.gr (8.12.3/8.12.3) with ESMTP id g5HFTK03021313 for ; Mon, 17 Jun 2002 18:29:26 +0300 (EEST) Received: from hades.hell.gr (hades [127.0.0.1]) by hades.hell.gr (8.12.3/8.12.3) with ESMTP id g5HFTE9q000435 for ; Mon, 17 Jun 2002 18:29:14 +0300 (EEST) (envelope-from keramida@ceid.upatras.gr) Received: (from charon@localhost) by hades.hell.gr (8.12.3/8.12.3/Submit) id g5HCbn1I031592; Mon, 17 Jun 2002 15:37:50 +0300 (EEST) (envelope-from keramida@ceid.upatras.gr) Date: Mon, 17 Jun 2002 15:37:49 +0300 From: Giorgos Keramidas To: Darren Pilgrim Cc: freebsd-questions@FreeBSD.ORG Subject: Re: Searching and editting multi-GB binary files? Message-ID: <20020617123749.GC17819@hades.hell.gr> References: <3D0DAD27.D0F966CF@pantherdragon.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <3D0DAD27.D0F966CF@pantherdragon.org> Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On 2002-06-17 02:34 -0700, Darren Pilgrim wrote: > Anyone know of a way to edit multi-gigabyte binary files? I have some > hard disk images, one's 1.2GB, the other 20GB. I need to search them > for volume signatures, then snip bytes from both ends of the file to get > a volume image prepared for vnode access. I need to be able to actually > see certain small parts of the files to get the truncation right, but am > not sure how to go about this. The editors/hexedit port might come handy if you don't feel like messing around with hd(1) and dd(1). > Do I even need an editor for this task? Can grep give me all the > information I need to use dd/truncate to do this? If you pay close attention to what blocks you are editing, then using hd(1) to dump the contents of these files, tr(1) to generate binary files with the proper data and dd(1) to backup the proper part of the binary file and insert the new data at the right place should be fine. So, I guess, the answer would be "no, you don't really need a binary file editor, unless it makes you work faster and more reliably, in which case hexedit will be a great tool for you". - Giorgos To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message