evilsong / distorm

Automatically exported from code.google.com/p/distorm
GNU General Public License v3.0
0 stars 0 forks source link

Extra Returns #7

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Run disasm32.exe -b64 disasm32.exe >disasm32.txt

What is the expected output? What do you see instead?

There are empty lines when I open the txt file.
In fact, when I open the txt file with an hexadecimal editor, every carriage 
return is saved as: 0D 0D 0A, which means that there is an extra 0D.

Original issue reported on code.google.com by jcmeyrig...@gmail.com on 2 Jul 2010 at 10:19

GoogleCodeExporter commented 9 years ago
I can't replicate this bug.
Did you compile it yourself?

That sample code hasn't been touched for years now, you're the first to claim 
such a bug. Please give me more details.
Thanks.

Original comment by distorm@gmail.com on 9 Jul 2010 at 11:31

GoogleCodeExporter commented 9 years ago
Ok, here is how to reproduce (I'm using a Vista 32 bits):

1) Download the disasm32.exe program
2) Install it into a folder like C:\Disasm
3) Run the command "disasm32.exe disasm32.exe >source.txt"
4) Open source.txt with wScite (see scintilla.org)
5) You can easily check that every disassembled line is followed by an empty 
line !

In fact, every CR/LF is incorrectly saved, because it's saved as CR/CR/LF (or 
\r\r\n, or 0D 0D 0A in hexadecimal).

Original comment by jcmeyrig...@gmail.com on 10 Jul 2010 at 5:31

GoogleCodeExporter commented 9 years ago
I attached a file where I kept only the 16 first lines.

Original comment by jcmeyrig...@gmail.com on 10 Jul 2010 at 5:32

Attachments:

GoogleCodeExporter commented 9 years ago
Note: I used the disasm32.exe from your project.

Original comment by jcmeyrig...@gmail.com on 10 Jul 2010 at 5:33

GoogleCodeExporter commented 9 years ago
Just took a look at the source, and the bug is obvious:

You use \r\n for carriage return, instead of \n.

\r will generate 0x0D
\n will generate 0x0D 0x0A

Just remove all \r in your source !

Original comment by jcmeyrig...@gmail.com on 15 Jul 2010 at 8:12

GoogleCodeExporter commented 9 years ago
I guess all the time the apps I used to view the output ate the whitespace 
well...
Thanks.

Original comment by distorm@gmail.com on 16 Jul 2010 at 10:46

GoogleCodeExporter commented 9 years ago

Original comment by distorm@gmail.com on 16 Jul 2010 at 10:47

GoogleCodeExporter commented 9 years ago

Original comment by distorm@gmail.com on 20 Aug 2010 at 9:35