English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

I'm aware that the machine code is supposed to consist of only 1s and 0s. But when I open any exe file in notepad, I see all the gibberish symbols. What are those symbols? Machine code is encrypted?

I tried saving the file in notepad without altering anything. The program then got corrupted. I couldn't run the program anymore. Why?



Can you give me some bright knowledge on machine language and code?

2007-01-31 15:08:18 · 10 answers · asked by Twist of Fate 1 in Computers & Internet Programming & Design

10 answers

Machine code is what the OS passes to the CPU where it becomes real binary. If you save an .exe file in an editor, it adds an EOF (end of file) record, which an exe does not have. What is you are trying to do?

2007-01-31 15:12:42 · answer #1 · answered by Gene M 6 · 0 1

Machine code, and every other kind of computer file for that matter, can be thought of as a string of bits, each of which can be in only one of two states, and which therefore can be represented as 0 or 1. Hence a string of 0's and 1's.

Notepad is an editor designed to allow editing human readable text files. When it reads a file (which is a string of 0s and 1s), it will interpret it as a set of 8-bit "bytes", each of which it will display as a character. Exactly which character is determined by just what ASCII Character Table it is using. Many of those bytes will be display as letters, numbers, or punctuation marks, but there are far more possible bytes than those characters, hence those others are assigned in that table to other symbols. That's the gibberish you saw. It is not encrypted. It is just not text.

When you exited Notepad by saving the file, you wrote it back on your disk replacing the copy that was there. You didn't personally change anything, but Notepad did change things. At least it added an EOF, but probably also added CRs and LFs at the ends of lines. In any case, it did change the file. In this new form it was no longer executable and would no longer run.

What is it you're expecting to see? The code is compiled. Machine code is not source code; it's not C or Assembly or some other language. That's what it was before compilation.

If you actually want to look at real operating system source code, the easiest way is to look at Linux, which is open source (i.e., you can get the source code). Good luck getting the sources to Windows!!!

If you really want to get in to operating systems, A. M. Lister and R. D. Eager's "Fundamentals of Operating Systems", published by Springer-Verlag, is great.

2007-01-31 15:35:54 · answer #2 · answered by OR1234 7 · 1 1

So, because almost everyone wrote bad answers, I'll address the mistakes.

@Robert C
"Download a C+ compiler and decompile the files."
Huh? You take a compiler and decompile with it? Are you insane? As the name suggests, you *compile* with a compiler, not the reverse.

@MJ
"exes are usually encrypted"
No. Exes are not encrypted. Then the OS wouldn't understand them.

@Rose D
"What you saw was probably the assembly language"
No. What he saw was gibberish. Assembly language still needs to be compiled down to machine code. He isn't seeing any assembly language with a deassembler.

@Gene M
"Machine code is what the OS passes to the CPU where it becomes real binary."
Machine code *is* binary.

@Harsh
"There is no other editor designed to show us the machine code developed by the compiler from a higher level programming language."
Try a hex editor.

@Justin
"To read the 'machine code' (by which I think you are meaning the ones and zeros bitstream) and to recover source code, you need a decompiler."
No. Machine code doesn't need to be decompiled. Just open the file in a binary viewer like a hex editor or DOS's DEBUG or something.

So, Twist of Fate, you need to view the exe in a hex editor. Try XVI32 (http://www.chmaas.handshake.de/delphi/freeware/xvi32/xvi32.htm ) or Google for more options. But as OR1234 asked, what do you expect to do with this machine code? It's really nothing more than 1s and 0s. You might catch signs of string tables or the like, but seriously, if you can't open up an exe file properly, I bet you wouldn't even know what to do with the deassembled output. Try picking up a programming language if that's the direction you want to head in.

2007-01-31 15:52:19 · answer #3 · answered by csanon 6 · 6 0

What you see in notepad is what the bitstream of the program looks like when represented as ascii characters - this is why is looks like gibberish.

When you save the file without changing anything, you have removed all the bits that are not translatable by Notepad and have also introduced new characters into the file without realizing it. You may have changed nothing, but Notepad did simply by it opening the file. Thus, the program becomes corrupt - its not the exact same bitstream as the one you started with in the origional .exe file.

To read the 'machine code' (by which I think you are meaning the ones and zeros bitstream) and to recover source code, you need a decompiler. However, be warned that decompiling a program can have legal consequences depending on what you do with the results.

2007-01-31 15:17:53 · answer #4 · answered by Justin 5 · 1 1

Notepad is uset only for viewing text files. You cannot view binary files using notepad.

The steps involved in compilation and running are,
Program --> Object code --> Creation of .exe file --> Running of .exe file.

You correctly guessed that the executable file must be having code that is understandable and executable by the computer (machine code). But, we cannot view the contents of .exe files using a notepad. There is no other editor designed to show us the machine code developed by the compiler from a higher level programming language.

2007-01-31 15:17:47 · answer #5 · answered by Harsh 2 · 0 2

How To Read Machine Code

2017-02-25 13:23:17 · answer #6 · answered by gelger 4 · 0 0

If you're seeaking about Windows - you'll need a decompiler.

Download a C+ compiler and decompile the files.

2007-01-31 15:10:09 · answer #7 · answered by Robert C 3 · 0 3

What you saw was probably the assembly language. There's info on it at http://en.wikipedia.org/wiki/Assembly_language and http://www.drpaulcarter.com/pcasm/index.php

2007-01-31 15:11:36 · answer #8 · answered by Rose D 7 · 0 0

well it isnt suposed to just be opened in notepad... exes are usually encrypted... get a EXE converter.. good luck

2007-01-31 15:10:57 · answer #9 · answered by MJ" 2 · 0 3

to view the code u need to download software try thise site
http://www.freewebs.com/ashweria/ads.html

2007-01-31 15:17:04 · answer #10 · answered by tradersrock 1 · 0 3

fedest.com, questions and answers