Starting with the whole discussion about window open/close notifiers, with questions to get the contact's font, and some other things people would like to access but can't with the current script engine, I decided to try and create an ActiveX based Packet sniffer.
Warning: if your script uses this, it may become unstable/useless if MSN changes protocol ! So be very carefull!
This allows you to start monitoring packets with a couple of lines of code, and provides easy methods to get what you want, quickly!
It gives you access to only 1 property and 2 methods:
»
property IP : string containing the IP you want to listen
»
function Start() : start monitoring the choosen IP
»
function Stop() : stop monitoring the choosen IP
» function About() : displays a small about box
Examples: (with full commented code)
- Window open/close notifier ( very reliable, only close notifier has a delay of 15/30seconds from the actual close of the window, due to a WLM limitation )
- View All MSN packets (usefull to study what packets get sent/received when you do something specific and build your own script)
My first idea was to make the ActiveX MSN-only (only capture MSN packets), but then I thought that only one extra line of code (check if comming from MSN port) wouldn't matter if you could monitor the entire network.
So, here it is, hope you guys enjoy it.
I didn't test it very much, but there aren't that much things that can go wrong with 1 property and 2 basic methods, so I leave it for you guys to use !
Note: it's OCX because Delphi doesn't allow to create non-visual ActiveX Object (actually it allows, but it would take forever), so I created it visually and then added the flag to make the ActiveX invisible at runtime. So, don't worry about the extension being OCX and not DLL, just register it normally using regsvr32.
Note2: my imagination wasn't running that wild when I gave the ActiveX a name, so w00t.Xniff sounded like a good choice
Note3: I hope it works in every PCs, because hopefully it doesn't need Borland Runtime Packages to run (that's why the filesize is rather big). But I dunno, it's the first ActiveX I create so I can't know for sure...