frhed | fork of https | Editor library
kandi X-RAY | frhed Summary
kandi X-RAY | frhed Summary
fork of https://bitbucket.org/jtuc/frhed
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of frhed
frhed Key Features
frhed Examples and Code Snippets
Community Discussions
Trending Discussions on frhed
QUESTION
Here are the steps I followed.
1) I took the assembly language code for three different small programs from the book "Assembly Language for x86 Processors" by Kip Irvine.
2) I assembled, linked to produce a valid executable without errors in each case.
3) For each of the executable files, I generated disassembly using NASM
...ANSWER
Answered 2018-Jan-27 at 09:05Short answer: .exe
≠ .com
Hint: notice the MZ
signature as two first bytes in the output of step 5 :-P
Long answer:
Microsoft's executable .exe
format has more than just code. First of all it starts with a special signature (initials of the format's creator) followed by quite a bit of information that describes the organization of the code.
In contrast a .com
file is just a code, meaning the very first byte of it is what gets executed once the file is loaded into memory.
The first disassembly you get is a wrong one (yes, the first one is wrong, not the second!) as it tries to start the parsing with the first byte instead of jumping on to the actual code.
dumpbin
is intelligent enough to properly parse the header of that .exe
file and begins the disassembly of the actual code.
Solution
If you'd like to compare the disassembly output you either have to make sure that your NASM is aware of the type of file and properly parses its header or... simplify your life and convert the .exe
into a .com
in which case both disassembling operations should produce the same output (barring potential bugs, of course)
The last time I was converting an .exe
file into a .com
was many years ago with a utility called exe2bin
. A quick search online shows that this was during the days of Windows XP and is no longer shipped with the OS. Though I see no reason for it to not work if you download it from some place.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install frhed
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page