There are multiple ways services can be attached to immediately once they start:
- Creating a dedicated registry key: It is possible to create a key such as HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\<filename> with the corresponding string data value Debugger containing the full path to the debugger to be attached to the service once the program with the specified <filename> starts. Here, there is a nuance that the window of the attached debugger may not appear if the service is not interactive. It can be fixed using one of the following ways:
- Open services.msc, then open Properties for the debugged service, then go to the Log On tab and set a tick against the Allow service to interact with desktop option.
- It can also be done manually by opening the Type value of the HKLM\SYSTEM\CurrentControlSet\services\<service_name> registry key and replacing its data with the result of a bitwise OR operation with the...