ELF::Extract::Sections::Section - An Objective reference to a section in an ELF file.
version 1.001000
use ELF::Extract::Sections::Section; my $s = ELF::Extract::Sections::Section->new( source => '/foo/bar.pl', name => '.comment', offset => 45670, size => 1244, ); # prints a human friendly description print $s->to_string; # does likewise. print "$s"; # Compare with another section ( preferably in the same file, meaningless otherwise ) if( $s->compare( $y , 'name' ) ){ } # Unimplemented $s->write_to ( file => '/tmp/out.txt' ); # Retuns the sections contents as a string print $s->contents;
Generally Intended for use by ELF::Extract::Sections as a meta-structure for tracking data, but generated objects are returned to you for you to deal with
new
my $section = ELF::Extract::Sections::Section->new( %ATTRIBUTES );
4 Parameters, all required.
Returns an ELF::Extract::Sections::Section object.
ELF::Extract::Sections::Section
to_string
my $string = $section->to_string;
returns Str description of the object
Str
[ Section {name} of size {size} in {file} @ {start} to {stop} ]
compare
my $cmp_result = $section->compare( other => $other, field => $field );
2 Parameters, both required
ELF::Extract::Sections::Section: Item to compare with
Str['name','offset','size']: Field to compare with.
Str['name','offset','size']
returns Int of comparison result, between -1 and 1
Int
write_to
my $boolean = $section->write_to( file => $file );
UNIMPLEMENTED AS OF YET
Str|Path::Tiny: File target to write section contents to.
Path::Tiny
contents
my $string = $section->contents;
returns Str of binary data read out of file.
source
Str|Path::Tiny: Either a String or a Path::Tiny instance pointing to the file in mention.
name
Str: The ELF Section Name
offset
Int: Position in bytes relative to the start of the file.
size
Int: The ELF Section Size
Kent Fredric <kentnl@cpan.org>
This software is copyright (c) 2015 by Kent Fredric <kentfredric@gmail.com>.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
To install ELF::Extract::Sections, copy and paste the appropriate command in to your terminal.
cpanm
cpanm ELF::Extract::Sections
CPAN shell
perl -MCPAN -e shell install ELF::Extract::Sections
For more information on module installation, please visit the detailed CPAN module installation guide.