From owner-freebsd-hackers Sat Jul 13 13:21:49 2002 Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.FreeBSD.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 7BBA037B400 for ; Sat, 13 Jul 2002 13:21:48 -0700 (PDT) Received: from iguana.icir.org (iguana.icir.org [192.150.187.36]) by mx1.FreeBSD.org (Postfix) with ESMTP id 1E57C43E77 for ; Sat, 13 Jul 2002 13:21:48 -0700 (PDT) (envelope-from rizzo@iguana.icir.org) Received: (from rizzo@localhost) by iguana.icir.org (8.11.6/8.11.3) id g6DKLiU68349; Sat, 13 Jul 2002 13:21:44 -0700 (PDT) (envelope-from rizzo) Date: Sat, 13 Jul 2002 13:21:44 -0700 From: Luigi Rizzo To: David Malone Cc: hackers@FreeBSD.ORG Subject: Re: how to find offset of a string in a binary file ? Message-ID: <20020713132144.A68304@iguana.icir.org> References: <20020713125320.A67829@iguana.icir.org> <20020713201628.GA88506@walton.maths.tcd.ie> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5.1i In-Reply-To: <20020713201628.GA88506@walton.maths.tcd.ie>; from dwmalone@maths.tcd.ie on Sat, Jul 13, 2002 at 09:16:28PM +0100 Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On Sat, Jul 13, 2002 at 09:16:28PM +0100, David Malone wrote: > On Sat, Jul 13, 2002 at 12:53:21PM -0700, Luigi Rizzo wrote: > > So, does anyone know how to use the basic unix tools to find > > the offset of a string in a binary file ? > > Specifically, I would like to locate the offset of the string > > > > "MFS Filesystem goes here" > > Would grep -b do what you want? no, as i said in my email, it returns the offset of the "line", so after it finds the string it goes back to the first newline and returns the offset of the character after that. :( cheers luigi To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message