mIRC Home    About    Download    Register    News    Help

Print Thread
$pid and $process identifiers #205589 26/10/08 05:23 PM
Joined: Oct 2008
Posts: 4
H
Horstefan Offline OP
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.
Re: $pid and $process identifiers [Re: Horstefan] #205590 26/10/08 05:59 PM
Joined: Jan 2006
Posts: 468
symphony Offline
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

Re: $pid and $process identifiers [Re: symphony] #205591 26/10/08 06:11 PM
Joined: Feb 2003
Posts: 3,432
S
sparta Offline
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,.) }
Re: $pid and $process identifiers [Re: Horstefan] #205593 26/10/08 06:34 PM
Joined: Oct 2005
Posts: 1,741
G
genius_at_work Offline
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

Re: $pid and $process identifiers [Re: genius_at_work] #205597 26/10/08 08:29 PM
Joined: Oct 2003
Posts: 3,918
A
argv0 Offline
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"
Re: $pid and $process identifiers [Re: argv0] #205599 26/10/08 08:41 PM
Joined: Oct 2005
Posts: 1,741
G
genius_at_work Offline
Hoopy frood
Offline
Hoopy frood
G
Joined: Oct 2005
Posts: 1,741
So you are suggesting a /pid command then?

-genius_at_work

Re: $pid and $process identifiers [Re: genius_at_work] #205631 27/10/08 09:47 AM
Joined: Jan 2003
Posts: 1,063
D
Doqnach Offline
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!
Re: $pid and $process identifiers [Re: Doqnach] #205632 27/10/08 10:49 AM
Joined: Nov 2004
Posts: 826
Jigsy Offline
Hoopy frood
Offline
Hoopy frood
Joined: Nov 2004
Posts: 826
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?
Re: $pid and $process identifiers [Re: Doqnach] #205639 27/10/08 04:48 PM
Joined: Mar 2007
Posts: 218
V
vexed2 Offline
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.
Re: $pid and $process identifiers [Re: Doqnach] #205644 27/10/08 07:20 PM
Joined: Dec 2002
Posts: 3,138
C
Collective Offline
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.

Re: $pid and $process identifiers [Re: Doqnach] #207352 14/12/08 10:46 AM
Joined: Oct 2008
Posts: 4
H
Horstefan Offline OP
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!

Re: $pid and $process identifiers [Re: Horstefan] #207388 14/12/08 09:44 PM
Joined: Oct 2003
Posts: 3,918
A
argv0 Offline
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"
Re: $pid and $process identifiers [Re: argv0] #207397 15/12/08 02:12 AM
Joined: Jul 2006
Posts: 3,790
W
Wims Offline
Hoopy frood
Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 3,790
I agree.
Snippet that allow you to get info on process (or even kill them) already exists.


Looking for a good help channel about mIRC? Check #mircscripting @ irc.swiftirc.net
Re: $pid and $process identifiers [Re: argv0] #207406 15/12/08 05:14 PM
Joined: Oct 2008
Posts: 4
H
Horstefan Offline OP
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.