CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 10 of 10
  1. #1
    Join Date
    Sep 2003
    Location
    Chennai, India
    Posts
    76

    Opening a Hexfile

    Hi,
    I am having a hexadecimal file. (They are calling it as a ring file. I really dont know why it is called like this). i want to open the file and edit it.
    how can i do this.

    Thanks in Advance,
    Varadha

  2. #2
    Join Date
    Feb 2004
    Posts
    14

    Re: Opening a Hexfile

    Hey try to open that file in Microsoft Visual C++ 6.0 editor.. It will open that binary file, ofcourse u can edit too...

    ~Radha

  3. #3
    Join Date
    Oct 2002
    Location
    Timisoara, Romania
    Posts
    14,360

    Re: Opening a Hexfile

    There are binary files and text files. Does you're file look like:
    0F AB 01 02 ... and so on?
    In this case it is a text file. If you want to edit it you can open it even with notepad.

    However, if your file is binary you cannot edit it manually. Its content depends on the application's data.

    What exactly do you want to do by editing the file?
    Marius Bancila
    Home Page
    My CodeGuru articles

    I do not offer technical support via PM or e-mail. Please use vbBulletin codes.

  4. #4
    Join Date
    Feb 2003
    Location
    Iasi - Romania
    Posts
    8,244

    Re: Opening a Hexfile

    Quote Originally Posted by cilu
    There are binary files and text files. Does you're file look like:
    0F AB 01 02 ... and so on?
    In this case it is a text file. If you want to edit it you can open it even with notepad.

    However, if your file is binary you cannot edit it manually. Its content depends on the application's data.

    What exactly do you want to do by editing the file?
    In fact, exists only files... The only one difference is that opening some of them using a text editor, e.g. Notepad, you may see a lot of little cute bugs inside.
    Ovidiu
    "When in Rome, do as Romans do."
    My latest articles: https://codexpertro.wordpress.com/

  5. #5
    GCDEF is offline Elite Member Power Poster
    Join Date
    Nov 2003
    Location
    Florida
    Posts
    12,637

    Re: Opening a Hexfile

    Quote Originally Posted by ovidiucucu
    In fact, exists only files... The only one difference is that opening some of them using a text editor, e.g. Notepad, you may see a lot of little cute bugs inside.
    So it's a binary file of some kind. There is no straight forward answer. You'll need to know its format and use whatever tool can edit the file while maintaining its integrity.

  6. #6
    Join Date
    Feb 2003
    Location
    Iasi - Romania
    Posts
    8,244

    Cool Re: Opening a Hexfile

    Quote Originally Posted by GCDEF
    So it's a binary file of some kind.
    Can you explain, why "it's a binary file of some kind"?
    Ovidiu
    "When in Rome, do as Romans do."
    My latest articles: https://codexpertro.wordpress.com/

  7. #7
    Join Date
    Oct 2002
    Location
    Timisoara, Romania
    Posts
    14,360

    Re: Opening a Hexfile

    Quote Originally Posted by ovidiucucu
    In fact, exists only files... The only one difference is that opening some of them using a text editor, e.g. Notepad, you may see a lot of little cute bugs inside.
    Of course that are actually only files, since ASCII is just another representation of BINARY. I was trying to say that if his file is ASCII he should not edit it manually. However, I admit I should have explained it better.
    Marius Bancila
    Home Page
    My CodeGuru articles

    I do not offer technical support via PM or e-mail. Please use vbBulletin codes.

  8. #8
    GCDEF is offline Elite Member Power Poster
    Join Date
    Nov 2003
    Location
    Florida
    Posts
    12,637

    Re: Opening a Hexfile

    Quote Originally Posted by ovidiucucu
    Can you explain, why "it's a binary file of some kind"?
    By binary, I mean characters that can't be displayed on an output device, hence the "cute bugs" in notepad.

  9. #9
    Join Date
    Sep 2002
    Location
    14° 39'19.65"N / 121° 1'44.34"E
    Posts
    9,815

    Re: Opening a Hexfile

    I think what everyone is trying to tell you here is the following: The term "hexadecimal file" doesn't mean anything. "Hexadecimal" is a base for displaying numbers, not a file format. There are two probable interpretations for the term as you used it:
    1. The file is simply a binary file, and you want to edit it using a hex editor - that is, every single byte's value is displayed and entered as a hexadecimal string. If that's the case, you must write code which formats the values as hex strings, and, on the editing side, parses hex strings and writes them back as their binary value. As an alternative, you can use one of the available hex editor controls from the articles section.
    2. The file is a text file, which contains hexadecimal strings - that is, all characters in the file are in the range of 0..9, A..F. In that case, you can edit it just like any normal text (maybe making sure that only hex digits can be entered).


    Quote Originally Posted by Varadha
    (They are calling it as a ring file. I really dont know why it is called like this)
    Just a guess, but it's probably a file which acts as a ring buffer: Bytes are appended until a predetermined size is reached, then the file will be overwritten again from the beginning. That technique is frequently used when a large number of values needs to be logged. but (to restrict the file size), only the last n values need to be kept.

  10. #10
    Join Date
    Feb 2003
    Location
    Iasi - Romania
    Posts
    8,244

    Cool Re: Opening a Hexfile

    Quote Originally Posted by GCDEF
    By binary, I mean characters that can't be displayed on an output device, hence the "cute bugs" in notepad.
    Quite clear. So, for example 'a', 'b', 'c'... are not binary.
    Ovidiu
    "When in Rome, do as Romans do."
    My latest articles: https://codexpertro.wordpress.com/

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured