Question:
Computer Programming Questions Stuff?
POPCORN
2010-09-18 10:28:53 UTC
I would like to know how EXEs and COMs look like really. I have renamed them to *.TXT and opened them with notepad and some gibberish stuff came up, is that how they look? Once I used Winrar to extract an exe file, and a .rdata .text .data and some other files came out, what are these? If I compress these will the exe work? What are the differences between the code & data? I opened mspaint with notepad and took away an 'A' from it. Than I ran it and an error came. I put back the 'A' and it worked! So is it possible for me to write an EXE in notepad(IF I UNDERSTAND MACHINE CODE WHICH I WON'T)? And what does memory look like?
Three answers:
Voice of Insanity
2010-09-18 12:07:58 UTC
notepad can't display an exe file correctly. You need to use a hex editor for that. Also a debugger with integrated disassembler is very useful.

One program that is popular among hackers is hview- It looks like an old dos program but it isn't. It's actually one of the best hex editors/disassemblers around.

If you want to go old school, you can try the prehistoric dos debug program,

en dot wikipedia dot org/wiki/Debug_(command)

It is a very simple program so it might be easier to get into. It's what people in the 80's used to get started with assembler and stuff. But you probably need some kind of dos emulator to run it on a modern pc.

You probably know that in a computer everything is just a sequence of Bits, i.e. 0's and 1's. Code, data, everything. Bits are grouped into Bytes (group of 8 bits).

In a hex editor bytes are displayd as hexadecimal numbers

en dot wikipedia dot org/wiki/Hexadecimal

Every byte in RAM has an address. The first byte has the address 0 the second byte is at address 1 and so on. The processor uses that address to read and write bytes,

Files are also a sequence of bits/bytes of course. So they can easily be loaded into RAM.

EXE files contain the machine code and additionally they got information that windows needs to execute it. Look here

en dot wikipedia dot org/wiki/Portable_Executable
Zarn
2010-09-18 10:32:31 UTC
Yes. They're binary files. The subfields you found are assembly labels. Unlikely. The one does something (code) the other one is operated on or used (data). It is possible, though unlikely, to write an executable object in notepad. Memory looks like a huge array of addresses in sequence. Think of it as a stack of Post-Its, where each Post-It has its unique address.
lutz
2016-10-06 12:06:43 UTC
AND good judgment demands that one and all inputs be helpful for output to be helpful, so i could assume specific. i do no longer understand the call of the gate you're speaking approximately, yet I keep in mind using it.


This content was originally posted on Y! Answers, a Q&A website that shut down in 2021.
Loading...