This project consists of two main components: GetProcNameByPid and GetProcNameByPidKm. The GetProcNameByPid component is a user-mode application, while GetProcNameByPidKm is a kernel-mode driver.
This is a simple example of using the DeviceIoControl function with the Neither I/O method.
- Visual Studio 2022 with C++ development tools
- Windows Driver Kit (WDK) for kernel-mode driver development
-
Open the solution file GetProcNameByPid.sln in Visual Studio 2022.
-
Build the
GetProcNameByPidproject:- Build the project for the desired configuration (Debug/Release).
-
Build the
GetProcNameByPidKmproject:- Build the project for the desired configuration (Debug/Release).
-
Or just
Build Solution.
- The built executable
GetProcNameByPid.execan be found in thex64/Debugorx64/Releasedirectory.
- The built driver
GetProcNameByPidKm.syscan be found in thex64/Debugorx64/Releasedirectory of theGetProcNameByPidKmfolder.
Note: The following scripts require administrator privileges to run.
- To install the kernel-mode driver, use install_GetProcNameByPidKm.bat.
- To start the driver, use start_GetProcNameByPidKm.bat.
- To stop the driver, use stop_GetProcNameByPidKm.bat.
- To uninstall the driver, use uninstall_GetProcNameByPidKm.bat.
To run these scripts as an administrator, right-click the .bat file and select "Run as administrator".
- Copy the following files and folders to the target computer (VM):
GetProcNameByPidKmfolder (containing.sys,.inf,.catfiles)GetProcNameByPid.exeinstall_GetProcNameByPidKm.batstart_GetProcNameByPidKm.batstop_GetProcNameByPidKm.batuninstall_GetProcNameByPidKm.bat
-
Enable Debug Mode and Test Signing Mode on the target computer (VM):
- Open Command Prompt as Administrator.
- Run the following command to enable test signing mode:
bcdedit /debug on bcdedit /set testsigning on - Restart the computer to apply the changes.
-
After the computer restarts, you can use the provided
.batscripts to manage the kernel-mode driver. -
Open a command prompt and navigate to the folder where
GetProcNameByPid.exeis located. -
Usage:
- Run
GetProcNameByPid.exeat command prompt:GetProcNameByPid.exe <pid1> <pid2> ... <pidN> - For example:
GetProcNameByPid.exe 4 124 548 700 772 780 860 916 940 536 692
- Run








