Thread: MASM -> /ALIGN:4 doesn't work

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Registered User
    Join Date
    Jan 2008
    Posts
    244

    MASM -> /ALIGN:4 doesn't work

    Hey,
    if there are any MASM coders, please help me out!

    i'm trying to achieve smaller executable sizes using /ALIGN:4
    but all i get is an application error (0xc0000018), when the executable is run.
    this example runs fine under winXP, but not under windows 7.

    you'd say i have to use at lease 512 align, but i've seen handcrafted PE stubs with no align at all, yet working.
    so how do i manage this? do i have to write the PE header myself, or is there any other option to remove the align?

    any ideas?


    code:
    Code:
    .386
    .model flat, stdcall
    option casemap :none
    
    include \masm32\include\kernel32.inc
    includelib \masm32\lib\kernel32.lib
    
    .code
    start:
    	invoke ExitProcess, 0
    end start
    compiled with that commandline:
    Code:
    \masm32\bin\ml /c /coff /nologo test.asm
    \masm32\bin\Link /SUBSYSTEM:WINDOWS /MERGE:.rdata=.text /ALIGN:4 test.obj > nul
    Last edited by Devils Child; 02-07-2011 at 12:16 PM.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. strcmp returning 1...
    By Axel in forum C Programming
    Replies: 12
    Last Post: 09-08-2006, 07:48 PM
  2. getline() don't want to work anymore...
    By mikahell in forum C++ Programming
    Replies: 7
    Last Post: 07-31-2006, 10:50 AM
  3. Why don't the tutorials on this site work on my computer?
    By jsrig88 in forum C++ Programming
    Replies: 3
    Last Post: 05-15-2006, 10:39 PM
  4. Problems in getting OpenGL to work
    By zonf in forum C Programming
    Replies: 5
    Last Post: 02-13-2006, 04:48 AM
  5. Replies: 10
    Last Post: 12-03-2005, 10:53 PM