

#Hxd hex editor encoding how to#
I won’t go into details on how to compute this position, suffice to say that it always starts 8 bytes after the start of the actual PE file. Depending on the executable the position of the date/time stamp varies, since the preceding DOS executable can vary in size. The caret (dark vertical line) is at the position where the date and time of file creation is stored.
#Hxd hex editor encoding windows#
This is the message that you see when you try to run this executable under DOS (yes, Windows executables still start with a DOS program).Ĭloser to the bottom of the window, you see the characters “PE” that denote the beginning of the actual Windows executable. You will notice that there is intelligible text: “This program must be run under Win32”.

An example of translating dataīelow, in the screenshot of HxD, we have loaded an executable file that adheres to the PE file format (the executable file format of Windows). In the following, we will have a quick look at the data inspector of HxD 2.0, to interpret data in a meaningful way. Another option is to use a structure editor or a data inspector. Some hex editors also scan the entire file for text passages and list all matches in a result window. Since you don’t always know where the text is located in a file, you can try the text search function. The rest of the file however will make little sense when viewed as text. So you have to know the position in the file where this text is stored and go to it.
#Hxd hex editor encoding series#
When you can’t read anything there that makes sense, it means either this is no text or the encoding is untypical.Įven if you know the file format it doesn’t mean there is a text representation: imagine an image file like a JPG, this can never become English text, since it is a series of pixels, you will either see a picture rendering, or a sequence of color values.Īnother reason: files are often a combination of text and other data types like images, sound, or program code. That’s what the right text column in a hex editor is for. Sometimes they directly translate to intelligible text because the text is encoded in a typical way. You have to know the data format to translate it into something that makes more sense to humans. Hexadecimal numbers first and foremost are just numbers. In other words: there is no general translation program for numbers to meaningful representations, such as text. It would be helpful if the textual representation could be so smart to interpret any data into something meaningful, but in truth it is just an attempt to show data as text assuming a common encoding. The essential information a hex editor shows is divided into two columns, which both show the same data but represent it in different ways: the left column in a hex editor shows the raw numbers a file is made of, and next to it, the right column shows a tentative textual representation. How do you know if the text representation on the right in a hex editor is valid?

What are those ‘random’ numbers on the left in the hex editor? These or similar formulations seem to be popular variations of the above question:Ĭan I change the text to English (or another language)? We’ll start with a brief answer to this question: how do I make sense of (hexadecimal) numbers in a hex editor? (This actually was one of the motivations for me to write such a program: to understand data and representations better.)ĭata encoding, decoding and representation is a big topic, but for many applications of hex editors a few concepts are enough. But almost no program shows data in such a raw format, except for hex editors, which can make this concept pretty confusing and abstract. All data in a computer, including files, is a sequence of numbers.
