(The project is called SciLexer because the SciLexer component in scintilla is tested first. After the test is passed, it is found that the asm lexical parsing engine is fully usable. By the way, the windbg highlighting plug-in sub-project named hs is created. The test subproject is only used to test the SciLexer components, and it has expired. Basically, just look at the hs subproject and it will be OK.The directory of the windbg plug-in SDK is set in the project properties. Originally I wanted to write the windbg plug-in, but I found that no SDK is needed at all. Any ordinary dll can be loaded with the .load command, so if you don’t have a windbg sdk, just delete engextcpp. cpp and change related codes such as dllmain (my current machine does not have a programming environment), so the default compilation requires: vs2008 and above, boost library, windbg sdk.
Hook ExtTextOutW, and set SetTextColor to set the text color. Of course, you can also set the background color, but it doesn't seem to be needed. In ExtTextOutW_Hook, it is judged whether to process (such as judging whether the window is an assembly window and a command window, and adding the window cache). If it needs to be processed, call the lex function analysis of the CText class. After the lex analysis is completed, the SetStyles in CText will be called. Text coloring,SetStyles( int length, const char *styles)Length is the number of characters, styles is a buffer, each byte corresponds to a processed character, and its value is the color of the character. If the CPU is 6, it corresponds to SCE_ASM_CPUINSTRUCTION in SciLexer\include\SciLexer.h, for example: mov eax,0Corresponding in styles 666088802Where 8 is SCE_ASM_REGISTER, 2 is SCE_ASM_NUMBER, so we need to display it in segments when we display it, call SetTextColor once for the same value, and immediately ExtTextOutW, and correct the X coordinate so that the next ExtTextOutW call, the test found that each ExtTextOutW only displays one line. So don't care about the Y coordinate.)