![]() |
Listing Processes and finding executable |
Post Reply
|
Page 123> |
| Author | |
eth8505
Newbie
Joined: 26 June 2006 Status: Offline Points: 9 |
Post Options
Thanks(0)
Quote Reply
Topic: Listing Processes and finding executablePosted: 26 June 2006 at 10:17am |
|
Hi everybody,
i am in a bit of trouble at the moment. I am trying to find the executable filename of a process. So far I have 2 implementations of it, one using PSLIB, the other using PROCESSENTRY32 struct. Both of these don't seem to give me the actual filename of the process when run without admin rights. I dont need the complete path, just the filename. (like services.exe). I noticed Process Explorer shows the filename in normal user mode; maybe you can tell me your little secret before i freak? ;) thanks Jan |
|
![]() |
|
MP_ART
Senior Member
Joined: 08 March 2006 Location: Russian Federation Status: Offline Points: 947 |
Post Options
Thanks(0)
Quote Reply
Posted: 26 June 2006 at 10:29am |
|
Hi!
Process Explorer uses ZwQuerySystemInformation function. All other user mode functions, like Process32First(Next) refers to it. |
|
![]() |
|
eth8505
Newbie
Joined: 26 June 2006 Status: Offline Points: 9 |
Post Options
Thanks(0)
Quote Reply
Posted: 26 June 2006 at 10:35am |
|
Is there maybe some kind of nice example on how to use that properly? I am not _that_ versed in C/C++ or most of the win32 api as I mainly program Java. I have to write an interface for process monitoring now though.
|
|
![]() |
|
MP_ART
Senior Member
Joined: 08 March 2006 Location: Russian Federation Status: Offline Points: 947 |
Post Options
Thanks(0)
Quote Reply
Posted: 26 June 2006 at 10:44am |
|
you can simple >google< about it. you'll find a TONS of info. But it generally for C++/Delphi. And you MUST to use win32 or NTnative function calls to get processes information, to avoid stupid bugs.
Edited by MP_ART - 26 June 2006 at 10:44am |
|
![]() |
|
EP_X0FF
Senior Member
Joined: 08 March 2006 Location: Russian Federation Status: Offline Points: 4753 |
Post Options
Thanks(0)
Quote Reply
Posted: 26 June 2006 at 11:07am |
|
@eth8505: Use PSAPI. Go to http://www.msdn.com, MS have examples for this.
Like this:
HTH |
|
![]() |
|
EP_X0FF
Senior Member
Joined: 08 March 2006 Location: Russian Federation Status: Offline Points: 4753 |
Post Options
Thanks(0)
Quote Reply
Posted: 26 June 2006 at 11:15am |
|
One more: Most comprehensive method -> use driver
EPROCESS list and so on... but AIG is not for eth8505, need simple solution.
p.s. Don't forget to adjust SeDebugPrivilege for opening system processes. p.p.s. Also exists WMI solutions ![]() Edited by EP_X0FF - 26 June 2006 at 11:16am |
|
![]() |
|
eth8505
Newbie
Joined: 26 June 2006 Status: Offline Points: 9 |
Post Options
Thanks(0)
Quote Reply
Posted: 27 June 2006 at 2:08am |
|
My problem is that the process enumeration must work with very very little privileges. I cannot force our software users to set SeDebugPrivilege for the sys processes.
|
|
![]() |
|
MP_ART
Senior Member
Joined: 08 March 2006 Location: Russian Federation Status: Offline Points: 947 |
Post Options
Thanks(0)
Quote Reply
Posted: 27 June 2006 at 2:24am |
EP_X0FF's PSAPI example works even on Guest privilegde level.
|
|
![]() |
|
EP_X0FF
Senior Member
Joined: 08 March 2006 Location: Russian Federation Status: Offline Points: 4753 |
Post Options
Thanks(0)
Quote Reply
Posted: 27 June 2006 at 2:34am |
It is you must set this privilege in code not users! |
|
![]() |
|
EP_X0FF
Senior Member
Joined: 08 March 2006 Location: Russian Federation Status: Offline Points: 4753 |
Post Options
Thanks(0)
Quote Reply
Posted: 27 June 2006 at 3:32am |
|
If you don't know how to do this, here Napalm's code
|
|
![]() |
|
Post Reply
|
Page 123> |
|
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 |