Results 1 to 3 of 3

Thread: Reading hex data from .bin file

  1. #1
    Join Date
    Oct 2014
    Posts
    71
    Thanks
    13
    Qt products
    Qt5
    Platforms
    Windows

    Question Reading hex data from .bin file

    I have a .bin file which contain the hex data,this files are not able to open in Notepad++ and other word document.
    (if open in Notepad I will get some junk data but if open in hex-view tool which is an our internal tool I am able to see the hex data )
    Can any one let me how can we read hex data from this type of file?

    If open in notepad++ the output is like below
    ppÀ pˆà pÇÀx‡'pjâ€p `À pŠâp€À x‡phÃ
    pqÆÀpˆà p‡ÇPx‡=phÃ
    pqÆhpˆÃ
    p‘Ƭx‡)p`à þpfÐpâ ‚¬Ã þpˆÁöp¨Ã
    p°À x‡'p`à þphÁøp€à þpË ÃÃ¸p¨Ã
    If open in hex-view Tool the output is like below
    000000 03 01 00 01 04 00 55 50 41 00 00 00 00 00 00 00 ......UPA.......
    000010 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 01 ................
    000020 00 01 01 00 00 00 00 07 ff c0 ff ff ff ff ff ff ................
    Actual I am trying to create a tool like hex-view in Qt.

  2. #2
    Join Date
    Mar 2008
    Location
    Kraków, Poland
    Posts
    1,536
    Thanked 284 Times in 279 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Reading hex data from .bin file

    1. This is not hex file this an ordinary binary file.
    2. Read about QByteArray::toHex

  3. #3
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Reading hex data from .bin file

    And you have already been told how to read a binary file: http://www.qtcentre.org/threads/6539...ng-binary-file

    Cheers,
    _

Similar Threads

  1. Replies: 3
    Last Post: 8th June 2011, 06:36
  2. Reading XML file into a data file correctly?
    By falconium in forum Qt Programming
    Replies: 3
    Last Post: 9th May 2011, 18:55
  3. Reading data from xls file
    By addu in forum Qt Programming
    Replies: 2
    Last Post: 6th May 2010, 09:33
  4. reading data from file
    By offline in forum Qt Programming
    Replies: 1
    Last Post: 9th April 2010, 10:31
  5. Reading/writing data to binary file
    By DiamonDogX in forum Qt Programming
    Replies: 3
    Last Post: 23rd July 2009, 19:24

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.