mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Oct 2008
Posts: 4
H
Self-satisified door
OP Offline
Self-satisified door
H
Joined: Oct 2008
Posts: 4
$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.
Joined: Jan 2006
Posts: 468
Fjord artisan
Offline
Fjord artisan
Joined: Jan 2006
Posts: 468
How is this related to *Services* being up or down?
PS: It can be scripted in $COM

Joined: Feb 2003
Posts: 3,432
S
Hoopy frood
Offline
Hoopy frood
S
Joined: Feb 2003
Posts: 3,432
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.


if ($me != tired) { return } | else { echo -a Get a pot of coffee now $+($me,.) }
Joined: Oct 2005
Posts: 1,741
G
Hoopy frood
Offline
Hoopy frood
G
Joined: Oct 2005
Posts: 1,741
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,918
A
Hoopy frood
Offline
Hoopy frood
A
Joined: Oct 2003
Posts: 3,918
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.


- argv[0] on EFnet #mIRC
- "Life is a pointer to an integer without a cast"
Joined: Oct 2005
Posts: 1,741
G
Hoopy frood
Offline
Hoopy frood
G
Joined: Oct 2005
Posts: 1,741
So you are suggesting a /pid command then?

-genius_at_work

Joined: Jan 2003
Posts: 1,063
D
Hoopy frood
Offline
Hoopy frood
D
Joined: Jan 2003
Posts: 1,063
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.


If it ain't broken, don't fix it!
Joined: Nov 2004
Posts: 842
Hoopy frood
Offline
Hoopy frood
Joined: Nov 2004
Posts: 842
Agreed.

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


What do you do at the end of the world? Are you busy? Will you save us?
Joined: Mar 2007
Posts: 218
V
Fjord artisan
Offline
Fjord artisan
V
Joined: Mar 2007
Posts: 218
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,138
C
Hoopy frood
Offline
Hoopy frood
C
Joined: Dec 2002
Posts: 3,138
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.

Joined: Oct 2008
Posts: 4
H
Self-satisified door
OP Offline
Self-satisified door
H
Joined: Oct 2008
Posts: 4
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,918
A
Hoopy frood
Offline
Hoopy frood
A
Joined: Oct 2003
Posts: 3,918
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.


- argv[0] on EFnet #mIRC
- "Life is a pointer to an integer without a cast"
Joined: Jul 2006
Posts: 4,145
W
Hoopy frood
Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 4,145
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
Joined: Oct 2008
Posts: 4
H
Self-satisified door
OP Offline
Self-satisified door
H
Joined: Oct 2008
Posts: 4
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