@440bx
Maybe this will give you some new ideas since you like peeking into Windows Internals. Unfortunately, flamerOn is no longer on this forum and BigChimp passed away.
Lazarus applications with source provided by flamerOn
https://forum.lazarus.freepascal.org/index.php?topic=22225.5
@JDThose are interesting. Thank you for the link.
My pipe dream app which I work on only every now and then is a dis-assembler a la IDA Pro or Ghidra but, more accurate and much more informative. My thinking is that if there was an app like that but _much better_ than either one of those, that would attract some really hard core programmers to further enhance it. I doubt I'll ever get it to what I consider is the "minimum acceptable" (which is way beyond what any other similar utility does today.) My ultimate goal is to emit FPC assembly routines that, when compiled, generate the same code as the original (that would require an additional utility to patch the resulting .exe to remove FPC's library (which is obviously not needed.) That would allow creating a Lazarus project for it, which after compiled with debug symbols could be run and debugged in the Lazarus IDE. That's how I envision porting C code to Pascal. Disassemble the executable to Pascal assembly functions, no darn C headers and macros and all that C junk to deal with. A "sidebar" to it is generating DWARF debug symbols for disassembled Windows dlls, that would allow the Lazarus IDE to operate like Visual Studio does, when stepping in a system dll, Visual Studio automatically downloads the PDB file. Lazarus would have a "bank" of external DWARF debug files for the Windows dlls and best of all, since the disassembly can be edited better symbols can be had as the disassembly gets better and better. That would attract some reverse engineers and, there would be no alternative for them but to use Lazarus and Pascal

One thing I completed a number of years ago is a "wrapper" to turn a .exe into a callable dll. For instance, I fully implemented it for Delphi 2. I have a program that loads Delphi 2's dcc32.exe as a dll and compiles all the .dpr files it finds in a directory and its subdirectories. A bonus is that, it executes _faster_ than the original .exe because its I/O no longer needs to use IPC (for it to be done by the console) and the wrapper does a little bit of caching. The result is close to twice the speed of executing dcc32.exe (one of the reasons is because the .exe doesn't have to be loaded for every compile.) It also does it for BRCC32.exe (the resource compiler). Therefore the utility can do a full build of resources and exes.
One thought that has crossed my mind is to modify that wrapper to turn FPC into a service which Lazarus could use. That would improve the edit-compile-run cycle. It's been a recurring thought, maybe I'll scratch that itch someday. I'd probably give it serious consideration and move it up the "priority queue" if I knew the Lazarus team would seriously consider using it. Not a killer app but, I think it would be a nice "polishing" improvement.
Combine that FPC service with the dis-assembler I first mentioned and you got something that blows everything that's currently available out of the water. (there are a few other "little" improvements I have in the back of my mind but, that's already enough to keep me busy until I kick the bucket.)