Skip to content


Subversion checkout URL

You can clone with
Download ZIP
Extract Data Verbatim from ELF Binaries
Perl Groff
Failed to load latest commit information.
LICENCES Added license data for binary .so's used for testing. ( See LICENSE.t…
examples criticisms/pod errors
inc Add range checking for extracted objdump versions. 2.17.* and lower a…
lib/ELF/Extract v1.001004
maint Simplify getting $self
misc post-release cleanup
t Use the smallest elf file weve got for performance reasons
.gitignore Installation: White/Blacklist version string detection
.mailmap Very many much radical moderns
.perltidyrc add perltidyrc
.travis.yml Very many much radical moderns
CONTRIBUTING.pod Very many much radical moderns
Changes v1.001004
INSTALL.SKIP Very many much radical moderns
LICENSE.tests Added license data for binary .so's used for testing. ( See LICENSE.t…
Makefile.PL post-release cleanup
README.mkdn post-release cleanup
dist.ini Require a new enough Term::ANSIColor to get bright_yellow
perlcritic.rc Simplify getting $self
weaver.ini Tidy up method/attribute naming to be linkable



ELF::Extract::Sections - Extract Raw Chunks of data from identifiable ELF Sections


version 1.001005


use ELF::Extract::Sections;

# Create an extractor object for
my $extractor = ELF::Extract::Sections->new( file => '/path/to/' );

# Scan file for section data, returns a hash
my %sections  = ${ $extractor->sections };

# Retreive the section object for the comment section
my $data      = $sections{.comment};

# Print the stringified explanation of the section
print "$data";

# Get the raw bytes out of the section.
print $data->contents  # returns bytes



my $object = ELF::Extract::Sections->new( file => FILENAME );

Creates A new Section Extractor object with the default scanner

my $object = ELF::Extract::Sections->new( file => FILENAME , scanner => 'Objdump' )

Creates A new Section Extractor object with the specified scanner


my $sections = $object->sorted_sections( field => SORT_BY )

Returns an ArrayRef sorted by the SORT_BY field, in the default order.

my $sections = $object->sorted_sections( field => SORT_BY, descending => DESCENDING );

Returns an ArrayRef sorted by the SORT_BY field. May be Ascending or Descending depending on requirements.


Optional parameters. True for descending, False or absent for ascending.


A String of the field to sort by. Valid options at present are


The Section Name


The Sections offset relative to the start of the file.


The Size of the section.



Returns the file the section data is being created for.


Returns a HashRef of the available sections.


Returns the name of the default scanner plug-in


    1. Beta Software

    This code is relatively new. It exists only as a best attempt at present until further notice. It has proved as practical for at least one application, and this is why the module exists. However, it can't be guaranteed it will work for whatever you want it to in all cases. Please report any bugs you find.

    1. Feature Incomplete

    This only presently has a very bare-bones functionality, which should however prove practical for most purposes. If you have any suggestions, please tell me via "report bugs". If you never seek, you'll never find.

    1. Humans

    This code is written by a human, and like all human code, it sucks. There will be bugs. Please report them.


This library uses Log::Log4perl. To see more verbose processing notices, do this:

use Log::Log4perl qw( :easy );

For convenience to make sure you don't happen to miss this fact, we never initialize Log4perl ourselves, so it will spit the following message if you have not set it up:

Log4perl: Seems like no initialization happened. Forgot to call init()?

To suppress this, just do

use Log::Log4perl qw( :easy );

I request however you don't do that for modules intended to be consumed by others without good cause.


Kent Fredric <>


This software is copyright (c) 2015 by Kent Fredric <>.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.

Something went wrong with that request. Please try again.