flat assembler
Message board for the users of flat assembler.

Index > Windows > PE Console: What happens if no data in data section?

Author
Thread Post new topic Reply to topic
system error



Joined: 01 Sep 2013
Posts: 671
system error
Just wondering if this is a bug or not.

Code:
format PE console
include 'win32ax.inc'
entry text

section 'code' code executable
text:
cinvoke printf, "Test!"
invoke system, "pause>NULL"
invoke exit,0

section 'data' data readable writable
;foo dd ?

section 'idata' import data readable
library msvcrt, 'msvcrt.dll'
import msvcrt, system,'system',printf,'printf',exit,'exit'    


The console window won't come out, but runs perfectly if i enabled the foo in the data section or if I discarded the data section all together. Thx.
Post 04 Nov 2013, 13:09
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 17277
Location: In your JS exploiting you and your system
revolution
This is a bug, but not with fasm. Windows has a bug with exe files that have empty sections. The PE spec allows empty sections but the OS is not following the spec properly. If you really need it fixed the you can write to MS and ask for them to make an update.
Post 04 Nov 2013, 15:09
View user's profile Send private message Visit poster's website Reply with quote
AsmGuru62



Joined: 28 Jan 2004
Posts: 1409
Location: Toronto, Canada
AsmGuru62
Yes, I got that too recently.
Weird, but if I add anything in data section - it loads OK.
Post 04 Nov 2013, 16:08
View user's profile Send private message Send e-mail Reply with quote
system error



Joined: 01 Sep 2013
Posts: 671
system error
revolution wrote:
This is a bug, but not with fasm. Windows has a bug with exe files that have empty sections. The PE spec allows empty sections but the OS is not following the spec properly.


Thanks.

revolution wrote:
If you really need it fixed the you can write to MS and ask for them to make an update.


hmmm... sounds promising.
Post 14 Nov 2013, 14:34
View user's profile Send private message Reply with quote
typedef



Joined: 25 Jul 2010
Posts: 2913
Location: 0x77760000
typedef
revolution wrote:
This is a bug, but not with fasm. Windows has a bug with exe files that have empty sections. The PE spec allows empty sections but the OS is not following the spec properly. If you really need it fixed the you can write to MS and ask for them to make an update.


Hmm... That's like telling Google to revert the YouTube layout.


@OP
I just do dummy dd 0
Post 15 Nov 2013, 04:15
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 17277
Location: In your JS exploiting you and your system
revolution
typedef wrote:
Hmm... That's like telling Google to revert the YouTube layout.
If enough people complain then it might happen.
Post 15 Nov 2013, 04:44
View user's profile Send private message Visit poster's website Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2020, Tomasz Grysztar.

Powered by rwasa.