Re: Utility to change a byte in a binary file?

2007-08-10 Thread Rajarajan Rajamani
On 8/10/07, Erik Osterholm [EMAIL PROTECTED] wrote:
 On Thu, Aug 09, 2007 at 06:02:54PM -0400, Jerry McAllister wrote:
  On Thu, Aug 09, 2007 at 08:25:17PM +, V.I.Victor wrote:
 
  
   It sure seems that this should be simple, but my searches have only
   turned up inter-active hex/disk editors.  I'm probably asking wrong.
  
   I have a large binary file (700 meg) and I know that there is a
   single wrong byte.  I also know it's exact location in the file.

  jerry

 If you use vim, you can do this using vim and xxd:

 http://www.vim.org/htmldoc/usr_23.html#23.4


Using vim is one way to do it and in case you are not familiar with
vi/vim you can use xxd on the command line to change your binary file
into text, edit the byte you want to change (since you know the byte
to be changed) and reconvert back to binary.
% xxd infile outfile_txt
edit the outfile using your favorite editor (assuming it will take the big file)
% xxd -r outfile_txt fixed_infile

That should do it too.

Raj
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: Utility to change a byte in a binary file?

2007-08-10 Thread Erik Osterholm
On Thu, Aug 09, 2007 at 06:02:54PM -0400, Jerry McAllister wrote:
 On Thu, Aug 09, 2007 at 08:25:17PM +, V.I.Victor wrote:
 
  
  It sure seems that this should be simple, but my searches have only 
  turned up inter-active hex/disk editors.  I'm probably asking wrong.
  
  I have a large binary file (700 meg) and I know that there is a 
  single wrong byte.  I also know it's exact location in the file.
  
  Is there a command-line utility to write a byte at a specified offset 
  into a file? 
 
 You could try 'dd' and manipulate the skip/offset and size arguments.
 
 jerry

If you use vim, you can do this using vim and xxd:

http://www.vim.org/htmldoc/usr_23.html#23.4

Skip down to the section entitled USING XXD.  Don't forget to
convert it back before you save!

Erik
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: Utility to change a byte in a binary file?

2007-08-09 Thread Nikola Lecic
On Thu, 09 Aug 2007 20:25:17 +
V.I.Victor [EMAIL PROTECTED] wrote:

 It sure seems that this should be simple, but my searches have only
 turned up inter-active hex/disk editors.  I'm probably asking wrong.
 
 I have a large binary file (700 meg) and I know that there is a
 single wrong byte.  I also know it's exact location in the file.
 
 Is there a command-line utility to write a byte at a specified offset
 into a file? 

Hello Victor,

editors/bpatch and editors/hexcurse are what you want. Both work great
with large files.

Nikola Lečić
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: Utility to change a byte in a binary file?

2007-08-09 Thread Jerry McAllister
On Thu, Aug 09, 2007 at 08:25:17PM +, V.I.Victor wrote:

 
 It sure seems that this should be simple, but my searches have only 
 turned up inter-active hex/disk editors.  I'm probably asking wrong.
 
 I have a large binary file (700 meg) and I know that there is a 
 single wrong byte.  I also know it's exact location in the file.
 
 Is there a command-line utility to write a byte at a specified offset 
 into a file? 

You could try 'dd' and manipulate the skip/offset and size arguments.

jerry

 
 ___
 freebsd-questions@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/freebsd-questions
 To unsubscribe, send any mail to [EMAIL PROTECTED]
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]