The MASM Forum

General => The Laboratory => Topic started by: 0000 on September 04, 2015, 02:54:22 PM

Title: Automated Plugin Builder plugin for qe
Post by: 0000 on September 04, 2015, 02:54:22 PM


Hi. I have created a plugin builder for qe that I have used for some time now. It greatly simplifies the creation of plugins for qeditor.
The stand alone version works so well, I decided to create it a plugin itself - to make plugin creation that much easier.


Yes qeditor comes with a good selection of plugins. Why would you want to create your own plugins? Formatting source files
is one of the reasons why I do.


July 21, 2018:


Version 5 Beta version is linked below - .dll only at this time.


Code: [Select]
-- Quick Instructions for the Plugin Builder --


1.  create a folder for your plugin project.


2.  create a file with your plugin procedure.
    just the procedure and any sub procedures that it uses.


3.  open the file in QEditor. Selection --> "Select All"


4.  Select Plugins --> Plugin Builder


5.  Enter the plugin main module name in the Dialog Box


6.  Enter the text that you want on QEditors menu in the Dialog Box


7.  Click "Process", and your project will automatically be built,
    the dll copied to masm32 plugins folder, and menu entry added for your plugin.
    If your orignal file was named "plugin proc name".asm, it will be overwritten.
    If you want to keep the original, I suggest using .txt or other extension.


8.  Files created automatically:
  a.  [Plugin Name].asm
  b.  [Plugin Name].bat
  c.  [Plugin Name].def
  d.  [Plugin Name].inc
  e.  [Plugin Name].dll


any .lib, .exp, .res, .obj files are deleted. You can reassemble using the .bat
file and removing the lines where those files are deleted if you need those files.




Back up your menus.ini file prior to using this product so if there are problems, you can reinstate the previous
menus.ini file. The Plugin Builder modifies your menus.ini file

P (https://www.dropbox.com/s/cdog6a1rk75jvv7/PluginBuilder5.zip?dl=1)lugin Builder v5.0.1 DLL only; for testing -- Bug Reports welcome!  ** on hold til further notice **

* (https://www.dropbox.com/s/htv1g24mrh9e48x/Plugin%20Builder%205_0_1.zip?dl=1)* on hold til further notice **

Test plugin procedure for use with the Plugin Builder. It removes empty lines from a source file.
Now included in the Plugin Builder version 5 Beta DLL download.

Code: [Select]



; The procedure has two arguments, src buffer addr, and dst buffer addr.
; the buffers will be provided by the plugin builder.
; this small procedure removes empty lines
; the code should be written as if those buffers are already present.
; the plugin builder always uses the same format for the plugins it can process
; procname, src, dst


    uncrlfz proc src:dword, dst:dword
        mov esi, src
        mov edi, dst
    tiptop:
        mov al, byte ptr [esi]
        cmp al, 0
        jz done
        .if word ptr [esi] == 0D0Dh
        add esi, 1
        jmp tiptop
        .endif       
        mov [edi], al
        inc esi
        inc edi
        jmp tiptop
    done:
        mov byte ptr [edi], 0
        ret
    uncrlfz endp
Title: Re: Automated Plugin Builder plugin for qe
Post by: dedndave on September 04, 2015, 04:33:45 PM
 :t
Title: Re: Automated Plugin Builder plugin for qe
Post by: hutch-- on September 04, 2015, 06:04:23 PM
Looks like it should work well Z. I wonder if anyone has noticed the plugin builder already installed in QE ? Its in the Code menu, "Create New QE Plugin". You can never make an editor that does what everyone wants and in part the design of QE with its various extension capacities is so folks who don't feel like writing their own editor from scratch can make custom capacities that suit their programming style or needs.

It will do simple templates that have no logic in them as plain text files, the later scripting engine can do far more complex things in terms of document and code output and the later plugin interface gives you specific control over inserting binary code.

I am pleased to see someone bothered to try the plugin interface as you can get it to do many useful things. You do need to have a reasonable "sniff" of how a Richedit2/3 DLL works but its no big deal to do most stuff.
Title: Re: Automated Plugin Builder plugin for qe
Post by: 0000 on September 04, 2015, 06:17:30 PM
I wonder if anyone has noticed the plugin builder already installed in QE ? Its in the Code menu, "Create New QE Plugin".

Oh yes, I have used that. But there was a time I had a couple dozen small functions for formatting and it was kind of time consuming compiling each one. That is where the idea came to make the process more automatic.

zedd

Title: Re: Automated Plugin Builder plugin for qe
Post by: 0000 on September 06, 2015, 01:10:03 PM
Here are a few example plugins for qe, built with the aid of the Plugin Builder if anyone is interested.

Mostly for formatting purposes.

There are 5 in this download:

1. First one aligns all the prototypes, and the .data, & .data? sections "DD", "DB", etc + "EQU"'s   -- for sloppy coders lol
2. second one places a space after each comma, if not already there.   --  looks better with the space, imo.
3. Third one removes both ";" and "comment * " style commenting.  --  I usually clean up the code from "examples" before I use it.
4. Fourth one removes double CrLfs.                                                 -- for those files with just too many empty lines
5. The last one replaces hard tabs with 4 spaces.                            -- for those pesky hard tabs

All of these were built with the PluginBuilder plugin.

enjoy.  :eusa_clap:

 plugin set 1  (https://www.dropbox.com/s/du97fxbvmviv3i2/zedds%2Bplugins%2Bset%2B1.zip?dl=1)


Title: Re: Automated Plugin Builder plugin for qe
Post by: 0000 on September 07, 2015, 05:58:24 AM
A couple more (I think useful) plugins for qeditor:

1. ASM Snippet Creator. Will make a sequentilly numbered 'snippet' from he text selected in qeditor.
    The snippets will have the '.asm' extension.
    The snippet will be created in the folder where the original source resides.

2. Text Snippet Creator. Similarlly will make a Text 'snippet', but with the '.txt' extension, the extension
    required for use with the Plugin Builder stand-alone version.

Title: Re: Automated Plugin Builder plugin for qe
Post by: 0000 on September 07, 2015, 11:35:36 PM
A couple more plugins:

1. Masm reserved words to Lower Case. <--- the way I like it.

2. Masm reserved words to Upper Case. <--- some prefer it this way.

All masm reserved words plus cpu/fpu instructions, and registers are included in two

lists external from the plugins that may be modified.

All of the plugin sets that I have posted in this thread have ready-to-use plugins + source

Attachment removed as it is no longer needed. A link to the entire plugin collection is in my signature.
Title: Re: Automated Plugin Builder plugin for qe
Post by: 0000 on September 08, 2015, 06:30:54 AM
I won't be posting any more plugin sets on in this thread. However I have a link in my signature

with the latest Plugin Collection, that will include all plugin sets to date. Currently there are 3

Plugin sets as described in the above posts. If I come up with a very innovative plugin I will

post it to a new thread. Otherwise the more basic plugins will simply be added to the

Plugin Collection available at the link in my signature. So check it from time to time.  :t

edit ==

Note: I have had trouble downloading the files (ln my sig)  with InternetDownloadManager,

but the files download ok with it turned off. So if down load fails, don't use a download manager

firefox, IE, etc should download without any problems
Title: Re: Automated Plugin Builder plugin for qe
Post by: 0000 on September 08, 2015, 02:00:33 PM
    One of the original 'Testbeds' I created for testing my plugins. lol
It's an incomplete work, to be sure, and it has few features.

    What it does have is highlighting for the search and replace functions.
Search for a word, it gets highlighted when found. Replace a word,
you guessed it, it gets highlighted. The menus do not work, except
for "Build", but the toolbar buttons do, except for 'New File'.
I thought I had scrapped this little project (meant to) but I found it
today and thought I might post it as it has a couple of good examples
in it. It does lack commenting. Sorry about that, but you're a smart
bunch.

    I may have to look back into it, comment it properly, and rearrange
the procedures better. Right now they are a hodge-podge in at least one
file. The original sources were borrowed from the 'riched' example, and
one of iczelions tuts, I forget which one 33, 34 or 35. But some of the
procs were *slightly* modifed (I should have commented the changes)
and others are completely original work. I guess I will definitely have to
go back and comment everything.
 

From post below:

FWIW ...

Looks like you use notepad, or similar, and then copy-paste it here. If so, turn off wordwrap b4 u copy it to make a nice-looking paragraph


 Zedds Editor  (https://www.dropbox.com/s/7v9oj2cv70sc8p3/Zedds%2BEd.zip?dl=1)
Title: Re: Automated Plugin Builder plugin for qe
Post by: rrr314159 on September 09, 2015, 03:11:53 AM
FWIW ...

Looks like you use notepad, or similar, and then copy-paste it here. If so, turn off wordwrap b4 u copy it to make a nice-looking paragraph
Title: Re: Automated Plugin Builder plugin for qe
Post by: 0000 on September 09, 2015, 04:31:11 AM
To rrr314159:


See my post above yours.  :greenclp:

I have a bad habit of double spacing my lines, it's easier for me to read that way.
Title: Re: Automated Plugin Builder plugin for qe
Post by: rrr314159 on September 09, 2015, 01:28:56 PM
Hey, to each their own! I once had the problem I mentioned so thought maybe you did too, but as long as you're doing it on purpose ... who's going to argue with "The PlugIn King"?? :biggrin:
Title: Re: Automated Plugin Builder plugin for qe
Post by: 0000 on September 09, 2015, 01:42:45 PM
Damn wrong button. - hit the notify instead of reply :shock:  :eusa_naughty:

Quote
who's going to argue with "The PlugIn King"?....


Now that was funny! The trouble with old farts like me is we get stuck in the same habiits.
Title: Re: Automated Plugin Builder plugin for qe
Post by: 0000 on September 09, 2015, 05:35:58 PM
    qeditor is very good at what it does, and it has many good features. There
are times however, that the need arises for customized features that are just not
present in qeditor, or its selection of built-in plugins. Scripting is like
learning a new language. It would indeed handle such needs, but for folks like
myself, it just isn't their cup of tea.

    Enter the qeditor plugin interface. It was I believe, designed to handle such
needs. However, to the newcomer, it's operation is not very straightforward. I
myself had a hard time creating my first few plugins. Of course, I thought that
they were brilliant, and unique. But one major flaw - they only worked part of the
time, and only with short texts. It took days to figure out why. I'm not big on
reading instructions - lol. But olly had helped me find the errors. That
is when I decided to embark on a mission to even further simplify the process.

    Most of you have already seen my 'Automated Plugin Builder', and the
subsequent plugin version (that was actually used to create itself). The following
are the templates that I had used before I started the "Automated" builders.

    Some of the old-timers may roll their eyes, but I present the templates that
served me well - for the newcomers that may wish to experiment creating their own
plugins without much hassle. They are an expansion by what is offered already in the
masm32 package.

(A version for the 'Legacy interface is attached as well) - I wanted to post both versions, but reached the character limit.

For the newer qeditor plugin interface:

Code: [Select]
        include \masm32\include\masm32rt.inc

        ; built-in plugin interface - *slightly* modified as we will deal
        ; mainly with the richedit control here
       
        PiEntryPoint    proto :dword

        ; my own interface to further simplify
        ; the creation of plugins for qe.
       
        CallPlugin      proto :dword ; ( arg = ptrPlugin:dword )
       
        ; The Plugin ; ( args = src:lpRichEdSelectedText, dst:lpModifiedText )
       
        plugin          proto :dword, :dword 
       
        ; some string handling functions, that
        ; preserve all registers except for eax
       
        zstcmpiz        proto :dword, :dword
        zstrcatz        proto :dword, :dword
        zstrclrz        proto :dword
        zstrcpyz        proto :dword, :dword
        zstrlenz        proto :dword
       
    .data?
   
        DLLinstance     dd ?    ; local DLL instance handle
        hRichEd         dd ?    ; handle to rich edit control in qeditor

    .code

    PiEntryPoint proc QEinterface:DWORD
    LOCAL Cr:CHARRANGE
   
        push 2                  ; The handle to the rich edit control
        call QEinterface        ; is the second (zero based) member
        mov hRichEd, eax        ; in the array 'QEinterface'
       
        ; =====================================================================
        ; The 'CallPlugin' procedure handles memory the allocation and releasing
        ; of memory, as well as getting the selected text prior to operation
        ; and replacing the selection with the text modified by the plugin
        ; =====================================================================

        invoke CallPlugin, addr plugin ; doing it in this fashion allows
                                       ; for running multiple plugins
                                       ; from one interface at the same time
                                       
      ; invoke CallPlugin, addr plugin2 ; not used, for illustrative purposes
      ; invoke CallPlugin, addr plugin3 ; not used, for illustrative purposes
      ; invoke CallPlugin, addr plugin4 ; not used, for illustrative purposes
     

        ; =====================================================================
        ; That is all there is to it! (Setting up the plugin, that is)
        ; The 'CallPlugin' procedure does most of the work.
        ; The plugin itself is up to you to design.
        ; =====================================================================
       

        ; =====================================================================
        ;                           IMPORTANT NOTE!
        ; =====================================================================
        ; When dealing with the text from qeditor each line is terminated only
        ; by  "0Dh"; expecting there to be an accompanying "0Ah" will lead to
        ; errors, and will eventually crash qeditor.
        ;=====================================================================

        @@:
        ret
    PiEntryPoint endp
   
    ;--- actual plugin handler ---------------------------------------------

    CallPlugin proc ptrPlugin:dword
    local tmpbuf:dword, Cr:CHARRANGE, tmpsize:dword, selsize:dword
    local tmpbuf2:dword, pluginx:dword

        ; put the address of the plugin into a variable
        mov eax, ptrPlugin
        mov pluginx, eax   

        ; get the start and end position of the selected text
        ; put those vales into a 'CHARRANGE' structure
        invoke SendMessage, hRichEd, EM_EXGETSEL, 0, ADDR Cr
        mov eax, Cr.cpMin
        mov edx, Cr.cpMax
       
        sub edx, eax        ; compare the end position to the start position
        jz nosel            ; which is checking if text is actually selected
        mov selsize, edx
        mov tmpsize, edx
       
        invoke GlobalAlloc, GPTR, tmpsize ; allocate input buffer
        mov tmpbuf, eax
       
        ; doubling the size of the output buffer, to ensure
        ; that there is ample memory.
        ; Often needed for plugins of this type, that manipulate
        ; the text in the editor.
       
        mov edx, tmpsize
        shl edx, 1   
                     
        invoke GlobalAlloc, GPTR, edx ; allocate output buffer
        mov tmpbuf2, eax
       
        ; put selection into input buffer
        invoke SendMessage, hRichEd, EM_GETSELTEXT, 0, tmpbuf
       
        push tmpbuf2        ; push offset to OUTPUT buffer
        push tmpbuf         ; push offset to INPUT buffer
        call pluginx        ; call the plugin

        ;---------------------------------------------------------
        ; replace the selected text in qeditor with the modified
        ; text from the output buffer
        ;---------------------------------------------------------
       
        invoke SendMessage, hRichEd, EM_REPLACESEL, 1, tmpbuf2
       
        invoke zstrlenz, tmpbuf2 ; obtain length of modified text
        mov tmpsize, eax
       
        mov eax, Cr.cpMin   ; add text length to the start
        add eax, tmpsize    ; position to obtain end position
                       
        mov Cr.cpMax, eax   ; adjust the end position of the selection
                            ; by resetting the cpMax value in the structure 'Cr'

        ;---------------------------------------------------------
        ; Update the selection in the rich edit control
        ;---------------------------------------------------------
                               
        invoke SendMessage, hRichEd, EM_EXSETSEL, 0, ADDR Cr

        ;---------------------------------------------------------
        ; Free the input and output memory blocks
        ;---------------------------------------------------------
       
        invoke GlobalFree, tmpbuf
        invoke GlobalFree, tmpbuf2
        jmp done
        nosel:
        fn MessageBoxA, 0, "Sorry, no text is selected", 0, 0
        done:
        ret
    CallPlugin endp


    ; ===================================================================
    ;
    ; example plugin - it removes duplicate spaces from the selected text
    ;
    ; ====================================================================


    plugin proc src:dword, dst:dword
        push esi
        push edi
        mov esi, src
        mov edi, dst
        top:
        @@:
        mov eax, [esi]
        cmp al, 0
        jz done
        cmp al, 20h
        jnz @f
        cmp ax, 2020h
        jnz @f
        inc esi
        jmp @b
        @@:
        mov [edi], al
        inc edi
        inc esi
        jmp top
        done:
        pop edi
        pop esi
        ret
    plugin endp


    zstrcatz proc dst:dword, subs:dword     ; works like lstrcat
        push esi
        push edi
        xor eax, eax
        invoke zstrlenz, dst
        mov edi, dst
        add edi, eax
        invoke zstrcpyz, edi, subs
        mov eax, dst
        pop edi
        pop esi
        ret
    zstrcatz endp

    zstrcpyz proc dst:dword, subs:dword     ; works like lstrcpy
        push esi
        push edi
        mov esi, subs
        mov edi, dst
        xor eax, eax
        @@:
        mov al, [esi]
        cmp al, 0
        jz @f
        mov [edi], al
        inc esi
        inc edi
        jmp @b
        @@:
        invoke zstrclrz, edi
        mov eax, dst
        pop edi
        pop esi
        ret
    zstrcpyz endp

    zstrclrz proc src:dword   ; zeros a buffer containing a zero term. string
        mov eax, src
        push eax
        @@:
        cmp byte ptr [eax], 0
        jz @f
        mov byte ptr [eax], 0
        inc eax
        jmp @b
        @@:
        pop eax
        ret
    zstrclrz endp

    zstrlenz proc src:dword                 ; works the same as lstrlen
        push esi
        push ecx
        mov esi, src
        xor eax, eax
        @@:
        mov cl, [esi]
        cmp cl, 0
        jz @f
        inc eax
        inc esi
        jmp @b
        @@:
        pop ecx
        pop esi
        ret
    zstrlenz endp

    .data
        ztbl \
        db 0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15
        db 16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31
        db 32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47
        db 48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63
        db 64,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111
        db 112,113,114,115,116,117,118,119,120,121,122,91,92,93,94,95
        db 96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111
        db 112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127
        db 128 dup (0FFh)

    .code
   
    ;----------------- case insensitive string cmp routine -------------------

    zstcmpiz proc src:DWORD, dst:DWORD
        push esi
        push edi
        push ebx
        push edx
        push ecx
        mov esi, src
        mov edi, dst
        xor eax, eax
        @@:
        movzx edx, byte ptr [esi+eax]
        movzx ebx, byte ptr [edi+eax]
        movzx ecx, byte ptr [edx+ztbl]
        add eax, 1
        cmp cl, [ebx+ztbl]
        jne quit
        cmp edx, 0
        jz @f
        cmp ebx, 0
        jz @f
        jmp @b
        @@:
        sub eax, eax
        quit:
        pop ecx
        pop edx
        pop ebx
        pop edi
        pop esi
        ret
    zstcmpiz endp

    LibMain proc instance:dword,reason:dword,unused:dword
        switch reason
        case DLL_PROCESS_ATTACH
        mrm DLLinstance,instance
        mov eax, TRUE
        endsw
        ret
    LibMain endp
   
    end LibMain

edit = found an error in the 'legacy' source - fixed



 legacy plugin interface Download  (https://www.dropbox.com/s/oshy3n6hzylnznq/legacy%20plug.zip?dl=1)


 new plugin interface Download  (https://www.dropbox.com/s/qzec471lazgy6o0/new%20plug.zip?dl=1)

Title: Re: Automated Plugin Builder plugin for qe
Post by: 0000 on September 14, 2015, 08:19:42 PM
A quick little plugin

cmtBlock is a plugin for those that prefer
Code: [Select]
    comment * ##################################################################
        your comment here
        your comment here
        your comment here
        your comment here
        your comment here
    ########################################################################## *

style block commenting.

I have not added it to the 'Plugin Collection' as I am waiting to do a few more plugins before I do so.


 CmtBlock Plugin Download  (https://www.dropbox.com/s/o0fmun4wu50fxf0/cmtBlock_.zip?dl=1)
Title: Re: Automated Plugin Builder plugin for qe
Post by: 0000 on September 21, 2015, 10:31:12 PM
Code: [Select]
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;                                                                        ;;
;;  boxcmt is a plugin for qeditor that creates a boxed in style comment  ;;
;;  from the text selected in qeditor. Example:                           ;;
;;                                                                        ;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

------- snippet --------
this is a test comment
------ end snippet -----
will become
Code: [Select]
------- snippet --------
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;                          ;;
;;  this is a test comment  ;;
;;                          ;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
------ end snippet -----
after being processed by the plugin.


It features the ability to handle tabs (replaces with 4 spaces).

It creates, as you can see, a border around the selected text

with extra space at the top bottom and sides for extra emphasis.



zedd



 Box Comment Final  (https://www.dropbox.com/s/g88nnl8g8gezh50/BoxComment_3_final.zip?dl=1)
Title: Full Source for Box Comment plugin
Post by: 0000 on September 22, 2015, 07:49:57 AM
Had to remove the 'Box Comment' plugin. There were some serious flaws in it somewhere.

I think the problem was the rich edit control itself. Because I reworked the box comment procedure,
to modify text files as large as 10MB, then write the result to file. Changed the memory management
to calculate required output buffer size by using the number of lines to be printed times the length
of the longest line, plus the overhead for writing the box style border itself. I checked and rechecked
the source code. When printing to file it works fine. (and using 13,10 as line terminator)

But when I rebuild the plugin, it works okay once (sometimes) but crashes qeditor after multiple uses.
I checked and double checked that all memory used, including the tokenizer array memory has been
properly freed.

I am still working on it and will post either a working version, or the results of the full rebuild.
Title: Re: Automated Plugin Builder plugin for qe
Post by: 0000 on September 23, 2015, 09:06:49 PM
Okay. I have written a little test piece, to test the Box Comment procedures.
It reads 'windows.inc' (what else??) and writes back to a file 'TestBoxComment.txt'

The methods used are all okay, and working properly in this test piece.

Now to transfer it to a (hopefully) working plugin.

Anyway, here is the test piece for the 'Box Comment' procedures...

btw, windows.inc (masm32 sdk version 10) expands to a little over 6 MB with the
formatted box around it  :shock:

One thing about BoxComment:
It does not retain the formatting of the original, I think this is due to
the tokenizer used. It removes leading spaces, and empty lines.
I might have to roll my own.  8)

Removed attachment as it is no longer needed.
Title: Rewrite of BoxComment
Post by: 0000 on September 23, 2015, 10:27:22 PM
Another total rewrite of the 'BoxComment' plugin.

After thorough testing with the testbed posted above, I am 99.9% certain that the problems
are not due to the plugin procedures.

Here I have written from scratch (again) two versions of the 'Box Comment' plugin.
They both work fine for one or two times. Usually on the third round, qeditor crashes.

Thinking that changing to the other plugin interface might change matters, I wrote
a plugin using that interface.


Title: Re: Automated Plugin Builder plugin for qe
Post by: 0000 on September 23, 2015, 10:35:07 PM
.... continuation of above post

version 2 coded with the newer plugin interface

Code: [Select]

 

If you download and tried to use the attached plugins

YOU ARE USING THEM AT YOUR OWN RISK!
See above three posts regarding the still unfound bugs!

Attachments removed as they are no longer needed - this particular bug has been fixed.
Title: Box Comment plugin - Fixed!!
Post by: 0000 on September 25, 2015, 12:50:26 AM
Box Comment plugin - Fixed!!

I found the bug that was plaguing this plugin.

It was not my code, or the plugin interface or qeditor itself.

It was the tokenizer.

I knew that the tokenizer in masm32.lib was inadequate for the purposes of this
plugin. It removes leading spaces and empty lines. Thereby discarding all formatting.

So, I wrote a tokenizer that retained the leading spaces and empty lines.

After many test runs with the custom tokenizer, I can safely say that this
plugin is now 99.5% bug-free (still .5% doubt, as many things can go awry).

I have even Box commented large files such as windows.inc (favorite guinea pig)
and no problems.

Also I reinstated the UNDO feature for this plugin.




Attachment removed as it is no longer needed.
The final version of 'Box Comment' qe plugin is attached two posts down
Source code included in that attachment


Box Comment Final  (https://www.dropbox.com/s/g88nnl8g8gezh50/BoxComment_3_final.zip?dl=1)
Title: Re: Automated Plugin Builder plugin for qe
Post by: hutch-- on September 25, 2015, 01:48:30 AM
Z,

Here is a tokeniser that does not strip leading white space or empty lines. Its in its own test piece.


; ¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤
                    include \masm32\include\masm32rt.inc
; ¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤

comment * -----------------------------------------------------
                        Build this  template with
                       "CONSOLE ASSEMBLE AND LINK"
        ----------------------------------------------------- *

    line_tokeniser PROTO :DWORD
    get_lcnt       PROTO :DWORD

    .data
      caesar \
      db "Friends, Romans, countrymen, lend me your ears;",13,10
      db "    I come to bury Caesar, not to praise him.",13,10,13,10
      db "    The evil that men do lives after them;",13,10
      db "The good is oft interred with their bones;",13,10,0

      ptxt dd caesar

    .code

start:
   
; ¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤

    call main
    print chr$(13,10)
    inkey "Thats all folks, press a key to exit..."
    exit

; ¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤

main proc

    LOCAL pMem  :DWORD
    LOCAL lcnt  :DWORD

    mov pMem, rv(line_tokeniser,ptxt)   ; tokenise text
    mov lcnt, ecx                       ; save the line count

    push esi
    push edi

    mov esi, pMem                       ; load array into ESI
    mov edi, lcnt                       ; use EDI as the counter

  @@:
    print [esi],13,10                   ; display each line of text
    add esi, 4                          ; increment to next pointer
    sub edi, 1                          ; dec the counter
    jnz @B                              ; loop back if not zero

    pop edi
    pop esi

    free pMem                           ; release memory from tokeniser

    ret

main endp

; ¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤

line_tokeniser proc src:DWORD

  ; ---------------------------------------------------
  ; tokeniser for CRLF delimited text
  ; ---------------------------------------------------
  ; replaces the ascii 13 with zero and writes apointer
  ; to the allocated memory as an array of pointers
  ; return value in EAX = pointer array address
  ; return value in ECX = the line count
  ; array address must be de-allocated using
  ; GlobalFree() or the macro "free".
  ; ---------------------------------------------------

    LOCAL lcnt :DWORD
    LOCAL pMem :DWORD
    LOCAL alen :DWORD

    push src
    call get_lcnt               ; get the line count
    mov lcnt, eax               ; store line count in variable
    lea eax, [eax*4]            ; set pointer array length
    mov alen, eax               ; store the array size in alen

    mov pMem, alloc(alen)       ; allocate the pointer array

    mov edx, src                ; source address in ESI
    mov ecx, pMem               ; pointer array address in EBX

    mov [ecx], edx              ; load array address into 1st member of array
    add ecx, 4
    sub edx, 1

  lbl1:
    add edx, 1
    movzx eax, BYTE PTR [edx]   ; zero extend byte into EAX
    test eax, eax               ; test for zero
    jz lbl2                     ; exit loop on zero
    cmp eax, 13                 ; test for ascii 13
    jne lbl1                    ; short loop back if not 13

    mov BYTE PTR [edx], 0       ; write terminator at ascii 13 location
    add edx, 2                  ; step over ascii 13 and 10
    mov [ecx], edx              ; write the next line start to pointer
    add ecx, 4                  ; increment to next pointer
    jmp lbl1                    ; long loop after writing pointer

  lbl2:
    mov ecx, lcnt               ; return the line count in ECX
    mov eax, pMem               ; the array pointer in EAX

    ret

line_tokeniser endp

; ¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤

OPTION PROLOGUE:NONE
OPTION EPILOGUE:NONE

get_lcnt proc src:DWORD

  ; --------------------------------------
  ; count ascii 13 to determine line count
  ; --------------------------------------
    mov edx, [esp+4]                    ; the source address
    sub edx, 1
    xor eax, eax
    jmp lbl1

  pre:
    add eax, 1                          ; increment the counter
  lbl1:
  ; -----------
  ; unroll by 4
  ; -----------
    add edx, 1
    movzx ecx, BYTE PTR [edx]
    cmp ecx, 13
    je pre
    test ecx, ecx
    jz lbl2

    add edx, 1
    movzx ecx, BYTE PTR [edx]
    cmp ecx, 13
    je pre
    test ecx, ecx
    jz lbl2

    add edx, 1
    movzx ecx, BYTE PTR [edx]
    cmp ecx, 13
    je pre
    test ecx, ecx
    jz lbl2

    add edx, 1
    movzx ecx, BYTE PTR [edx]
    cmp ecx, 13
    je pre
    test ecx, ecx
    jnz lbl1

  lbl2:
    ret 4

get_lcnt endp

OPTION PROLOGUE:PrologueDef
OPTION EPILOGUE:EpilogueDef

; ¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤

end start

Title: Re: Automated Plugin Builder plugin for qe
Post by: 0000 on September 25, 2015, 01:56:54 AM
hi hutch. Yes I have seen that elsewhere in the forum.

I should add that to one of my libraries. How does it time compared to masm32.lib ltok?


Later... I made the line counter faster :)

modified get_lcnt
195
195
195
195
195
195
195
195
195
196

hutch get_lcnt
222
221
221
222
222
223
224
223
223
224


modified get_lcnt :biggrin:


Code: [Select]
align 16
nop
nop ; ----------------------------------; padding to align inner loop
OPTION PROLOGUE:NONE
OPTION EPILOGUE:NONE

z_lcnt proc src:DWORD
  ; --------------------------------------
  ; count ascii 13 to determine line count
  ; --------------------------------------
    mov edx, [esp+4]                    ; the source address
    sub edx, 1
    xor eax, eax
    jmp lbl1
pre:
    add eax, 1                          ; increment the counter
lbl1:                                   ; innermost loop align to 16
    repeat 7 ; as long as the longest jump is less than 80 bytes --> unroll more :)
    add edx, 1
    movzx ecx, BYTE PTR [edx]
    cmp ecx, 13
    je pre
    test ecx, ecx
    jz lbl2
    endm
    add edx, 1
    movzx ecx, BYTE PTR [edx]
    cmp ecx, 13
    je pre
    test ecx, ecx
    jnz lbl1
  lbl2:
    ret 4
z_lcnt endp
OPTION PROLOGUE:PrologueDef
OPTION EPILOGUE:EpilogueDef



Title: Re: Automated Plugin Builder plugin for qe
Post by: 0000 on September 25, 2015, 04:56:13 AM
The Box Comment plugin is now finished.


It properly retains all formatting.

Code: [Select]
    ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
    ;;                               ;;
    ;;      ;;;;;;;;;;;;;;;;;;;      ;;
    ;;      ;;               ;;      ;;
    ;;  ;;;;;;;;;;;;;;;;;;;;;;;;;;;  ;;
    ;;  ;;                       ;;  ;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;                                       ;;
;;  ;;  ;;  ;;  hello world  ;;  ;;  ;;  ;;
;;                                       ;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
    ;;  ;;                       ;;  ;;
    ;;  ;;;;;;;;;;;;;;;;;;;;;;;;;;;  ;;
    ;;      ;;               ;;      ;;
    ;;      ;;;;;;;;;;;;;;;;;;;      ;;
    ;;                               ;;
    ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
   8)




 Box Comment Final  (https://www.dropbox.com/s/g88nnl8g8gezh50/BoxComment_3_final.zip?dl=1)
Title: Re: Automated Plugin Builder plugin for qe
Post by: 0000 on September 25, 2015, 07:00:42 AM
I plan a major rewrite of the Plugin Builder. It will offer the user more options when creating a new plugin. Right now, the PB (PluginBuilder) automatically copies the plugin into a folder named
'plugins' in masm32s' directory. Also it automatically creates an entry in the 'menus.ini. file.

Those options will still be present, plus I wll give the option to also not copy the plugin to the plugins folder, or to copy it to somewhere else. Also, the PB will detect which drive(s) you have masm32 installed on - then ask which installation should receive the plugin, and menu entry.

Also certain internal features will be completely rebuilt. I will ensure that the new PluginBuilder is compatible with existing plugin snippets.

It will just take some tome to get everything together and working well enough to post it.

zedd.

Title: Re: Automated Plugin Builder plugin for qe
Post by: 0000 on April 15, 2018, 02:43:58 AM
Just dusting the cobwebs off to ask  thread pertinent question...

I admit I hadn't kept up with the latest developments with Masm64 and/or QE64

Is there still plugin capability in QE for 64 bits ???
hutch??

zedd

Keeping in mind I dont have the capability to download and see masm64 for myself (no ' puter just yet)
Just want to know for when that time comes.   :bgrin:
Title: Re: Automated Plugin Builder plugin for qe
Post by: 0000 on April 19, 2018, 02:25:02 AM
Just answered my own question by downloading and looking through the 64 bit SDK.  Sadly, no plugins folder and therefore no plugin support.   :(

Possible to be added in the future? hutch--??
Title: Re: Automated Plugin Builder plugin for qe
Post by: hutch-- on April 19, 2018, 03:10:16 AM
Z,

QE is a 32 bit MASM app, just use the normal plugin design.
Title: Re: Automated Plugin Builder plugin for qe
Post by: 0000 on May 27, 2018, 07:39:31 PM
I am currently working on a rewrite for my Plugin Builder DLL. The reason for this is that it crashed QE last week.   :shock:
Not 100% sure if it was the builder or the plugin itself.  But I decided to make a more modern version of the plugin builder.

Found there was a slight bug in the design that apparently hadn't presented itself until recently.


Also,  I plan on recreating some of my lost plugins - for which I no longer have the sources for. I have a general idea for about a dozen of them.  But as it was almost three years ago,  the new plugins may or may not function as the originals.

If anyone has any of the plugin sets (other than currently attached in this thread)  I would appreciate if you could get in contact with me by PM.  I used to have a link in my signature to the hosting site,  and can no longer retrieve my works. IIRC,  there were
4 plugin sets in total.  Probably in the range of 25 - 30 plugins.
Title: Re: Automated Plugin Builder plugin for qe
Post by: 0000 on July 21, 2018, 01:05:30 PM
I am currently trying to track down the bug that is plaguing the PluginBuilder DLL. If I cannot find and fix it, a brand new version will be coming soon.


It will be much the same style, select the code you wish to transform into a plugin, and the PluginBuilder will automatically create your plugin and all plugin project files, then copy the plugin to the masm32 plugins folder, and write a 'menus.ini' entry for the newly created plugin.


The old PluginBulder version 4 still works (does everything advertised), but crashes QE just before exit.  :(


I wonder what version of QE I originally designed the PluginBuilder for. It was only three years ago, but I may not have had the same QE version then as I do now.
Title: Re: Automated Plugin Builder plugin for qe
Post by: hutch-- on July 21, 2018, 01:33:25 PM
Z,

Its the same core since it was written and the plugin handling has not changed since it was written. Just make sure that the plugin DLL is written properly and releases any resources before exit.
Title: Re: Automated Plugin Builder plugin for qe
Post by: 0000 on July 21, 2018, 02:16:50 PM

...Just make sure that the plugin DLL is written properly and releases any resources before exit....



Most of the plugins I have written work flawlessly, just the PluginBuilder is giving me problems where I have not encountered previously. I have tried to track the bug but can't locate the exact reason for the crashing of QE. And reading 3 year old code with sparse comments is no joy.


I will most likely either start from scratch, or abandon the project.
Title: Re: Automated Plugin Builder plugin for qe
Post by: 0000 on July 21, 2018, 04:05:50 PM

I found it!   ::)
I was missing a simple return;   :redface:

also was not closing the dialog box.  :icon_redface:
There are other things that were done that I do not understand why I did them before, so I am rewriting portions of the code.  :shock:


A test version of the Plugin Builder is linked on the first post. DLL only at this time until I am sure I have all of the bugs worked out.
A sample procedure for use with the Plugin Builder is also linked in the first post.


Bug reports welcome.
Title: Re: Automated Plugin Builder plugin for qe
Post by: 0000 on July 22, 2018, 07:01:40 PM
I have trimmed the code for the Plugin Builder, and fixed a few minor bugs.
 
The latest version, 5.0.1 is linked in the first post of this thread.
 
Questions, comments, bug reports welcome; criticism and other flack are unavoidable.  :P
Title: Re: Automated Plugin Builder plugin for qe
Post by: HSE on July 23, 2018, 01:43:46 AM
Code: [Select]
Plugin4 Zed, {e}\plugins\plug4\plugin4.dll[Plugins]
aaa test, {e}\plugins\aaa.dll
[help]
Plugin Builder,{e}\plugins\PluginBuilder.dll
[&Help]

Quick Editor Help,{e}\help\qeditor.chm
-

After that, a very nice crash
Title: Re: Automated Plugin Builder plugin for qe
Post by: 0000 on July 23, 2018, 03:51:01 AM

After that, a very nice crash

Sorry to hear that you are having problems.
Exactly what steps did you take?


Was it one of my plugin examples, or one of your design?
I need more specific information to determine where there is a problem.
Title: Re: Automated Plugin Builder plugin for qe
Post by: HSE on July 23, 2018, 05:16:05 AM
Sorry to hear that you are having problems.
:biggrin:  I don't have problems. It's your development what have problems.

Code: [Select]
Address   Hex dump          Command                             
77345D58  |.  8955 98       MOV DWORD PTR SS:[EBP-68],EDX
77345D5B  |.  8B12          MOV EDX,DWORD PTR DS:[EDX]        <<<<<
77345D5D  |.  8B7F 04       MOV EDI,DWORD PTR DS:[EDI+4]


My sophisticated test it's not builded:
Code: [Select]
aaa proc
       ret
aaa endp

But crash of the examples perhaps is because you expect your menu.ini. Default it's [&Help].
Title: Re: Automated Plugin Builder plugin for qe
Post by: 0000 on July 23, 2018, 05:32:09 AM

But crash of the examples perhaps is because you expect your menu.ini. Default it's [&Help].


I beg to differ, at least with the current masm32 {masm32v11r} download. I checked just now and this is the menus.ini that the installation of masm32 creates:


Code: [Select]

[&Project]
Compile &Resource File,\MASM32\BIN\Bres.bat "{b}"
&Assemble ASM file,\MASM32\BIN\Assmbl.bat "{b}"
-
&Link OBJ File,\MASM32\BIN\Lnk.bat "{b}"
As&semble && Link,\MASM32\BIN\Build.bat "{b}"
&Build All,\MASM32\BIN\Bldall.bat "{b}"
-
&Makeit.bat,makeit.bat "{b}"
-
Console Link &OBJ File,\MASM32\BIN\Lnkc.bat "{b}"
&Console Assemble && Link,\MASM32\BIN\Buildc.bat "{b}"
Console Build &All,\MASM32\BIN\Bldallc.bat "{b}"
-
&Run Program,"{b}.exe"


[&Tools]
; -----------------------------
; put you resource editor here
; -----------------------------
&Microsoft Image Editor,\MASM32\BIN\Imagedit.exe
Microsoft &Zoomin Utility,\masm32\bin\zoomin.exe
-
&TopGun Wordwrap Editor,{e}topgun.exe
Run Unicode Text Editor,{e}\uniedit.exe
-
Select RGB color,{e}\cpicker.exe
Get Color From Screen,{e}\getcolor.exe
-
&Procedure Browser,\MASM32\qetb.exe \MASM32\procs
Browse MASM32 &Lib,\masm32\qetb.exe \masm32\m32lib
-
Map App &Procedures,{e}procmap.exe {e}qeditor.exe
-
&Hex to Mnemonic,\MASM32\Mnemonix.exe
&MASM32 Folder,\MASM32\Shellex.exe \masm32
-
Load Binary File As Hex,{e}\plugins\bin2hex.dll
Save Hex File As Binary,{e}\plugins\hex2bin.dll
-
Righ Trim Block,{e}\plugins\rtrim.dll
-
Block Insert,{e}\plugins\blockp.dll
-
&Dis-assemble EXE file,\MASM32\BIN\dasm.bat "{b}.exe"
Dis-&assemble DLL,\masm32\BIN\Dasmd.bat "{b}.dll"
Format DumpPE Output,{e}\plugins\fdpe.dll
-
&Indent .IF Block,{e}\plugins\Indentb.dll
Swap 32 bit registers,{e}\plugins\regswap.dll
-
Block &C++ Comment,{e}\plugins\cblockc.dll
Block &ASM Comment,{e}\plugins\ablockc.dll


[&Code]
Create New GUI Application,{e}\cg.exe
Create New Console Application,{e}\script\console.qse
Create New &DLL,{e}\script\dll.qse
Create New Library Module,{e}\script\libmod.qse
Create New QE Plugin,{e}\script\plugin.qse
-
Create New Control Subclass,\MASM32\subclass.exe
Convert Any File To An Object Module,{e}\fda32.exe
-
Create New Jump Table,{e}\tproc.exe
Create New Word List Jump Table,{e}\jtmake.exe
Create New Character Table,{e}\maketbl.exe
Create Mangled Text,{e}\mangle.exe
-
&RC Menu to .IF asm code,\masm32\Mnutoasm.exe
-
Small &Algo Testbed,\masm32\Testbed.qsc
Large Algo Testbed,\masm32\bigtstbd.qsc
-
Dialog &Template,\MASM32\dlgproc.qsc
Add In &Dialog,\MASM32\dlgtmplt.qsc
-
Create bld&lib.bat,\masm32\Libbat.qsc
-
Create a Resource Dialog,{e}\script\makedlg.qse
Create a Resizable Window,{e}\script\makewin.qse
-
Fast Insert Dialog Template,{e}\text\blankdlg.txt
Fast Insert Console Template,{e}\text\contemp.txt


[Conversions]
Text to DW UNICODE,multitool.exe 1
Text to API UNICODE,multitool.exe 2
-
Text to DATA,{e}\multitool.exe 3
Text to Compacted DB Format,{e}\multitool.exe 4
Text to HEX Format,{e}\multitool.exe 5
-
Binary to Compacted DB Format,{e}\bin2dbex.exe 1
Binary to HEX DB Format,{e}\bin2dbex.exe 2


[Scr&ipt]
Convert Text to Script,{e}\plugins\txt2qse.dll
Convert Binary to Script,{e}\plugins\bin2qse.dll
-
Debug MsgBox,{e}\text\dbmsgbox.txt
MessageBox,{e}\text\msgbox.txt
Last Error MessageBox,{e}\text\lasterr.txt
Debug Print,{e}\text\dbprint.txt
-
&Create EXE makeit.bat,\masm32\Bldmakit.qsc
&Create CONSOLE makeit.bat,\masm32\makecon.qsc
Create Sample &RC file,{e}\text\samplerc.txt
Insert MANIFEST XML File,{e}\text\xmlfile.txt
Insert RC Version Control Block,{e}\text\rcversion.txt
-
Insert switch$ Block,{e}\text\switch$.txt
Insert Normal switch Block,{e}\text\switch.txt
-
Insert __UNICODE__ equate,{e}\text\unicode.txt
-
Insert Prologue Code,{e}\text\prolog.txt
Insert Epilogue Code,{e}\text\epilog.txt
-
Push 3 regs,{e}\text\push3.txt
Pop 3 regs,{e}\text\pop3.txt
-
3 nops,{e}\text\nops3.txt
-
Comment&0 «««««,{e}\text\comment0.txt
Comment&1 ¤¤¤¤¤,{e}\text\comment1.txt
Comment&2 ¤=÷=¤,{e}\text\comment2.txt
Comment&3 ÷·÷·÷,{e}\text\comment3.txt
Comment&4 ÷-÷-÷,{e}\text\comment4.txt
Comment&5 ¤*¤*¤,{e}\text\comment5.txt
Comment&6 ¤÷¤÷¤,{e}\text\comment6.txt
Comment&7 -----,{e}\text\comment7.txt
Comment&8 »»»»»,{e}\text\comment8.txt


[help]
Quick Editor Help,{e}\help\qeditor.chm
-
&MASM32 Help,{e}\HELP\masm32.chm
High Level Macro Help,{e}\help\hlhelp.chm
MASM32 &Library Reference,{e}\HELP\Masmlib.chm
MASM32 Dialog Help,{e}\HELP\imdialog.chm
&FPU Lib Help,{e}\HELP\Fpuhelp.chm
Date Time Reference,{e}\HELP\datetime.chm
-
&Opcodes Help,{e}\HELP\Opcodes.chm
&ASM Intro Help,{e}\HELP\Asmintro.chm
-
&VKdebug Help,{e}\help\VKDebug.chm




hence the search for [help] to locate the place to insert the [Plugins] entry.
If there are other versions of masm32 that create a menus.ini where [help] is listed as [&Help] (in menus.in) this is the first I have heard about it.


I know that qeditor does some things with the menus, maybe hutch can offer some clarification.

ALso the PluginBuilder plugin MUST have two arguments.
Quote
My sophisticated test it's not builded:
Code: [Select]
aaa proc       
ret
aaa endp


As here:
Code: [Select]
Plugin Proc src:dword, dst:dword  ;<-- two arguments
as it reads the selected text into the src buffer, modifies it according to what the plugin was designed to do, then
replaces the text using the dst buffer .  Failure to use two arguments will lead to stack imbalance and yes crash the plugin and qeditor.
Title: Re: Automated Plugin Builder plugin for qe
Post by: HSE on July 23, 2018, 06:11:47 AM
Have you an old qEditor version? Last version is 2016. But that it's a detail.

With arguments crash is the same. 

Title: Re: Automated Plugin Builder plugin for qe
Post by: 0000 on July 23, 2018, 06:16:35 AM
You have an old qEditor version? Last version is 2016. But that it's a detail.

With arguments crash is the same.

I have the version that comes with Masm32v11r.

qeditor version 4.0g

Sorry for your fubarred menus.ini. I have removed the download links for the Plugin Builder until this is resolved.
Can you post your complete menus.ini file? or better attach as a zip?

Or anyone else that has a menus.ini file where the help menu is listed as " [&Help] " please attach a copy.

I downloaded from US Site 1 if that makes any difference.
Title: Re: Automated Plugin Builder plugin for qe
Post by: HSE on July 23, 2018, 06:26:25 AM
4.0j is somewhere in the forum.

But don't lost the focus. Everyone can have a different menu.ini. :t
Title: Re: Automated Plugin Builder plugin for qe
Post by: 0000 on July 23, 2018, 06:31:37 AM
I think I found something. I'm not sure but there seem to be inconsistencies in the menus.ini for different installations.


From Build64
Code: [Select]

[Help]
Qeditor Help,{e}\help64\qeditor.chm
MASM 64 Bit Help,{e}\help64\masm64.chm


There probably ARE versions of Masm32 where the menus.ini file has help listed as "[&Help]"


I will modify the plugin builder to look for "elp]" then backtrack to find the beginning of the help entry.


This "should" be able to solve the "[help]", "[Help]", "[&Help]" or other variations problem.
I will make the string compare case insensitive to be sure.


Thanks for your bug report.
Title: Re: Automated Plugin Builder plugin for qe
Post by: 0000 on July 23, 2018, 06:36:06 AM
4.0j is somewhere in the forum.

But don't lost the focus. Everyone can have a different menu.ini. :t
See my post above this one. Yes, I did forget that users may modify the menus.ini file.


I might have to make the menus.ini part not be automated to be sure.
Or possbily list all of the entries, then let the user decide where to place the "Plugins" entry.
Title: Re: Automated Plugin Builder plugin for qe
Post by: jj2007 on July 23, 2018, 06:58:58 AM
My sophisticated test it's not builded:
Code: [Select]
aaa proc
       ret
aaa endp
Error A2049: Invalid instruction operands ;)
Title: Re: Automated Plugin Builder plugin for qe
Post by: 0000 on July 23, 2018, 07:01:18 AM
But don't lost the focus.

Oh, no way. I have been working on this for a while now. Your crash has given me the idea to continue working on my
plugin testbed.

It is basically an editor that can run plugins (as in the examples) without having to assemble them to a dll first.
it is a testbed I made to troubleshoot and debug new plugins. At one point (3 years ago) I had 30 something
working plugins for qeditor.  :biggrin:

But as I was desperately strapped for cash to pay the rent back then, I sold my computer and subsequently lost
a lot of my source code. All I had left when I returned to Masm32 forum a few months ago, was what I left here as attachments.  :(

But now I am back on Windows XP and back in coding mode.

OOps! this isn't the "Soap Box"


Title: Re: Automated Plugin Builder plugin for qe
Post by: 0000 on July 23, 2018, 07:03:48 AM
My sophisticated test it's not builded:
Code: [Select]
aaa proc
       ret
aaa endp
Error A2049: Invalid instruction operands ;)
:biggrin:   Thats right, aaa is an instruction.   :shock:
 aaa (https://www.felixcloutier.com/x86/AAA.html)

jj's a lot sharper than I am.  :lol:
Title: Re: Automated Plugin Builder plugin for qe
Post by: HSE on July 23, 2018, 07:47:31 AM
Error A2049: Invalid instruction operands ;)

 :biggrin: I forget that because I never used AAA. In real code is rrr, wich also is another entity in the forum.
Title: Re: Automated Plugin Builder plugin for qe
Post by: 0000 on July 23, 2018, 07:57:31 AM

 :biggrin: I forget that because I never used AAA. In real code is rrr, wich also is another entity in the forum.


I think I used AAA a total of approximately one time. as for rrr314567890, haven't heard from lately.  :P
Title: Re: Automated Plugin Builder plugin for qe
Post by: 0000 on July 23, 2018, 07:39:45 PM
With information supplied by HSE, I have found that yes there is a flaw in how menus.ini is parsed.
 
While investigating the code I noticed another flaw that could mitigate a crash. Previously I had a
list box so the user can indicate the drive letter where Masm32 is installed but had for some reason
removed that code.  ::)  As this is three year old code, I don't remember my intentions for doing so. (memory leak   :icon_confused: )
 
It's possible I didn't intend for a release product for the general population, and that it was intended
for my own personal use? I don't remember. It is also possible that I had a more user friendly version
that is now lost, along with megabytes of other old code.  :(
 
Anyway a rewrite of the menus.ini processing is underway. Also checking the drive letter where Masm32
is installed and asking the user " '[drive letter]:\masm32\' is this where you want your plugin ceated? " since I know
that it is possible for a user to have more than one installation of masm32 (on multiple drives/partitions)
 
Adding some code to make a backup copy of menus.ini. Also a display of the modified menus.ini so the user can
inspect it before the program proceeds to write the new menus.ini file to disk.
 
Any suggestions for further error checking are appreciated and will be taken into account before the next version
of the Plugin Builder is posted.
 
This rewrite may take a little time to finish/debug before the next version is posted.
Title: Re: Automated Plugin Builder plugin for qe
Post by: 0000 on July 31, 2018, 08:54:06 PM
The PluginBuilder project is on hold for the foreseeable future. Due to the fact that I am concentrating a lot of effort in getting my code editor finished to the state I had it in three years ago. I had only an early (only partly funtional) Source code from which to work with.
 
Its design is similar to qeditor, with a few new perks that I like. Highlighting for pasted text, and highlighting(different color)  for searched words/phrases. Sorry, no Highlighting for Registers, Varibles, etc. I don't want techicolor - just a litlle highhighting will do.
 
It has a built-in plugin testbed, (for creating qeditor compatible plugins), the Search and Replace dialog is now permanently on the Toolbar.
There are too many new perks to name just yet, as only some are fully completed and 100% stable. I will update my progress in a new thread probably in the Workshop, comming soon!
 
 So, the Plugin Builder for Queen Elizabeth is on hiatus.   8) 
Title: Re: zedds Plugins :P
Post by: 0000 on August 03, 2018, 08:49:37 PM
The Plugin Builder project is basically dead, but I am still working on plugins for qeditor. My latest idea is to indicate the direction of at least short jumps - as well as outline the jump path. Example in picture:
 
I am still working out some of the details, but will post full source code soon.