flat assembler
Message board for the users of flat assembler.

flat assembler > Windows > Win64 NMake Project Example:

Author
Thread Post new topic Reply to topic
bitRAKE



Joined: 21 Jul 2003
Posts: 2795
Location: dank orb
Code:
          Win64 Modular FASM Project Example


Concepts Demonstraited:

       - modular NMake build process
       - inline NMake file
 - section positioning within executable
     - passing commands to linker from object


Project Structure:

      Makefile - builds the project

   FileA.exe +-- FileA.obj +-- FileA.fasm
                |             +-- FileA.finc
                |
           +-- FileB.obj +-- FileB.fasm
                |             +-- FileB.finc
                |
           +-- FileC.res +-- FileC.rc
                                +-- FileC.ico
                               +-- FileC.xml (inlined)

 ReadMe.txt - (this file, silly - use 8 for tab and courier font)
    VSGo.cmd - execute for prompt if Visual Studio 9.0 is installed.


Requirements:

   - latest FASM
       - Windows x64 Platform SDK
    (or at least \bin & \lib directories)

   It is assumed that sufficent build environment is already established to
    use MSVC. Another linker and resource compiler could be used with NMake,
    but that seems rather silly. NMake will need to be in the environment
       variable %path% - project can be built by simply typing 'nmake' in the
    directory. Remove temporary files with "nmake clean".


Resources:

       FASM, http://www.flatassembler.net/
     NMAKE, http://msdn.microsoft.com/en-us/library/dd9y37ha.aspx
    LINK, http://msdn.microsoft.com/en-us/library/t2fck18t.aspx
     FDBG, http://fdbg.x86asm.net/



       bitRAKE, 2009.06.01


Challenges:

  - all source files can be inlined within makefile (yes, really)
    
Of course, all the same concepts apply equally well to Win32 programming.

* Update: corrected spelling mistake and pass commands to linker from object file (makefile becomes more general).


Description:
Download
Filename: NMake64.zip
Filesize: 4.44 KB
Downloaded: 102 Time(s)


_________________
¯\(°_o)/¯ unlicense.org
Post 01 Jun 2009, 08:35
View user's profile Send private message Visit poster's website Reply with quote
bitRAKE



Joined: 21 Jul 2003
Posts: 2795
Location: dank orb
Another permutation of my horrible subclass example. This time using NMake and demonstraiting encapsulizaton of the main code. It seems using "/SUBSYSTEM:WINDOWS,6.00" forces the linker to use a dynamic /BASE - despite using a /BASE command line switch (wtf!). More investigation is needed to determine, why and how to bypass this feature?


Description: NMake example #2
Download
Filename: SubClass64.zip
Filesize: 6.75 KB
Downloaded: 90 Time(s)


_________________
¯\(°_o)/¯ unlicense.org
Post 07 Jun 2009, 23:25
View user's profile Send private message Visit poster's website Reply with quote
f0dder



Joined: 19 Feb 2004
Posts: 3170
Location: Denmark
bitRAKE wrote:
It seems using "/SUBSYSTEM:WINDOWS,6.00" forces the linker to use a dynamic /BASE - despite using a /BASE command line switch (wtf!). More investigation is needed to determine, why and how to bypass this feature?
ASLR? - in case you haven't already solved the problem (it's been a while Smile), try adding /FIXED:YES and/or /DYNAMICBASE:NO .

_________________
Image - carpe noctem
Post 26 Jan 2010, 07:49
View user's profile Send private message Visit poster's website Reply with quote
bitRAKE



Joined: 21 Jul 2003
Posts: 2795
Location: dank orb
Thank you - I was missing some of the default behavior.
Post 26 Jan 2010, 17:26
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-2019, Tomasz Grysztar.

Powered by rwasa.