PDA

View Full Version : Reading hex data from .bin file



anh5kor
19th April 2016, 08:02
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.

Lesiok
19th April 2016, 08:58
1. This is not hex file this an ordinary binary file.
2. Read about QByteArray::toHex

anda_skoa
19th April 2016, 09:39
And you have already been told how to read a binary file: http://www.qtcentre.org/threads/65391-redaing-binary-file

Cheers,
_