nml375 wrote:Oh, also forgot, I doubt this is what you actually intended:
Code: Select all
[string equal "4" [split [llength $text]]]
More likely you're trying to split $text into a list, and then get the lenght of the list... also, since you're comparing integers, == would suffice, so no need for string equal.
Next,
Code: Select all
[regexp -all {\.} [lindex $text 2]] <= 3
$text is a string, not a list :p And why are you counting the number of dots in the filename? *confused*
Finally, this is just overkill, the second test catches any and all conditions of the first one, making it obsolete.
Code: Select all
[string equal "#" [string index $dest 0]] && [string match "#*" $dest]
I also do not get why you are checking for @ as the first character of dest... But maybe that's something I've forgotten from the rfc's...
As for this:
Code: Select all
[string equal "4" [split [llength $text]]]
Yes i'll try to omit the split. But I am matching 4 parameteres here, so there always should be 4, else stop there immediately.
The "==" sign is also recommended for this case, but I overlooked it, anyway both would produce the same result. Well the one thing I will observe is the equality (==) will execute faster than string equal, if I am correct.
For this:
Code: Select all
[regexp -all {\.} [lindex $text 2]] <= 3]
I am trying to match:
DCC Send mirc.exe (219.92.24.7)
DCC Send remote.txt.ini (219.92.24.7)
DCC Send versions.tar.gz (219.92.24.7)
DCC Send alias.ini.scr.com (219.92.24.7)
The letters in bold, meaning the file name. These are very good examples of infected files. The extension of the file name is changed or additional extension is added to cloack the original file being sent. This is encountered mostly on DALnet.
Thirdly:
Code: Select all
[string equal "#" [string index $dest 0]] && [string match "#*" $dest]
Yeah I guess I overlooked this. After seeing the complete proc, this statement is redundant and already implemented, so it should be removed.
Checking @ as first character.. remember OPNOTICE? Sometimes channel ops us opnotice so dest is like "@#channel" and even ChanServ on DALnet uses opnotices for VERBOSE commands mostly.