From owner-freebsd-hackers Sat Jul 13 12:53:26 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 BC4E637B400 for ; Sat, 13 Jul 2002 12:53:23 -0700 (PDT) Received: from iguana.icir.org (iguana.icir.org [192.150.187.36]) by mx1.FreeBSD.org (Postfix) with ESMTP id 6DCAD43E65 for ; Sat, 13 Jul 2002 12:53:23 -0700 (PDT) (envelope-from rizzo@iguana.icir.org) Received: (from rizzo@localhost) by iguana.icir.org (8.11.6/8.11.3) id g6DJrLn68109; Sat, 13 Jul 2002 12:53:21 -0700 (PDT) (envelope-from rizzo) Date: Sat, 13 Jul 2002 12:53:21 -0700 From: Luigi Rizzo To: hackers@freebsd.org Subject: how to find offset of a string in a binary file ? Message-ID: <20020713125320.A67829@iguana.icir.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5.1i 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 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" into a kernel compiled with with MD_ROOT option. grep does not help because it gives the offset of the "line" which contains the string (where a "line" begins righr after a newline). Any ideas ? thanks luigi -----------------------------------+------------------------------------- Luigi RIZZO, luigi@iet.unipi.it . Dip. di Ing. dell'Informazione http://www.iet.unipi.it/~luigi/ . Universita` di Pisa TEL/FAX: +39-050-568.533/522 . via Diotisalvi 2, 56126 PISA (Italy) Mobile +39-347-0373137 -----------------------------------+------------------------------------- To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message