If you open an EXE file in notepad and copy the raw data and save it as another exe file, will it run?
Ad by Tenorshare Co.,Ltd.
Fix all iOS/iPadOS/TVOS problems at home!
Fix your device without data loss. Download Reiboot now!
5 Answers
Answered April 3, 2018 · Author has 348 answers and 320.2K answer views
No. Because even when in the file system both plain text documents and executables are represented as files, in reality they are quite different things. It’s just they represented it like that for convenience.
Quoting Wikipedia “At a generic level of description, there are two kinds of computer files: text files and binary files”
A plain text file data always represents characters, while binary data can represent anything else. For example here’s the spec about how to interpret .exe data.
Some sections of a binary can contain characters too. So if you open those files in the notepad you will see some strings, but everything else as unreadable.
Those sections then are substituted by some other character. And if you save the file what you are actually recording is just that interpretation, not the real binary.
1.7K views · Answer requested by
, former Sr. Software Engineer at Google (2011-2012)
Answered February 9, 2018 · Author has 15.6K answers and 42.6M answer views
A Notepad open-save will not result in a binary copy.
So since it’s not an exact copy, it probably won’t run.
I say “probably” because you could possibly construct a binary that could survive what Notepad did to it. If you were really, really, clever.
OK, I just did it. I had to do it in assembly to avoid the zeros. It’s feasible, but I got a “Hello World” to live through Notepad. I had to do math to make the null work at the end.
A complex program will definitely not live.
2.8K views · ·
View 36 Upvoters
· Answer requested by
Sponsored by Blissy
This pillowcase is quickly becoming the must-have gift of 2020.
Consumers all over want to get their hands on the Blissy pillowcase.
Answered February 6, 2018 · Author has 783 answers and 1.3M answer views
Originally Answered: If you open an exe file in notepad and copy the raw data and save it as another exe file, will it run?
Most likely not. When you open a binary file such as .exe in text editor, the text editor will try to interpret the data as text. It might, for example, skip zeroed bytes, change line endings, replace non-printing characters with placeholders, trim some parts of unicode that it does not recognize and so on.
What you can do is to convert exe to hex or base64 representation. Then it will be just printable characters that you can safely copy and paste, then convert them back to exe when you’re done.
2.6K views · ·
View 3 Upvoters
, former Senior Software Engineer at Qualcomm (2013-2015)
Answered February 6, 2018 · Author has 2.5K answers and 1.8M answer views
Originally Answered: If you open an exe file in notepad and copy the raw data and save it as another exe file, will it run?
Not a chance. Notepad will corrupt any binary file, as Tim Fee mentioned.
To view and manually edit a binary file such as a .exe file you must use a “hex editor”. Several good free ones can be found online with a simple search.
Even with a hex editor, it is very difficult to successfully edit an executable file, as modern ones all contain checksums or other encrypted key values to ensure that they haven’t been corrupted or tampered with. Only if you fully understand the executable format and can modify those hashed values correctly will these modified executables run successfully.
4.6K views · ·
View 5 Upvoters
, former IT/Industrial Programmer at LeMatic (2016-2017)
Originally Answered: If you open an exe file in notepad and copy the raw data and save it as another exe file, will it run?
In a word, no. Notepad, or the text editor of you choice, will either stop reading data at the ascii end of file, eof, character or it will ignore the eof character completely. Either one results in file corruption if you save it. By the way, there can be, and usually are, multiple eof characters in a compiled binary whereas there is usually only one in a plain text file at the end of the file.
1.7K views · ·
View 11 Upvoters
Sponsored by Gundry MD
How to entirely empty your bowels every morning (revealed).
World renowned cardiologist explains how with at home trick.