News:

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

Bug in the new qeditor ?

Started by Magnum, October 05, 2009, 12:02:50 PM

Previous topic - Next topic

Magnum

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
Have a great day,
                         Andy

hutch--

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.
Download site for MASM32      New MASM Forum
https://masm32.com          https://masm32.com/board/index.php

Magnum

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?



Have a great day,
                         Andy


GregL

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.

Magnum

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.

Have a great day,
                         Andy

hutch--

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 ?
Download site for MASM32      New MASM Forum
https://masm32.com          https://masm32.com/board/index.php

sinsi

Works fine for me now  :U
Nice product support  :bg
Light travels faster than sound, that's why some people seem bright until you hear them.

BlackVortex

Quote from: hutch-- on October 06, 2009, 12:29:44 PM
With thanks to Greg, that particular problem is solved
Am I invisible ?!   :'(

Magnum

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.
Have a great day,
                         Andy

GregL

Hutch,

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


nathanpc


cookj

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

hutch--

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
Download site for MASM32      New MASM Forum
https://masm32.com          https://masm32.com/board/index.php

hutch--

Just as a note, I have posted the fixed version in the masm32 sub forum, I changed the post title to reflect the changes.
Download site for MASM32      New MASM Forum
https://masm32.com          https://masm32.com/board/index.php