Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 222
  • Last Modified:

How to retrieve parameters which were passed to one process in Command Line from another independent process

I need to know how to retrieve parameters which were passed to one process in Command Line from another independent process. I have a handle and a pid of the process ,which parameters I want to get.

I need to do in it WinXp under win32 (no MFC).

Please give me a tip . :(

Thank you.
0
EliL
Asked:
EliL
  • 2
  • 2
1 Solution
 
jkrCommented:
Well, there's an undocumented method for NT/2k/XP...
0
 
EliLAuthor Commented:
What method?
Can you be more specific.
0
 
jkrCommented:
I am sorry to say so, but this is quite an advanced topic for 50pts...
0
 
SalteCommented:
Do I understand you right?

You want to get the command line arguments that was given to a different process than your own? If the process is your own the args are available in argc, argv and are easy to get.

For a different process' args there is a way but it is quite tricky and as jkr says, it is worth a lot more than 50 points.

However, I can give you a hint for 50 points: Check out the process API in PS.DLL - at least I think that's what the DLL is called. It has a couple of functions that you might find useful. You can list all available processes get their pid, their status, you can even get a handle to their memory and if you know how to do it you can read their memory.... Now, I won't go into details, it's not worth it for 50 points but yes, there are functions. Not so sure they are undocumented, I believe they are documented somewhere - perhaps not in the official documentation but in some white papers from Microsoft they are documented. It's the API that the task manager uses to display all processes etc.

Now, that is enough hints for 50 points.

Alf
0
 
EliLAuthor Commented:
Thank you for your help.
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now