Developers

Automating an OmniEngine using Perl

A place for developers to exchange information about extending OmniPeek, and ask technical questions about plugins on MyPeek, scripting, and programming.
Spacepacket
Posts: 78
Joined: Thu May 22, 2008 9:36 am

Automating an OmniEngine using Perl

Postby Spacepacket » Wed Jun 16, 2010 3:43 pm

Below is a Perl script that will create a capture from a capture template. The capture template also specifies a filter that is dynamically loaded as well.

use Win32::OLE;

$os = Win32::OLE->new('EPRCmdAPI.WPRemoteCmdMgr');
$os->Connect("127.0.0.1", 6367, 30000 );
$xf = Win32::OLE->new('Microsoft.XMLDOM');
$xf->async(0);
$xt = Win32::OLE->new("EPRCmdAPI.xmlTranslate");
$xf->Load("filters.flt");
$tf = $xt->Load( $xf, $xf->lastChild, "PeekFilters.FilterCollection" );
$os->SetFilters( $tf, 1 );
$ct = Win32::OLE->new("Microsoft.XMLDOM");
$ct->Load("capturetemplate.xml");
$cg = $os->CreateNewCaptureFromTemplate( $ct );
$os->StartCapture( $cg );
print "Done";

The script depends on the filter and capture template files that are included in the following vb script:

https://mypeek.wildpackets.com/view_sub ... .php?id=96

Return to “Developers”

Who is online

Users browsing this forum: Bing [Bot] and 1 guest