I just read Iczelion's tutorial about Windows hooks (great tutorials by the way Iczelion, thanks!), and the linker switch "/SECTION" was mentioned in it, which can be used to modify the PE section characteristics in the final exe. I was looking for exactly such a function before, but could not find it. So, again, I looked in my MASM reference (the MASM 6.1 html reference widely available on the web) and it was not in there at all (that explains why I missed it when looking for it before :)). I searched this board and found an URL to MSDN where the linker switches are listed, and there it was.

So, now to the question: Why is the "/SECTION" switch not mentioned in the MASM 6.1 html manual? Was it added subsequent to MASM 6.1 or what?

I don't like that the current manuals are only available in MSDN format, since it is often much more hard to find what you want in there. :( Are there any newer MASM manuals (newer than the 6.1 html version) available in "non-MSDN format" that anyone knows about?

Thanks!
Posted on 2002-12-08 14:10:12 by dELTA
MASM 6.1 reference you found on the web was for older DOS distribution of MASM.
Posted on 2002-12-08 14:26:59 by comrade
dELTA,

You can check the thread: (Mob's reply)

http://www.asmcommunity.net/board/showthread.php?s=&postid=65920.msg65920

Regards,

Vortex
Posted on 2002-12-08 14:27:58 by Vortex
From MSDN, VC6 edition about 2 years old.


/SECTION (Specify Section Attributes)
Home | Overview | How Do I | Linker Options
Syntax
/SECTION:name,[E][C][I][R][W][S][D][K][L][P][X]
This option changes the attributes of a section, overriding the attributes set when the .OBJ file for the section was compiled.
A section in a portable executable (PE) file is roughly equivalent to a segment or the resources in an NE file. Sections contain
either code or data. Unlike segments, sections are blocks of contiguous memory with no size constraints. Some sections contain
code or data that your program declared and uses directly, while other data sections are created for you by the linker and
librarian, and contain information vital to the operating system.
Specify a colon (:) and a section name. The name is case sensitive.
Specify one or more attributes for the section. The attribute characters, listed below, are not case sensitive. You must specify all
attributes that you want the section to have; an omitted attribute character causes that attribute bit to be turned off. The
meanings of the attribute characters are shown below.
Character Attribute Meaning
E Execute Allows code to be executed
C Conforming Marks the section as conforming
I IOPL Marks the section as IOPL
R Read Allows read operations on data
W Write Allows write operations on data
S Shared Shares the section among all processes that load the image
D Discardable Marks the section as discardable
K Cacheable Marks the section as not cacheable
L Preload VxD only; marks the section as preload
P Pageable Marks the section as not pageable
X Memory-resident VxD only; marks the section as memory-resident
A section that does not have E, R, or W set is probably invalid.

Regards,

hutch@movsd.com
Posted on 2002-12-08 15:48:45 by hutch--
hutch--, disable smilies in your post?
Posted on 2002-12-08 16:16:06 by comrade

hutch--, disable smilies in your post?


I did :)
Posted on 2002-12-08 16:24:15 by bazik
Thanks for all the replies guys, this board rocks!


PS.
Just so I know for the next time, what is the general opinion/rule about shorter thank you messages like this one on this board? On mailing lists they can be quite annoying, but in a forum like this they take up so little space/attention that the positive effects of displayed gratitude and confirmation of receiving the info might even overcome the slight negative effect of people not participating in the thread finding them useless. Any policy regarding this here? Any nice moderator who'd care to enlighten me? :)
Posted on 2002-12-08 17:05:30 by dELTA
dELTA, personally, I think a thank you message concludes a thread, letting others know a satifactory answer has been reached. Especially, if the solution was reached without a reply - others might have the same question and you help everyone by informing of the solution reached.
Posted on 2002-12-08 20:47:51 by bitRAKE
Ok, great, that's exactly what I think too. Thanks! ;)
Posted on 2002-12-09 08:16:06 by dELTA