![]() |
get command-line of running processes |
Post Reply
|
Page 12> |
| Author | ||
supersonic
Newbie
Joined: 22 June 2006 Location: Lebanon Status: Offline Points: 6 |
Post Options
Thanks(0)
Quote Reply
Topic: get command-line of running processesPosted: 22 June 2006 at 10:39am |
|
|
Hello,
I'm trying to write a command line utility that outputs the list of running processes and the command line (including command-line arguments) that was used to launch them. Any ideas on how to get to that info from windows? So far, using PSAPI from the windows platform sdk provides only the path of the executable but not the command line parameters. I know that info is somehow obtainable because process explorer shows it when you open a process' properties. Any ideas on how process explorer gets that info? Thank you. |
||
![]() |
||
EP_X0FF
Senior Member
Joined: 08 March 2006 Location: Russian Federation Status: Offline Points: 4753 |
Post Options
Thanks(0)
Quote Reply
Posted: 22 June 2006 at 10:42am |
|
|
Use PEB->PROCESS_PARAMETERS
If you need headers, visit http://www.rkunhooker.narod.ru, see ntnative.h |
||
![]() |
||
supersonic
Newbie
Joined: 22 June 2006 Location: Lebanon Status: Offline Points: 6 |
Post Options
Thanks(0)
Quote Reply
Posted: 23 June 2006 at 4:20am |
|
|
Thanks for the code snippet.
I think this is exactly what I need. can I have more info on _ZwReadVirtualMemory ? and how do I obtain ProcessInfo->PebBaseAddress (ie. what windows API function can fill the ProcessInfo struct) ? Thank you. |
||
![]() |
||
EP_X0FF
Senior Member
Joined: 08 March 2006 Location: Russian Federation Status: Offline Points: 4753 |
Post Options
Thanks(0)
Quote Reply
Posted: 23 June 2006 at 4:25am |
|
This is similar to ReadProcessMemory About second question - use ZwQueryInformationProcess to get PEB base address
|
||
![]() |
||
<DNY>
Senior Member
Joined: 19 June 2006 Location: Germany Status: Offline Points: 402 |
Post Options
Thanks(0)
Quote Reply
Posted: 23 June 2006 at 4:34am |
|
|
@supersonic
goto www.reactos.com, grad the headers u need |
||
|
< DNY >
|
||
![]() |
||
EP_X0FF
Senior Member
Joined: 08 March 2006 Location: Russian Federation Status: Offline Points: 4753 |
Post Options
Thanks(0)
Quote Reply
Posted: 23 June 2006 at 7:26am |
|
|
@supersonic: I assume this code will work with 32bit Windows?
|
||
![]() |
||
supersonic
Newbie
Joined: 22 June 2006 Location: Lebanon Status: Offline Points: 6 |
Post Options
Thanks(0)
Quote Reply
Posted: 23 June 2006 at 8:16am |
|
|
yes, 32-bit windows.
actually, WinXp and Win2k3 server 32-bit. btw, i still can't get to the function ZwQueryInformationProcess. i've downloaded the source of reactos as suggested by <DNY> and tried to include the headers but it did not work. should I import the function directly from ntdll.dll using GetProcAddress ? Thanks. |
||
![]() |
||
MP_ART
Senior Member
Joined: 08 March 2006 Location: Russian Federation Status: Offline Points: 947 |
Post Options
Thanks(0)
Quote Reply
Posted: 23 June 2006 at 8:29am |
|
Yes.
|
||
![]() |
||
EP_X0FF
Senior Member
Joined: 08 March 2006 Location: Russian Federation Status: Offline Points: 4753 |
Post Options
Thanks(0)
Quote Reply
Posted: 23 June 2006 at 9:12am |
|
|
You cant simply include reactos headers, better to write prototypes by own handle, or ctrl+c MP_ART code.
|
||
![]() |
||
<DNY>
Senior Member
Joined: 19 June 2006 Location: Germany Status: Offline Points: 402 |
Post Options
Thanks(0)
Quote Reply
Posted: 23 June 2006 at 9:27am |
|
not inclyde!,use prototypes,structs,as ep suggestd |
||
|
< DNY >
|
||
![]() |
||
Post Reply
|
Page 12> |
|
Tweet
|
| Forum Jump | Forum Permissions ![]() You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |