Darren Kulp > Symantec-PCAnywhere-Profile-0.06 > Symantec::PCAnywhere::Profile::CHF

Download:
Symantec-PCAnywhere-Profile-0.06.tar.gz

Dependencies

Annotate this POD

View/Report Bugs
Module Version: 0.06   Source  

NAME ^

Symantec::PCAnywhere::Profile::CHF - Encodes and decodes Symantec pcAnywhere connection profiles

SYNOPSIS ^

        use Symantec::PCAnywhere::Profile::CHF;
        
        # Load CHF file from file
        my $chf = new Symantec::PCAnywhere::Profile::CHF(filename => $filename);
        
        # Load CHF data directly
        my $chf = new Symantec::PCAnywhere::Profile::CHF(data => $data);
        
        my $results = $chf->get_attrs(
                Location,
                Password,
                Hostname,
                DataPort
        );
        while (my ($attr, $value) = each (%$results)) {
                print "$attr\t= $value\n";
        }
        
        # Create an empty CHF
        my $chf = new Symantec::PCAnywhere::Profile::CHF;
        $chf->set_attrs(
                PhoneNumber     => 7652314,
                AreaCode        => 999,
                IPAddress       => '10.10.128.99',
                ControlPort     => 5900
        );
        
        # Print the binary CHF file
        print $chf->encode;

DESCRIPTION ^

This module is responsible for decoding of a pcAnywhere .CHF file that describes a remote system the client wishes to connect to. CHF files seem to always be the same size (3308 bytes), which is helpful for decoding.

See this module's base class (Symantec::PCAnywhere::Profile) for more information on the decoding mechanism.

VERSION ^

Version 0.06

METHODS ^

Here is the public API; see this module's base class documentation for more information on the inner workings of the encoding and decoding process, as well as additional useful methods.

new
        my $chf = new Symantec::PCAnywhere::Profile::CHF;
        my $chf = new Symantec::PCAnywhere::Profile::CHF(-filename => $filename);
        my $chf = new Symantec::PCAnywhere::Profile::CHF(filename => $filename);
        my $chf = new Symantec::PCAnywhere::Profile::CHF(-data => $chfdata);
        my $chf = new Symantec::PCAnywhere::Profile::CHF(data => $chfdata);

The "new" constructor takes any number of arguments and sets the appropriate flags internally before returning a new object. The arguments are considered as a list of key-value pairs which are inserted into the object data.

_decode_pca_file

Provided with XOR-encoded CHF data, un-obscure the whole thing into the "clear" format. The return value is the same length as the input string, but after XOR decoding.

_encode_pca_file

Provided with XOR-unencoded CHF data, obscure the whole thing into the "encrypted" format. The return value is the same length as the input string, but after XOR encoding.

SEE ALSO ^

This module is based very heavily on the work of Stephen Friedl at http://www.unixwiz.net/tools/pcainfo.html.

TO DO ^

Very early in the file is a "description" field that we are not quite decoding properly.

The "hostname" and "IP Address" fields seem to be redundant, and this requires more research.

There are still plenty of big unused fields in the .CHF file, and we ought to find out what they are used for. Try looking at the other protocols (ISDN, SPX, NETBIOS, etc.)

Based on http://www.cpan.org/modules/00modlist.long.html#ID2_Guidelinesf, refactor code to pass references to lists instead of lists.

BUGS / CAVEATS ^

They're in there somewhere. Let me know what you find.

AUTHOR ^

Darren Kulp, <kulp@thekulp.com>, based on code from Stephen J. Friedl, (http://unixwiz.net/)

COPYRIGHT AND LICENSE ^

This code is in the public domain. Contains code placed in the public domain 2002 by Stephen Friedl.

"Symantec" and "pcAnywhere" are trademarks of Symantec Corp.

syntax highlighting: