mIRC Home    About    Download    Register    News    Help

Print Thread
H
Horstefan
Horstefan
H
$pid() and $process() identifiers to check whether a program is running or not,
mostly to be used by bots, saying a service is up or down.

example:
$pid(400) returns $true or $false wether a process with id 400 exists
$process(notepad.exe) returns $true or $false wether a process with name notepad.exe exists.


Last edited by Horstefan; 26/10/08 05:24 PM.
S
symphony
symphony
S
How is this related to *Services* being up or down?
PS: It can be scripted in $COM

Joined: Feb 2003
Posts: 3,412
S
Hoopy frood
Offline
Hoopy frood
S
Joined: Feb 2003
Posts: 3,412
Originally Posted By: symphony
PS: It can be scripted in $COM

Yes it can be scripted, but that goes for the most of the features requested in here.

Joined: Oct 2005
Posts: 1,671
G
Hoopy frood
Offline
Hoopy frood
G
Joined: Oct 2005
Posts: 1,671
This sounds like a potentially useful feature. Although, I would have it work more like this:


$pid(<number>)
$pid(400)
- Returns $null if PID 400 does not exist
- Returns the name of PID 400 if it exists, ie notepad.exe

$pid(<program>,n)
$pid(notepad.exe,1)
- Returns $null if a program called notepad.exe isn't running
- Returns the PID of the nth program called notepad.exe, or if n=0 returns total number of programs called notepad.exe

$pid(<number/name>[,n]).<param>
$pid(400).handles
- Returns $null if the PID/program doesn't exist
- Returns the specified param data
* <param> could potentially be any column that is displayed in the windows task manager (view > select columns). ie handles, threads, username, memory, description, etc.

-genius_at_work

Joined: Oct 2003
Posts: 3,641
A
Hoopy frood
Offline
Hoopy frood
A
Joined: Oct 2003
Posts: 3,641
I guarantee that right after an mIRC release with $pid in it, someone will suggest to manipulate those process ids; the ability to kill a process, change its priority, etc.

Joined: Oct 2005
Posts: 1,671
G
Hoopy frood
Offline
Hoopy frood
G
Joined: Oct 2005
Posts: 1,671
So you are suggesting a /pid command then?

-genius_at_work

Joined: Jan 2003
Posts: 1,057
D
Hoopy frood
Offline
Hoopy frood
D
Joined: Jan 2003
Posts: 1,057
with such a command it would become even easier to trojans to do their work abusing mIRC for it's own good. giving them the ability to kill virusscanner processes etc for instance.

I would highly suggest against such a feature ( the /pid one ).

I'm also not really sure what the $pid identifier would add personally but maybe someone can explain some usecases which show more then one person actually having use for it.

Joined: Nov 2004
Posts: 822
Hoopy frood
Offline
Hoopy frood
Joined: Nov 2004
Posts: 822
Agreed.

As for the $pid identifier, myggan wrote one on mircscripts.org.

V
vexed2
vexed2
V
No more dangerous than the $encode/$decode identifiers. You could just put a lock on them the same as Run/dll/decode/com

Last edited by vexed2; 27/10/08 04:49 PM.
Joined: Dec 2002
Posts: 3,015
C
Hoopy frood
Offline
Hoopy frood
C
Joined: Dec 2002
Posts: 3,015
I'm not sure why you think it would be a security risk, the capability to end processes via script already exists via /run, /dll and $com.

Also, if your virus scanner is letting anyone kill it then your virus scanner sucks.

H
Horstefan
Horstefan
H
Originally Posted By: Doqnach
with such a command it would become even easier to trojans to do their work abusing mIRC for it's own good. giving them the ability to kill virusscanner processes etc for instance.

I would highly suggest against such a feature ( the /pid one ).

I'm also not really sure what the $pid identifier would add personally but maybe someone can explain some usecases which show more then one person actually having use for it.



I would not like to see a /pid command for above reasons,
if the $pid() feature could be realised it would be awesome!

Joined: Oct 2003
Posts: 3,641
A
Hoopy frood
Offline
Hoopy frood
A
Joined: Oct 2003
Posts: 3,641
The question is, how many people actually need process control when scripting? It doesn't seem to me like a common scripting task. Common tasks make sense to add to mIRC.. less common ones are perfectly okay when left as one-line snippets people can import when needed.

I'm not a big fan of clogging up the global space. Adding an extra identifier would break any script already using some custom $pid identifier since identifiers can't be overloaded like /commands can. I don't get what the advantage of putting this in mIRC is? Unlike the poster above, I disagree that all (most) feature suggestions here can be scripted.. Most of the valid feature suggestions I see are ones that extend the language to allow scripters to do things they could not; I'd rather see more of those.

Joined: Jul 2006
Posts: 4,035
W
Hoopy frood
Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 4,035
I agree.
Snippet that allow you to get info on process (or even kill them) already exists.


#mircscripting @ irc.swiftirc.net == the best mIRC help channel
H
Horstefan
Horstefan
H
There shouldnt be any question about "needing" a function.
It would be nice if this function is available though.
edit: [read: available --> more simple to access]
Scripting is usefull, but not neccesary.

Last edited by Horstefan; 15/12/08 05:15 PM.

Link Copied to Clipboard