Command Line Arguments for an existing process
-
Does anyone know how to retreive the command line arguments for an existing external process ? StartInfo.Arguments does not contain it.
-
Does anyone know how to retreive the command line arguments for an existing external process ? StartInfo.Arguments does not contain it.
Hello Why, I wonder?? Arguments should be in that property!! Try using the
ProcessStartInfo.Verbs
property instead.Regards:rose:
-
Does anyone know how to retreive the command line arguments for an existing external process ? StartInfo.Arguments does not contain it.
Well do i assume that the external process is a managed app? Anyways, any process started with command line arguments, has them stored in the process primary stack, since they are in scope of the entry point. You need to write a generic unmanaged code piece to access the string array passed into the entry point by the c runtime in an unmanaged process. For a managed app you need to get the pointer location of the entrypoint and then in contigous to the it would be the command line arguments passed in. you can see where the arguments finish by wrapping your search before any instruction address or jmp instruction appears. Does that make something clear here?
Excelsior Arjun Bahree "By The Might of Mjolnir" I Came! I Coded! I Conquered!
-
Hello Why, I wonder?? Arguments should be in that property!! Try using the
ProcessStartInfo.Verbs
property instead.Regards:rose:
Verbs does not contain any command line args at all. It purpose of use is very different. it indicates the actions that the system can apply to the file indicated by the FileName property of ProcessStartInfo class.
Excelsior Arjun Bahree "By The Might of Mjolnir" I Came! I Coded! I Conquered!