Hi all!
Following JJ's 2012 ideas it's possible to improve amateurs experience with QE using just a little of colors. Very rustic but I think useful.
Quote from: jj2007 on February 18, 2020, 11:38:36 PM
..., but OP wants something completely different: automatic syntax highlighting à la Iczelion (http://masm32.com/board/index.php?topic=6461.0).
I can't wait to see what OP can do :biggrin:
Quote from: jj2007 on February 18, 2020, 11:38:36 PM
In order to achieve that, you need the QE plugin interface (http://masm32.com/board/index.php?topic=4564.msg48903#msg48903), i.e. write a DLL that does the highlighting using the hRichEdit in-process. Quite a different story.
I know, it's a challenge :wink2:. But RadAsm and many others make that very well (I think).
- here most recent version:
I've extracted it to \Masm32\plugins\stream1.dll - how do you activate it?
Edit menus.ini in masm32 directory and were you want write:stream1, {e}\plugins\stream1.dll
or create a new category:[MyCategory]
fantasyname, {e}\plugins\stream1.dll
Open a new instance of QE and open an assembly file (.asm or .inc), after that in the menu you execute the plugin.
Works like a charm :thumbsup:
Thanks JJ for testing :thumbsup:
Quote from: Ravi Kiran on February 19, 2020, 03:44:44 PM
it's working sir.
That it's the previous version. Version here also process strings, just because strings can contain semicolons.
Corrected remotion of spaces after quotation, and now brackets, etc (easy to modify if you don't like that). Files updated in first post.
great :thumbsup:
It works fine :thumbsup:
Now your next step will be to harmonise it with [Colours] in OllyDbg.ini :badgrin:
Thanks :thumbsup:
Quote from: jj2007 on February 20, 2020, 07:55:19 PM
Now your next step will be to harmonise it with [Colours] in OllyDbg.ini :badgrin:
qEditor don't need a plugin to do that :biggrin:
Hi!!
Here I added the Iczelion procedure.
Quote from: jj2007 on February 18, 2020, 11:38:36 PM
..., but OP wants something completely different: automatic syntax highlighting à la Iczelion (http://masm32.com/board/index.php?topic=6461.0).
That work perfectly until you close the MessageBox.
I'm still not very succefull taking Richedit's Font and creating the GDI font :biggrin:
But work for me because plugin is builded with my qEditor's settings: fixedsys, height =12, weight= 500.
Location of wordfile.txt must be qEditor's location.
Works fine with a 640k source :thumbsup:
Thanks JJ!
The theoretical size of the file is around 800 Kb (asuming RTF = plain text * 3). But can be increased changing memory allocated:
invoke SysAllocStringByteLen, NULL, 2500000 <-- memory for plain text file
mov hReo$, eax
invoke SysAllocStringByteLen, NULL, 2500000 <-- memory for RTF
mov hRes$, eax
There are some glitchs perhaps because RTF is not well formed, but most likely because QE is optimized for plain text :biggrin:
That make interesting to use only Iczelion procedure (http://masm32.com/board/index.php?topic=8391.msg91804), wich surprisingly work fine just subclassing Richedit.
Of course look better RTF :biggrin: and not interfere with most QE functions. Perhaps both plugins could be of interest.
There was some problem forming RTF, solved now.
The process can detect "comment" now. It's maked in a very nice spaghetti style :biggrin:, still not using Hutch's Finite State Machines.
Updated in first post.
The way I did the words 20 years ago was to load them into a hash table that I had in PowerBASIC so that access time for getting the words was fast enough. I don't have one written for masm but I think you can make a IF based tree grouping words that start with the same character to reduce the number of branches that you would have in a linear word list. To get the different colours I grouped each class of words with a single number so for example, registers=1, directives=2 etc ....
I would be inclined to do all the words in a single case rather than having both upper, and lower case as well as mixed case as a case conversion is fast enough not to have to bother with all the options and it reduces by half that number of entries.
Quote from: hutch-- on March 18, 2020, 02:28:21 AM
The way I did the words 20 years ago was to load them into a hash table
You mention that recently. I taked note :thumbsup:
Quote from: hutch-- on March 18, 2020, 02:28:21 AM
I would be inclined to do all the words in a single case...
Yes. It's the only way that syntax highlighting work like "typing error detection". Some words can be written in upper or lower case but, for example, I don't write registers in upper case, and so on.
Just playing a little more :biggrin:
Words are detected now. And that requiere also detect numbers!
Only CPU registers are detected, using some kind of tree. I found there is examples of hashtables in \masm32\examples\advanced to copy but that will be in some future :cool:.
Files updated in first post.
As some here know, I like writing and using qeditor plugins. There are many useful features/fuctions that can be added with them. I am surprised I hadn't seen this thread already. I found this thread by looking at the 'Who's Online' list. (I like seeing what other users find interesting) A Guest was viewing the thread, so I followed and found it.
The closest thing I had done with a qeditor plugin was to have a plugin that searches the text for a string and highlights the occurrences of that string if found.
Nice little plugin HSE. :thumbsup:
For this type of plugin I would probably use an external file with the words needed to be highlighted and their color. This way the user can change the words to be highlighted and their colors without having to rebuild the plugin (of course would be slower). Would be nice if a plugin could run automatically at the startup of qeditor, rather than having to select it from the menu. (Not a request hutch-- for any changes :tongue: ) Would make using this type of plugin much easier.
Thanks :thumbsup:
Second plugin, Iczelion syntax method, use a file with several word categories.
Quote from: HSE on October 01, 2022, 06:13:54 AM
Second plugin, Iczelion syntax method, use a file with several word categories.
I totally missed that one (I didn't read through all the replies). Nice. :biggrin: