The MASM Forum Archive 2004 to 2012

General Forums => The Campus => Topic started by: ArtemESC on August 17, 2006, 12:21:16 PM

Title: Masm parameters...
Post by: ArtemESC on August 17, 2006, 12:21:16 PM
I want compile only executive part, without exe-header. What parameters i must add to command string?
Title: Re: Masm parameters...
Post by: Boucly on August 17, 2006, 12:38:38 PM
ArtemESC,

Do you mean like a .DLL file?

Boucly
Title: Re: Masm parameters...
Post by: ArtemESC on August 17, 2006, 12:45:30 PM
Boucly, like com-file...
Title: Re: Masm parameters...
Post by: Tedd on August 17, 2006, 12:54:32 PM
32 or 16 bit code?
You'll need a different linker, as the microsoft one creates 'headered' formats. Though you can get 16-bit code into a .com file using the old 16-bit linker.
Title: Re: Masm parameters...
Post by: ArtemESC on August 17, 2006, 01:05:43 PM
Tedd, Masm 6.13...
Title: Re: Masm parameters...
Post by: Tedd on August 17, 2006, 01:27:07 PM
That would be your version of "ml.exe" - the assembler.
You need an older version of "link.exe" - the linker. (Assuming 16-bit code)

If you're trying to build code without the exe structure, then do you want to produce .com files, or are you working on something like an OS?
For .com files, you need the older (16-bit) linker. For OS you'll want a assembler/linker which outputs 32-bit raw binaries (such as nasm, or fasm.)
Title: Re: Masm parameters...
Post by: Mark Jones on August 18, 2006, 05:37:49 AM
Are not .OBJ files just code without PE formatting?
Title: Re: Masm parameters...
Post by: Tedd on August 18, 2006, 11:40:09 AM
No, they have sections and symbols and what-not. It shouldn't be too difficult to extract just the code and data parts, but there will still be some 'linking' to do, even if it's just fixing pointers and function calls.
Title: Re: Masm parameters...
Post by: ToutEnMasm on August 18, 2006, 12:13:44 PM

For com file, if i understand well what is needed , there is a special package in this forum.
See The upper right corner of this site,you fill find what you want.
Com files have a header (100 bytes) but with some options,that ml give you probably by "ml /?".
I have made it there is a long time but it is possible.
The code start at offset 0 without header like a listing.
                        ToutEnmasm

                         
Title: Re: Masm parameters...
Post by: ToutEnMasm on August 18, 2006, 12:41:28 PM

With 32 bits the technique is useful to inject code in an executable and is the first technique usable by an aprentice to write a virus.
Hopefully for us , this technique is well known by the actual antivirus that treat this well.
                                          ToutEnMasm
Title: Re: Masm parameters...
Post by: Mark Jones on August 19, 2006, 07:43:43 PM
Quote from: Tedd on August 18, 2006, 11:40:09 AM
No, they have sections and symbols and what-not. It shouldn't be too difficult to extract just the code and data parts...

Sorry Tedd, I was being facetious. :bg
I should have stated that more clearly. :)