Shoutbox

Xniff help - Printable Version

-Shoutbox (https://shoutbox.menthix.net)
+-- Forum: MsgHelp Archive (/forumdisplay.php?fid=58)
+--- Forum: Messenger Plus! for Live Messenger (/forumdisplay.php?fid=4)
+---- Forum: Scripting (/forumdisplay.php?fid=39)
+----- Thread: Xniff help (/showthread.php?tid=69314)

Xniff help by effection on 12-10-2006 at 12:15 AM

I haven't used this in a while but the example packet sniffer has stopped working. I have downloaded it again but still no luck.

code:
var xniff = new ActiveXObject( "w00t.Xniff" );  // create the activexobject
xniff.IP = getLocalIp(); // assign your last local IP address, automatically detected (if you want to force a specific ip to listen to, just set it as a string 'XXX.XXX.XXX.XXX')
xniff.Start();  //start monitoring

var etc = function(){ // jscript tricks
                function xniff::OnData  (srcip,srcport,destip,destport,data,datalen){ // event raised by the activexobject when data is available, arguments are obvious i think
                  if (srcport == '1863') if (datalen > 0) // incoming from port 1863 (msn server)
                     Debug.Trace('« (' + datalen + ') ' + data); // show in in the debug window
                 
                  if (destport == '1863') if (datalen > 0) // outcoing packet to msn server
                     Debug.Trace('» (' + datalen + ') ' + data); // show again
                 
               
                }
}

etc();

function getLocalIp(){ //retrieves your local ip. if there is more than one, the last one is used. thanks Plik for the function
    var wmiObj = new ActiveXObject('WbemScripting.SWbemLocator');
    var wmiInst = wmiObj.ConnectServer('.', "root\\cimv2");
    wmiInst.Security_.ImpersonationLevel = 3;

    var col = wmiInst.ExecQuery('Select * from Win32_NetworkAdapterConfiguration');
    var colEnum = new Enumerator(col);

    var ipAddr;

    for (; !colEnum.atEnd(); colEnum.moveNext()){
        var objIp = colEnum.item();
        var addr = objIp.IPAddress(0);
        if((typeof addr == 'string') && addr.match(/\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}/)){
            ipAddr = addr;
        }
    }

    return ipAddr;
}

function OnEvent_Initialize(MessengerStart){}
function OnEvent_Uninitialize(MessengerExit){xniff.Stop();}

Error:
code:
Script is starting
Error: unknown.
       Line: 1. Code: -2147024770.
Script has failed to start
any help would be great
RE: Xniff help by brian on 12-10-2006 at 12:51 AM

I'm not sure and I haven't really done any MP! scripting but shouldn't all these loading lines be in the OnEvent_Initialize(MessengerStart) function so that they will be executed once MSN/WLM starts?


RE: Xniff help by Spunky on 12-10-2006 at 05:03 AM

quote:
Originally posted by brian
I'm not sure and I haven't really done any MP! scripting but shouldn't all these loading lines be in the OnEvent_Initialize(MessengerStart) function so that they will be executed once MSN/WLM starts?

Thats not how it works. :p Make sure you have the file in the right folder and that it is registered when the script pack is imported
RE: Xniff help by effection on 12-10-2006 at 10:52 AM

it did not come as a script pack either but i do have the component in the ame directory as this


RE: Xniff help by Spunky on 12-10-2006 at 01:01 PM

You may need to register the Xniff.ocx file then using Regsvr32 (there are many guides for doing this on the internet and possibly a few on the forum somewhere)


RE: Xniff help by effection on 12-10-2006 at 04:08 PM

its registered but still the same problems


RE: Xniff help by CookieRevised on 12-11-2006 at 02:22 AM

As the error states, it is on the first line:

var xniff = new ActiveXObject( "w00t.Xniff" );

The only thing which can be wrong with it is that the ActiveX is _not_ properly registered.

Locate the Xniff ActiveX ocx and then register it using regsvr32 as SpunkyLoveMuff said.

regsvr32 "C:\path_to_xniff\xniff.ocx"


PS:

quote:
Originally posted by SpunkyLoveMuff
Make sure you have the file in the right folder
It does not matter where ActiveX DLLs or OCXs are located. Partially the point in them needing to be registered is that they can be located elsewhere. Registering such an ActiveX adds an entry in the registry to the location of the ActiveX. So it can well be located anywhere on your hard disk, it doesn't need to be in the same directory as the program it uses.
RE: Xniff help by Spunky on 12-11-2006 at 03:20 AM

I meant more specifically in the right folder (as in not a subfolder) within the script package as it wouldn't register it when it was imported and it would need to be a slightly different path to register the fil by regsvr32


RE: Xniff help by effection on 12-11-2006 at 06:41 PM

no it is registered fine if you hadn't read on