How to query a running process for its parameters list? (Windows, C++)

Assuming you know the process ID, use OpenProcess to get a handle to it (this requires elevated privilege as noted in the docs). Then use NtQueryInformationProcess to get detailed process info. Use the ProcessBasicInformation option to get the PEB of the process – this contains another structure pointer, through which you canget the command line.

Leave a Comment