News:

Masm32 SDK description, downloads and other helpful links
Message to All Guests
NB: Posting URL's See here: Posted URL Change

Main Menu

Rosasm crash on ShellExecuteEx

Started by BurnWithMe, July 17, 2013, 10:09:03 AM

Previous topic - Next topic

BurnWithMe

This is a repost. I posted this on the RosAsm board, as well.

I am not 100% sure this is a RosAsm bug, or me abusing the API. But the fact is that RosAsm crash
when I call ShellExeuteEx, if I give the filename in "Quotes", but the path without quotes.
.....
When the app runs outside the debugger there is no crash and the file executes.
The path contains a directory with a " " space in the name. Therefore I use the quotes on the filename.
But the path maybe also should have quotes. But in any case, rosasm should not crash? *unsure*

To reproduse the bug, make a long path like for instance: "c:\rosasm\rosasm files\test cases\Mytest\Testing 1 2 3\SomeExe.exe"

Then call ShellExecuteEx with the lpFile set to the FULL path to the exe, but inside "quotes" .
And then lpDirectory set to the path of the exe, but now without "quotes".
lpParam is set to &NULL
fMask = &SEE_MASK_NO_CONSOLE+&SEE_MASK_FLAG_NO_UI+&SEE_MASK_FLAG_DDEWAIT
nShow = &SHOW_NORMAL
lpVerb  = "open"

All other members of the struct are zero, except the SIZE member. This should reproduce the bug.



guga

Are you using the string in quotes with the null termination ?

The correct syntax should be:

mov D$lpVerb  {B$ "open", 0}


If you are using it on a structure the correct is:
lpverb member is a pointer to a string, so the correct is

[SHELLEXECUTEINFOA:
SHELLEXECUTEINFOA.cbSize: D$ len
SHELLEXECUTEINFOA.fMask: D$ &SEE_MASK_NO_CONSOLE+&SEE_MASK_FLAG_NO_UI+&SEE_MASK_FLAG_DDEWAIT
SHELLEXECUTEINFOA.hwnd: D$ 0
SHELLEXECUTEINFOA.lpVerb: D$ SzTag
SHELLEXECUTEINFOA.lpFile: D$ SzPath2
SHELLEXECUTEINFOA.lpParameters: D$ 0
SHELLEXECUTEINFOA.lpDirectory: D$ 0
SHELLEXECUTEINFOA.nShow: D$ 0;&SHOW_NORMAL
SHELLEXECUTEINFOA.hInstApp: D$ 0
SHELLEXECUTEINFOA.lpIDList: D$ 0
SHELLEXECUTEINFOA.lpClass: D$ 0
SHELLEXECUTEINFOA.hkeyClass: D$ 0
SHELLEXECUTEINFOA.dwHotKey: D$ 0
SHELLEXECUTEINFOA.hIcon: hMonitor: D$ 0
SHELLEXECUTEINFOA.hProcess: D$ 0]

[SzTag: B$ "Open", 0]
[SzPath2: B$ "c:\rosasm\rosasm files\test cases\Mytest\Testing 1 2 3\SomeExe.exe", 0]

    call 'SHELL32.ShellExecuteExA' SHELLEXECUTEINFOA


Btw: where did you got the SHOW_NORMAL equate ? Can you post it here ? I don´t have this one in my equates version, since i made some modifications and it may differs from the original equates i posted.
Aren´t you mistaking it with SW_SHOWNORMAL ?


Which RosASm version are you using, btw ?
Coding in Assembly requires a mix of:
80% of brain, passion, intuition, creativity
10% of programming skills
10% of alcoholic levels in your blood.

My Code Sites:
http://rosasm.freeforums.org
http://winasm.tripod.com

BurnWithMe

ShellExecuteEx accepts both quoted and unquoted strings I think.  (I tested this after posting, but frankly no longer remembers as this is not important to me. What I thought important is to find out why RosAsm crash, so it can be prevented. Anyway this was with version 2047. I will test with the newer version later, but this will not happen very soon because of the several small changes I made to RosAsm in meantime, to enable LAA for instance. I have to reimplement those changes, and its for another day. I still wanted to report this, as I assume it likely still would exits, or that if not you would know.

RosAsm crash, if the file is quoted or unquoted. It crash because of the space in the filename. RosAsm also crash on filenames without quotes, when calling ShGetFileInfo to extract an icon. I know its a pain in the ass to test for these things, but .... hehe, thats why I am not on the RosAsm dev team:D 
Anyway, ShGetFileInfo does not accept quoted strings, but succeeds on strings with spaces in them, but the RosAsm debugger crashes still.

guga

I´ll tried, but i´m not getting any crashes here.

If you can, try later to post exactly what you did for me to analyze if it is crashing, because it seems only a syntax error or a older bug that i already corrected, since you are using an very old RosAsm version (The current is 2053f and not 2047).

Btw: If ShellExecuteEx accepts both quoted and unquoted strings, it probably something not right on the syntax you used (At least i don´t remember if even on older versions of RosAsm it was allowed strings without quotes), because all RosAsm strings are to be used in quotes (single quote for a singleline string) and double quotes for a multiline string, but, this Api uses in all cases, NULL terminated strings.


With your code it will be easier to see what is happenning since i´m not being able to reproduce what you are reporting.

Many thanks for the reports, but try using the newer versions. If you made modifications on an older RosAsm version, post both the files here, the modified and the original so i can analyse and implement it on the newer ones for you (I´m asking for the original older one simply because it would be easier if you post the original v 2047 here, because i´ll have to spend hours looking on one of my DVDs for this file, and i have hundreds here to see in which one exactly this file is stored)


Coding in Assembly requires a mix of:
80% of brain, passion, intuition, creativity
10% of programming skills
10% of alcoholic levels in your blood.

My Code Sites:
http://rosasm.freeforums.org
http://winasm.tripod.com

BurnWithMe

Many thanks for the reply. I also want to thank you for the reply in the LAA thread  :t, because the forum did not allow me to post as it was too early since my last post.

I will try with the new version maybe in a couple of days, and I make a new posting then if it is still a problem.

guga

Not allowed to post ? I didn´t knew it have this sort of time restriction in between posting. I´ll take a look and see if i can modify it
Coding in Assembly requires a mix of:
80% of brain, passion, intuition, creativity
10% of programming skills
10% of alcoholic levels in your blood.

My Code Sites:
http://rosasm.freeforums.org
http://winasm.tripod.com

guga

Ok...done....try now if you can instantly repost
Coding in Assembly requires a mix of:
80% of brain, passion, intuition, creativity
10% of programming skills
10% of alcoholic levels in your blood.

My Code Sites:
http://rosasm.freeforums.org
http://winasm.tripod.com

dedndave

don't know if you changed it, but there is a 1 minute waiting period
this keeps spammers from driving us nuts - lol

although - i find it anoying, too
i like to pop in, perhaps make a few posts, and pop out

it would be nice if it were reduced to 30 seconds, if that's an option

guga

1 minute ??? damn...i settled this stuff to 0, thinking that it would then allow.

I enabled it to 5 seconds ok ? Before we needed to wait 15 seconds. Is 5 seconds good enough ?
Coding in Assembly requires a mix of:
80% of brain, passion, intuition, creativity
10% of programming skills
10% of alcoholic levels in your blood.

My Code Sites:
http://rosasm.freeforums.org
http://winasm.tripod.com

dedndave