Question about executables Hex Editors

scratch416

Beta member
Messages
2
Most executable files i open up in my hex editor have a bunch of special characters and alphanumeric characters that to me at least, do not make any sense. Then there are portions of the file that are stored as plain text. Can anyone explain whats going on there for me? the only thing i can think of is some kind of code obfuscation.


Thanks!
 
Not code obfuscation, but code. When code is compiled you don't get the plain text in the code's language stored, you get a low level representation of a machine language. It's this code (that will make little sense unless you know exactly what you're looking for) that will form the majority of the file. Literal strings in the code are usually stored as literal strings that you can read in a hex editor, unless the code's been obfuscated - hence the importance of not storing confidential literal strings directly in executables! It's those literals that you'll see every so often scattered around the file.
 
you need to think about the operations that are being performed.

then you need to consider that there is a standard instruction set for a chip, and there are hex codes that do certain things.

for example, when you have a simple operation, Add two numbers together.

you need to think abut how this is done, you have input, process, output.

there will be quiet a few operations for this, all around get input from memory, store data in the accumulator on the chip device, perform operations on the data stored in acc (addition), then store result, get result display result.

all the chip operations are actually just binary codes, which are presented to us usually in HEX, and often we give then their ASCII charectors as well, so you may well see a small heart symbol, but that's actually an instruction to get some data from a memory location, followed by a number to specify that memory location.

you're seeing plain text, because the text is stored in plain text.

so what you're actually seeing is a command (push the following data to the console output) (data is Hello world).



instruction sets for devices are freely available online, so if you really want to see what that compiled code is doing, you can work it all out.
 
Back
Top Bottom