From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Newsgroups: gmane.emacs.help Subject: Re: Fix the destroyed disk image partition table in a raw image file using Emacs. Date: Sun, 11 Apr 2021 20:45:46 +0200 Message-ID: <20210411184546.GG30008@tuxteam.de> References: Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="Cgrdyab2wu3Akvjd" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="1283"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mutt/1.5.21 (2010-09-15) Cc: help-gnu-emacs , Hongyi Zhao To: Dan Hitt Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Sun Apr 11 20:47:42 2021 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lVf7W-0000Em-33 for geh-help-gnu-emacs@m.gmane-mx.org; Sun, 11 Apr 2021 20:47:42 +0200 Original-Received: from localhost ([::1]:35608 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lVf7U-0000gL-Uv for geh-help-gnu-emacs@m.gmane-mx.org; Sun, 11 Apr 2021 14:47:40 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:51110) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lVf5j-0000fu-8z for help-gnu-emacs@gnu.org; Sun, 11 Apr 2021 14:45:51 -0400 Original-Received: from mail.tuxteam.de ([5.199.139.25]:36527) by eggs.gnu.org with esmtps (TLS1.2:DHE_RSA_AES_128_CBC_SHA1:128) (Exim 4.90_1) (envelope-from ) id 1lVf5g-0006mD-JN for help-gnu-emacs@gnu.org; Sun, 11 Apr 2021 14:45:50 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=tuxteam.de; s=mail; h=From:In-Reply-To:Content-Type:MIME-Version:References:Message-ID:Subject:Cc:To:Date; bh=9r3XY1SzYgvHWwgnB1YhflbG25tK4nLcxG0sfH/5TaA=; b=gNocNgcei1f8ErZMOHM4snxnPV6r96+PlDRrJeMqIIDgI0mtHdaTIru7oWNw5uHFFM+Zn290tpNqfMkqR++upaAE5IlCqDB6Qe1NMAczgrTH2Z0Fi7gc2y+SUXHHHlrU+4HXidfb72fw0PMlOQirZXHbB4mDDR6666h/8AESJm2Xem6NAYe84JY4jStv2xS5VGPOVOT/zWFVBVB/aYaEg30n18KxRTK98t70uCkC2C/SC4TXww76Az2sfoMX4u8Qn6K6tTpuY1rPFaefzz23dOlb80GbAi636ArrcDL28TfPHXG1ZuqJYDieTFLRM6VcrTUc09LaaVRcmAgPhHfBxA==; Original-Received: from tomas by mail.tuxteam.de with local (Exim 4.80) (envelope-from ) id 1lVf5e-0003QL-5j; Sun, 11 Apr 2021 20:45:46 +0200 Content-Disposition: inline In-Reply-To: Received-SPF: pass client-ip=5.199.139.25; envelope-from=tomas@tuxteam.de; helo=mail.tuxteam.de X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.io gmane.emacs.help:128952 Archived-At: --Cgrdyab2wu3Akvjd Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sun, Apr 11, 2021 at 10:26:26AM -0700, Dan Hitt wrote: > On Sun, Apr 11, 2021 at 6:41 AM Jean Louis wrote: >=20 > > * Hongyi Zhao [2021-04-11 16:35]: > > > It's well known that Emacs is an 8-bit clean editor which makes it > > > safe to edit binary files. So, I want to whether I can fix the above > > > destroyed disk image file with Emacs for my scenario. > > > > There is hexl library: > > > > ;; This package implements a major mode for editing binary files. It u= ses > > ;; a program called hexl, supplied with the GNU Emacs distribution, that > > ;; can filter a binary into an editable format or from the format back = into > > ;; binary. For full instructions, invoke `hexl-mode' on an empty buffer > > and > > ;; do M-x `describe-mode'. > > > > But I guess you need `hexl' program. > > > > -- > > Jean > > >=20 > Hi Jean, >=20 > hexl-mode works for me on my xubuntu 20.04 system, and i do not have a > program called 'hexl'. Look around somewhere (Debian here) /usr/lib/emacs//x86_64-linux-gnu/hexl Replace by your Emacs version and x86_64-linux-gnu by some appropriate architecture string. > Of course, i don't know if my system is secretly using some other program > which does the same thing as hexl. It's all in the open ;-) Hint: apt-file search finds such things, even if you haven't installed a package. Package apt-file. Very much recommended.=20 Cheers - t --Cgrdyab2wu3Akvjd Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.12 (GNU/Linux) iEYEARECAAYFAmBzQ9oACgkQBcgs9XrR2kYY5ACePLj9a4j0YjlSNBvB0UfFrbx4 iJ8AnixzEyWJdOEvwI96dhJd3I4GDL0N =I/WC -----END PGP SIGNATURE----- --Cgrdyab2wu3Akvjd--