Author Topic: Automated Plugin Builder plugin for qe  (Read 12606 times)

hutch--

  • Administrator
  • Member
  • ******
  • Posts: 7532
  • Mnemonic Driven API Grinder
    • The MASM32 SDK
Re: Automated Plugin Builder plugin for qe
« Reply #30 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.
hutch at movsd dot com
http://www.masm32.com    :biggrin:  :skrewy:

zedd151

  • Member
  • ****
  • Posts: 871
Re: Automated Plugin Builder plugin for qe
« Reply #31 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.
I'm not always the sharpest knife in the drawer, but I have my moments.  :P

zedd151

  • Member
  • ****
  • Posts: 871
Re: Automated Plugin Builder plugin for qe
« Reply #32 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.
« Last Edit: July 21, 2018, 07:34:54 PM by zedd151 »
I'm not always the sharpest knife in the drawer, but I have my moments.  :P

zedd151

  • Member
  • ****
  • Posts: 871
Re: Automated Plugin Builder plugin for qe
« Reply #33 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
I'm not always the sharpest knife in the drawer, but I have my moments.  :P

HSE

  • Member
  • *****
  • Posts: 1377
  • <AMD>< 7-32>
Re: Automated Plugin Builder plugin for qe
« Reply #34 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

zedd151

  • Member
  • ****
  • Posts: 871
Re: Automated Plugin Builder plugin for qe
« Reply #35 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.
I'm not always the sharpest knife in the drawer, but I have my moments.  :P

HSE

  • Member
  • *****
  • Posts: 1377
  • <AMD>< 7-32>
Re: Automated Plugin Builder plugin for qe
« Reply #36 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].

zedd151

  • Member
  • ****
  • Posts: 871
Re: Automated Plugin Builder plugin for qe
« Reply #37 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.
I'm not always the sharpest knife in the drawer, but I have my moments.  :P

HSE

  • Member
  • *****
  • Posts: 1377
  • <AMD>< 7-32>
Re: Automated Plugin Builder plugin for qe
« Reply #38 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. 


zedd151

  • Member
  • ****
  • Posts: 871
Re: Automated Plugin Builder plugin for qe
« Reply #39 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.
I'm not always the sharpest knife in the drawer, but I have my moments.  :P

HSE

  • Member
  • *****
  • Posts: 1377
  • <AMD>< 7-32>
Re: Automated Plugin Builder plugin for qe
« Reply #40 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

zedd151

  • Member
  • ****
  • Posts: 871
Re: Automated Plugin Builder plugin for qe
« Reply #41 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.
I'm not always the sharpest knife in the drawer, but I have my moments.  :P

zedd151

  • Member
  • ****
  • Posts: 871
Re: Automated Plugin Builder plugin for qe
« Reply #42 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.
I'm not always the sharpest knife in the drawer, but I have my moments.  :P

jj2007

  • Member
  • *****
  • Posts: 10540
  • Assembler is fun ;-)
    • MasmBasic
Re: Automated Plugin Builder plugin for qe
« Reply #43 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 ;)

zedd151

  • Member
  • ****
  • Posts: 871
Re: Automated Plugin Builder plugin for qe
« Reply #44 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"


I'm not always the sharpest knife in the drawer, but I have my moments.  :P