Why aren't EXE's in binary?

前端 未结 8 628
轻奢々
轻奢々 2021-01-12 03:02

Why is it that if you open up an EXE in a hex editor, you will see all sorts of things. If computers only understand binary then shouldn\'t there only be 2 possible symbols

8条回答
  •  执笔经年
    2021-01-12 03:34

    So I am going to give a layman answer here. What others suggested above is correct, you can read binary through Hex representation. Most data is saved in round number of bytes anyway. It is possible that e.g. compression algorithm computes a compressed representation in some odd number of bits, but it would still pad it to a full byte to save it. And each byte can be represented as 8 bits or 2 hex digits.

    But, this may not be what you have asked. Quite likely you found some ascii data inside the supposedly binary data. Why? Well, sometimes code is not just for running. Sometimes compilers include some bits of human readable data that can help debugging if the code were to crash and you needed to access the stack trace. Things like variable names, line numbers etc.

    Not that I ever had to do that. I don't have bugs in my code. Thats right.

提交回复
热议问题