From owner-freebsd-chat@FreeBSD.ORG Tue Feb 17 04:00:35 2015 Return-Path: Delivered-To: freebsd-chat@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 25C85798 for ; Tue, 17 Feb 2015 04:00:35 +0000 (UTC) Received: from www.lemis.com (www.lemis.com [208.86.226.86]) by mx1.freebsd.org (Postfix) with ESMTP id F01AD17A for ; Tue, 17 Feb 2015 04:00:34 +0000 (UTC) Received: from eureka.lemis.com (www.lemis.com [208.86.226.86]) by www.lemis.com (Postfix) with ESMTP id 311551B72848; Tue, 17 Feb 2015 04:00:28 +0000 (UTC) Received: by eureka.lemis.com (Postfix, from userid 1004) id 3EFA0F780F; Tue, 17 Feb 2015 15:00:26 +1100 (EST) Date: Tue, 17 Feb 2015 15:00:26 +1100 From: Greg 'groggy' Lehey To: "Jason C. Wells" Subject: Re: Analyze and Edit a Binary File Message-ID: <20150217040026.GA91708@eureka.lemis.com> References: <1424140628.3400388.228383569.629B0401@webmail.messagingengine.com> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="sdtB3X0nJg68CQEu" Content-Disposition: inline In-Reply-To: <1424140628.3400388.228383569.629B0401@webmail.messagingengine.com> User-Agent: Mutt/1.4.2.3i Organization: The FreeBSD Project Phone: +61-3-5346-1370 Mobile: None. Use the landline. WWW-Home-Page: http://www.FreeBSD.org/ X-PGP-Fingerprint: 9A1B 8202 BCCE B846 F92F 09AC 22E6 F290 507A 4223 Cc: freebsd-chat@freebsd.org X-BeenThere: freebsd-chat@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Non technical items related to the community List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Feb 2015 04:00:35 -0000 --sdtB3X0nJg68CQEu Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Monday, 16 February 2015 at 18:37:08 -0800, Jason C. Wells wrote: > > I use some engineering software called Catia. The files produced by > Catia encode a software version number. If the version number is > greater than the version of the installed software, Catia refuses to > open the file. This is annoying in the extreme. Especially if you want > to share files in the spirit of open source. If the files that I create > are newer than the Catia version of my audience, then my audience can't > use my files. > > My question to my more knowledgeable computer geek friends: How do I > analyze and edit an arbitrary binary file? Those are two different questions, of course. You know the version number; if it's relatively complicated (2.2.7.1, for example), it may be stored as character text. In that case, there will be relatively few false positives if you search for the text. If it's simple (2, for example), you'd need to run the software in a debugger and find where it does the comparison. That's much more difficult. As for editing: Emacs, of course :-) Seriously, it does work. I've used it on occasion, and at least one package I've seen asks you to edit binary files with Emacs as part of the build process. Just make very sure not to change the length of the file. Greg -- Sent from my desktop computer. Finger grog@FreeBSD.org for PGP public key. See complete headers for address and phone numbers. This message is digitally signed. If your Microsoft MUA reports problems, please read http://tinyurl.com/broken-mua --sdtB3X0nJg68CQEu Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.19 (FreeBSD) iEYEARECAAYFAlTivNkACgkQIubykFB6QiNtlwCfb3SOPNEWL2wWOtmd4vXFzXjs Cb8AoK4gf/8XKs5U4g7U/a7nC5JpDmGp =r5zb -----END PGP SIGNATURE----- --sdtB3X0nJg68CQEu--