From owner-freebsd-questions@FreeBSD.ORG Mon Jun 3 09:48:22 2013 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id D9A224AB for ; Mon, 3 Jun 2013 09:48:22 +0000 (UTC) (envelope-from freebsd@qeng-ho.org) Received: from blue.qeng-ho.org (blue.qeng-ho.org [217.155.128.241]) by mx1.freebsd.org (Postfix) with ESMTP id 79123107D for ; Mon, 3 Jun 2013 09:48:22 +0000 (UTC) Received: from fileserver.home.qeng-ho.org (localhost [127.0.0.1]) by fileserver.home.qeng-ho.org (8.14.5/8.14.5) with ESMTP id r539mCZk065451; Mon, 3 Jun 2013 10:48:12 +0100 (BST) (envelope-from freebsd@qeng-ho.org) Message-ID: <51AC665C.5090505@qeng-ho.org> Date: Mon, 03 Jun 2013 10:48:12 +0100 From: Arthur Chance User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:17.0) Gecko/20130516 Thunderbird/17.0.6 MIME-Version: 1.0 To: s m Subject: Re: change specified byte in a hex file References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: freebsd-questions X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Jun 2013 09:48:22 -0000 On 06/03/13 07:28, s m wrote: > i want to change a specified byte in a hex file. i want to edit my file and > change byte 0x28a content from 0x08 to 0x14. Given your earlier posts about increasing the number of partitions from 8 to 20 on a BSD labelled disk, this probably is not something you really want to do without further research to see if the label actually contains enough space for the metadata for 20 partitions. I believe it doesn't and you're liable to trash the file system on your 'a' partition if you just edit the byte. Alternatively newfs'ing your 'a' partition may destroy the metadata for partitions beyond 'h'. You really need to learn how to use gpart correctly, rather than randomly changing bytes on a disk. However, there's nothing like burning your fingers playing with matches to teach you to respect fire, so ... > i try to do it with hex-editor in windows but this file is too big and i > can't transfer it to the other system. i think it should be done by some > commands such as "dd" but i don't know how to use it. Of course it can be done by dd. Use "man dd" to find out how to use it, that's what the manual pages are for, and it's better to read for yourself than have someone give you an incantation you don't understand. Hint: look at the bs= and seek= options. Extra hint: *after* you've checked the potential problem I've mentioned in the first paragraph, you might also want to use "man echo", "man builtin", "man sh" and "man csh" to understand the differences between the various versions of echo you have available. -- In the dungeons of Mordor, Sauron bred Orcs with LOLcats to create a new race of servants. Called Uruk-Oh-Hai in the Black Speech, they were cruel and delighted in torturing spelling and grammar. _Lord of the Rings 2.0, the Web Edition_