The MASM Forum Archive 2004 to 2012

General Forums => The Campus => Topic started by: Magnum on October 05, 2009, 12:02:50 PM

Title: Bug in the new qeditor ?
Post by: Magnum on October 05, 2009, 12:02:50 PM
I replaced the old qeditor with the new one and when I try to open a file, it says:

"Sorry, I can't find C:\masm32\source\except.asm"

It works fine if I open a file after the editor is already open.

I am running Win XP Pro Sp2
Title: Re: Bug in the new qeditor ?
Post by: hutch-- on October 05, 2009, 03:56:17 PM
Have a look at how your file associations are done. You are the second person to report this problem but I have not changed any code in the command line handling. QE normally reports this error if it gets something strange handed to it.

If you can track it down it would be most appreciated.
Title: Re: Bug in the new qeditor ?
Post by: Magnum on October 06, 2009, 03:03:57 AM
Quote from: hutch-- on October 05, 2009, 03:56:17 PM
Have a look at how your file associations are done. You are the second person to report this problem but I have not changed any code in the command line handling. QE normally reports this error if it gets something strange handed to it.

If you can track it down it would be most appreciated.

I can't find anything that could be causing the problem.
I went back to the older version.

Is there a way that I could use Ollydbg 2.0, to see what is happening?



Title: Re: Bug in the new qeditor ?
Post by: BlackVortex on October 06, 2009, 03:05:59 AM
Follow this thread :
http://www.masm32.com/board/index.php?topic=12423.0
Title: Re: Bug in the new qeditor ?
Post by: GregL on October 06, 2009, 03:15:13 AM
I just tried it with qeditor version 4.0c from the command-line and it works fine with a path without quotes (the path had no spaces), if I add quotes to the path, I get the error.  Windows Explorer will add quotes if you use 'Open With'.  I'm using Windows 7.
Title: Re: Bug in the new qeditor ?
Post by: Magnum on October 06, 2009, 11:50:14 AM
Quote from: Greg on October 06, 2009, 03:15:13 AM
I just tried it with qeditor version 4.0c from the command-line and it works fine with a path without quotes (the path had no spaces), if I add quotes to the path, I get the error.  Windows Explorer will add quotes if you use 'Open With'.  I'm using Windows 7.


I just found out the same thing.
It works fine when used without quotes, even in long directory paths.

Title: Re: Bug in the new qeditor ?
Post by: hutch-- on October 06, 2009, 12:29:44 PM
With thanks to Greg, that particular problem is solved, I put the code to strip the double quotes AFTER the test if the file name was valid and with the surrounding double quotes it would always fail the test. I changed the code to strip the quotes before the file name test.

This one is working off the command line with enclosed quotes properly, would you folks mind testing it on your boxes so I know if its OK on other configurations ?
Title: Re: Bug in the new qeditor ?
Post by: sinsi on October 06, 2009, 12:43:55 PM
Works fine for me now  :U
Nice product support  :bg
Title: Re: Bug in the new qeditor ?
Post by: BlackVortex on October 06, 2009, 02:37:36 PM
Quote from: hutch-- on October 06, 2009, 12:29:44 PM
With thanks to Greg, that particular problem is solved
Am I invisible ?!   :'(
Title: Re: Bug in the new qeditor ?
Post by: Magnum on October 06, 2009, 03:53:56 PM
Quote from: hutch-- on October 06, 2009, 12:29:44 PM

This one is working off the command line with enclosed quotes properly, would you folks mind testing it on your boxes so I know if its OK on other configurations ?

Thanks a lot.
It works fine on XP Pro Sp2.
Title: Re: Bug in the new qeditor ?
Post by: GregL on October 06, 2009, 06:32:15 PM
Hutch,

That one is working fine with or without quotes.  :thumbu

Title: Re: Bug in the new qeditor ?
Post by: nathanpc on October 06, 2009, 06:36:51 PM
It's working very nice! :D
Title: Re: Bug in the new qeditor ?
Post by: cookj on October 06, 2009, 10:09:43 PM
Hutch

I tried the new QE version.  Its works perfectly.  You are
the man!

I appreciate you spending some valuable time fixing this.

I was starting to wonder if it was just me.

Thanks again


John
Title: Re: Bug in the new qeditor ?
Post by: hutch-- on October 06, 2009, 10:53:57 PM
Thanks folks,

It absolutely did not do it on any of my 4 boxes and it was only the test condition that Greg suggested that gave me a way of testing and fixing it.

> Am I invisible ?!,

Nah and your suggestions were appreciated but it was something that I botched in the source code. The culprit was here.


  ; -----------------------------------
  ; load command line file if it exists
  ; -----------------------------------
    mov pcmdline, rv(GetCommandLine)            ; get the command line
    .if len(pcmdline) < 261                     ; test length for oversized command line
     mov pbuf, rv(cmd_tail)                     ; get the command tail
      test eax, eax
      jz over                                   ; jump over if no args
      mov pbuf, remove$(pbuf,chr$(34))          ; remove the double quotes
      .if rv(exist,pbuf)                        ; test if the file exists
        invoke Read_File_Inx,hEdit,pbuf         ; load it if it exists
        invoke SetWindowText,hWnd,pbuf
      .else                                     ; else show error
        mov pbuf2, ptr$(buffer2)
        mov pbuf2, cat$(pbuf2,"Sorry, cannot find file [ ",pbuf," ]")
        fn MessageBox,hWnd,pbuf2,"Quick Editor",MB_OK
      .endif
    over:
    .else
      fn MessageBox,hWnd,"Excessive length command Line","Exploit Warning",MB_OK
    .endif

  ; -----------------------------------


I had put the line,


      mov pbuf, remove$(pbuf,chr$(34))          ; remove the double quotes


inside the .IF block that was conditional on the file existing so the error was flagged before the code could be executed.

I have an excuse, old age, senile decay and failing eyesight.  :bg
Title: Re: Bug in the new qeditor ?
Post by: hutch-- on October 07, 2009, 02:02:46 AM
Just as a note, I have posted the fixed version in the masm32 sub forum, I changed the post title to reflect the changes.
Title: Re: Bug in the new qeditor ?
Post by: BlackVortex on October 07, 2009, 02:20:35 AM
Quote from: hutch-- on October 06, 2009, 10:53:57 PM
Nah and your suggestions were appreciated but it was something that I botched in the source code. The culprit was here.
But I found the problem with the quotes first after debugging for a few minutes and posted in that thread.
http://www.masm32.com/board/index.php?topic=12423.0

Oh damn, no glory for me this time   :(
Title: Re: Bug in the new qeditor ?
Post by: hutch-- on October 07, 2009, 02:31:44 AM
 :bg

the world is a malicious plot that robs the talented of their glory for the sheer sake of fashion. All help was appreciated and used.
Title: Re: Bug in the new qeditor ?
Post by: sinsi on October 07, 2009, 02:33:37 AM
BlackVortex: profile: age: N/A

I think we can make a guess... :lol
Title: Re: Bug in the new qeditor ?
Post by: BlackVortex on October 07, 2009, 03:10:06 AM
Everyone wants to steal my thunder !  :green2