Main > Programming > Assembler Tools >

ELFIO 1.0.3

ELFIO 1.0.3

Sponsored Links

ELFIO 1.0.3 Ranking & Summary

RankingClick at the star to rank
Ranking Level
User Review: 0 (0 times)
File size: 0.30 MB
Platform: Any Platform
License: LGPL (GNU Lesser General Public License)
Price:
Downloads: 1456
Date added: 2005-11-09

ELFIO 1.0.3 description

ELFIO is a C++ library for reading and generating files in the ELF binary format. This library is unique and not based on any other product. It is also platform independent. The library uses standard ANSI C++ constructions and runs on a wide variety of architectures.
While the librarys implementation does make your work easier: a basic knowledge of the ELF binary format is required. Information about ELF is included in the TIS (Tool Interface Standards) documentation you received with the librarys source code.
The ELFIO library consists of two independent parts: ELF File Reader (IELFI) and ELF Producer (IELFO). Each is represented by its own set of interfaces. The library does not contain any classes that need to be explicitly instantiated. ELFIO itself provides the interfaces that are used to access the librarys functionality.
To make the program recognize all ELFIO interface classes, the ELFIO.h header file is needed. This header file defines all standard definitions from the TIS documentation.
#include < ELFIO.h >
This chapter will explain how to work with the reader component of the ELFIO library. The first step is to get a pointer onto the ELF File Reader:
IELFI* pReader;
ELFIO::GetInstance()->CreateELFI( &pReader );
Now, that there is a pointer on the IELFI interface: initialize the object by loading the ELF file:
char* filename = "file.o";
pReader->Load( filename );
From here, there is access to the ELF header. This makes it possible to request file parameters such as encoding, machine type, entry point, etc. To get the encoding of the file use:
unsigned char encoding = pReader->GetEncoding();
Please note: standard types and constants from the TIS document are defined in the ELFTypes.h header file. This file is included automatically into the project. For example: ELFDATA2LSB and ELFDATA2MSB constants define a value for little and big endian encoding.
ELF binary files consist of several sections. Each section has its own responsibility: some contain executable code; others describe program dependencies; others symbol tables and so on. See the TIS documentation for a full description of each section.
To see how many sections the ELF file contains, including their names and sizes, is demonstated in the following code:
int nSecNo = pReader->GetSectionsNum();
for ( int i = 0; i < nSecNo; ++i ) { // For all sections
const IELFISection* pSec = pReader->GetSection( i );
std::cout << pSec->GetName() <<
<< pSec->GetSize() << std::endl;
pSec->Release();
}
First, the number of sections are received; next, a pointer on the IELFISection interface. Using this interface, access is gained to the different section attributes: size, type, flags and address. To get a buffer that contains the sections bytes use the GetData() member function of this interface. See the IELFISection declaration for a full description of the IELFISection interface.
After the section data is received through the GetData() function call, the data can be manipulated. There are special sections that provide information in predefined forms. The ELFIO library processes these sections. The library provides a set of section readers that understand these predefined formats and how to process their data. The ELFIO.h header file currently defines the types of readers as:
enum ReaderType {
ELFI_STRING, // Strings reader
ELFI_SYMBOL, // Symbol table reader
ELFI_RELOCATION, // Relocation table reader
ELFI_NOTE, // Notes reader
ELFI_DYNAMIC, // Dynamic section reader
ELFI_HASH // Hash
};
How to use the symbol table reader will be demonstated in the following example:
First, get the symbol section:
const IELFISection* pSec = pReader->GetSection( .symtab );
Second, create a symbol section reader:
IELFISymbolTable* pSymTbl = 0;
pReader->CreateSectionReader( IELFI::ELFI_SYMBOL,
pSec,
(void**)&pSymTbl );
And finally, use the section reader to process all entries (print operations are omitted):
std::string name;
Elf32_Addr value;
Elf32_Word size;
unsigned char bind;
unsigned char type;
Elf32_Half section;
int nSymNo = pSymTbl->GetSymbolNum();
if ( 0 < nSymNo ) {
for ( int i = 0; i < nSymNo; ++i ) {
pSymTbl->GetSymbol( i, name, value, size,
bind, type, section );
}
}
pSymTbl->Release();
pSec->Release();
All interfaces from the ELFIO library should be freed after use. Each interface has a Release() function. It is not enough to only free the high level interface because one of the sections or readers will still be held and its resources will not be cleared.
The interfaces are freed immediately after their use, in this example we will free only the pReader object:
pReader->Release();
The source code for the ELF Dumping Utility can be found in the "Examples" directory; included there are more examples on how to use different ELFIO reader interfaces.
Enhancements:
- Fixes endian conversion in the ELFIRelocation and ELFINote sections adapters.

ELFIO 1.0.3 Screenshot

Advertisements

ELFIO 1.0.3 Keywords

Bookmark ELFIO 1.0.3

Hyperlink code:
Link for forum:

ELFIO 1.0.3 Copyright

WareSeeker periodically updates pricing and software information of ELFIO 1.0.3 full version from the publisher, so some information may be slightly out-of-date. You should confirm all information before relying on it. Software piracy is theft, Using crack, password, serial numbers, registration codes, key generators is illegal and prevent future development of ELFIO 1.0.3 Edition. Download links are directly from our publisher sites, torrent files or links from rapidshare.com, yousendit.com or megaupload.com are not allowed

Allok Video Splitter 2.2.0 Review:

Name (Required)
Email(Required)
Captcha
Featured Software

Want to place your software product here?
Please contact us for consideration.

Contact WareSeeker.com
Related Software
Eukleides is a Euclidean geometry drawing language. Free Download
EZMorph is simple Java library for transforming an Object to another Object. Free Download
TextSort application allows you to sort the lines of a a text alphabetically. Free Download
Lexter is a real-time word puzzle for text terminals. Free Download
libany2uni is a library to extract raw unicode text from any written documents (office documents). Free Download
Mynetmonitor is a gtk2 net monitor with system tray support. Free Download
PloneFormGen provides a generic Plone form generator using fields, widgets and validators from Archetypes. Free Download
gnuvd is a command-line client to the online Van Dale dictionary for the Dutch language. Free Download