News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

Assembling/Linking ASM sources with spaces

Started by Slugsnack, June 12, 2008, 10:37:54 AM

Previous topic - Next topic

Slugsnack

I'm not sure whether it's just me or if it's supposed to be like this but when I try assembling a file with a space, I get an error and MASM gets stuck on the folder name that has a space:

"Microsoft (R) Macro Assembler Version 6.14.8444
Copyright (C) Microsoft Corp 1981-1997.  All rights reserved.

Assembling: C:\Users\Michael\Documents\MASM32.asm
MASM : fatal error A1000: cannot open file : C:\Users\Michael\Documents\MASM32.a
sm
_
Assembly Error
Press any key to continue . . ."

If it's relevant at all, I'm on Vista.

I was looking at this thread:
http://www.masm32.com/board/index.php?topic=8912.msg64661#msg64661

But not sure how to use that to help me.  I'm using QEditor and doing Project >> Assemble & Link at the moment and I'm having to replace underscores where the spaces are.

I also used the .reg file in this post to add OllyDbg to my shell commands for convenience:
http://www.masm32.com/board/index.php?topic=8720.msg66888#msg66888

I'm getting exactly the same error when I do that too.  I've got absolutely no idea why this is happening since I also use CFF Explorer and I was looking at one of the registry keys for that and it works perfectly:
HKEY_CLASSES_ROOT\exefile\shell\Open with CFF Explorer\Command = C:\Program Files\NTCore\Explorer Suite\CFF Explorer.exe %1

jj2007

cannot open file : C:\Users\Michael\Documents\MASM32.a_sm

Sure it's the spaces? The file name in your error message doesn't have spaces, unless it sits where I highlighted the understroke - "masm32.as m"???

I attach an example with spaces both in the path and the file name. No problem.
Check the way you are actually calling ml and link...


[attachment deleted by admin]

Slugsnack

Oh sorry I might not have made it clear.  The path to the ASM file is:
"C:\Users\Michael\Documents\MASM32 Projects\Window\Making Window.asm"

It hits the first space in "MASM32 Projects" and it doesn't recognise there is a space.

I am building via QEditor and then Project >> Link & Assemble.

jj2007

Mysterious. I just build the attachment with QE, no problems. Unzip to C:\ with "use folder names".

[attachment deleted by admin]

Wannabe

I'm having the same problem.
This is what I get when opening and assembling your unpacked (in C:\ ) example :
Assembling: C:\WWN\ASM\TESTJJ\Misc\New.asm
MASM : fatal error A1000: cannot open file : C:\WWN\ASM\TESTJJ\Misc\New.asm
It seems to me that QEdit stops parsing at space and appends .ASM to it, or something like that...

MichaelW

It works for me, using QE 3.5b or 3.5c, but fails with QE 3.0k or 3.0n.
eschew obfuscation

jj2007

I attach the complete package with QE 3.5 and the bldall.bat
Read the latter, it will show you how the path will be processed.

[attachment deleted by admin]

jj2007

Here is a micro app showing the command line. Use as follows:

- Rename the bldall.bat to bldall.bax
- Rename the attached ShowCmdLine.exe to bldall.bat
- Run QEditor and see which commandline it passes on to bldall.bat
- Reverse your changes above

include \masm32\include\masm32rt.inc

.code
AppName  db "Command line:", 0

start: invoke GetCommandLine
invoke MessageBox, NULL, eax, addr AppName, MB_OK
invoke ExitProcess, 0
end start

[attachment deleted by admin]

Slugsnack

Quote from: jj2007 on June 12, 2008, 07:53:23 PM
Mysterious. I just build the attachment with QE, no problems. Unzip to C:\ with "use folder names".

I still encountered the same problem when trying to assemble & link.

Quote from: jj2007 on June 13, 2008, 07:40:27 AM
I attach the complete package with QE 3.5 and the bldall.bat
Read the latter, it will show you how the path will be processed.

Ahmmm I probably did something wrong.  I just changed my MASM32 folder to a different name then extracted your files to C:\ and ran your version of QEditor and did Project >> Assemble & Link.  Nothing happened when I did that so I probably messed up somewhere.

Quote from: jj2007 on June 13, 2008, 08:03:49 AM
Here is a micro app showing the command line. Use as follows:

- Rename the bldall.bat to bldall.bax
- Rename the attached ShowCmdLine.exe to bldall.bat
- Run QEditor and see which commandline it passes on to bldall.bat
- Reverse your changes above

include \masm32\include\masm32rt.inc

.code
AppName  db "Command line:", 0

start: invoke GetCommandLine
invoke MessageBox, NULL, eax, addr AppName, MB_OK
invoke ExitProcess, 0
end start


I just did as you asked and it assembles and links fine when the title is just GetCommandLine but if I put spaces in it like "Get Command Line" then I will still get this error:
Microsoft (R) Macro Assembler Version 6.14.8444
Copyright (C) Microsoft Corp 1981-1997.  All rights reserved.

Assembling: C:\Users\Michael\Desktop\Show.asm
MASM : fatal error A1000: cannot open file : C:\Users\Michael\Desktop\Show.asm
_
Assembly Error
Press any key to continue . . .

hutch--

Slugsnack,

Sorry I missed your post, get the later batch files in the masm32 subforum, the earlier one were not properly handling long dir or file names as they were not enclosed in quotes.

If you have version 10 beta it should already be fixed.
Download site for MASM32      New MASM Forum
https://masm32.com          https://masm32.com/board/index.php

Slugsnack

Thanks !  I was initially wary about installing a "beta" edition (had bad experiences with beta stuff) but from the feedback, it seems like you got everything working really well  :wink  Thanks very much, keep up the good work !

Now I guess I gotta figure out why integrating OllyDbg into the shell still has the error.. but this is the wrong section for that I guess.  Thanks again.

Mark Jones

Quote from: Slugsnack on June 13, 2008, 11:37:29 AM
Now I guess I gotta figure out why integrating OllyDbg into the shell still has the error.. but this is the wrong section for that I guess.

Just a reminder that the OllyDbg beta v2.0 is terribly incomplete -- many features simply are not present or do not work properly. Be sure to use the 1.1 version for any serious debugging.
"To deny our impulses... foolish; to revel in them, chaos." MCJ 2003.08

Slugsnack

Haha yeah I'm still a newby so I have just been playing around with it, only thing I'm missing so far was call stack (probably is somewhere where I can't find it).

I've been using 1.1 for a few months now.  But I finally figured out OllyDbg has a built in setting for whether to be in Windows Explorer..  Options >> Add to Explorer  :dance:

BogdanOntanu

Quote
Haha yeah I'm still a newby so I have just been playing around with it, only thing I'm missing so far was call stack (probably is somewhere where I can't find it).

It is my "observation" that you do not want to learn and do not perform even the very basic and minimal personal efforts in this direction. Instead you keep asking childish questions in a hope that intelligence can be delivered to you by somebody else on "a silver plate". I have news: it is not possible.

For example:

OllyDbg menu ->View -> Call Stack
or press Alt+K

This kind of attitude does waste our time and it is not going to ever make you learn or understand.

Do not take this reply and an insult or an personal attack. Instead take it as a warning about the fact that you must change your attitude if you want to learn how to learn.

In time you should depend less on information and what others tell you and learn to depend more on your own personal understandings and experiments.

Quote
I've been using 1.1 for a few months now.

How  is it possible to use Olly "for a few months" and still do not notice the View menu?

Ambition is a lame excuse for the ones not brave enough to be lazy.
http://www.oby.ro

Slugsnack

I was replying to the post by Mark who said 2.0 is missing some features to say that I was using 2.0 and was unable to find call stack.

I assure you I do not want to be spoonfed and am sorry if that is the impression I have given but I think perhaps you misunderstood my post.  I only had 2 problems at the start of this thread (and I thought they were related).  The problem with QEditor was me downloading 9.0 off the site and for some reason ending up with an older version of something so it did not handle spaces.  Hutch linked me to 10.0 (beta) and that problem was fixed.  Then my other problem, I found out must be a mistake with the .reg file I used and I realised OllyDbg had a built-in option to put it into the explorer.

In reply to what you are telling me, I'm aware that in OllyDbg 1.1, the call stack can be accessed in both the ways you pointed out but I tried both of the options you suggested yesterday before I made my post to check and it seems call stack is not in 2.0 yet (or at least the version that I have).