access ELF header

Posted on 2004-11-24
Last Modified: 2008-03-17
can somebody show me an exmaple how to read elf head in a elf file? Thanks.
Question by:rongz
    LVL 45

    Expert Comment

    Hi rongz,

    you mean read the contents of the executable in the executable?
    If you are using C, fopen it (argv[0]) and use fread to read until EOF .... That should suffice


    Author Comment

    no, I mean how to access ELF header (e.g. retrieve information encoded in ELF header) in an ELF format file.
    LVL 45

    Accepted Solution


    or go to and downloaf ELF file format. All you need to do is fopen the ELF file and fread(or fscanf) the header into the structs which are defined in the file format specification

    Featured Post

    Enabling OSINT in Activity Based Intelligence

    Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

    Join & Write a Comment

    Suggested Solutions

    Have you ever been frustrated by having to click seven times in order to retrieve a small bit of information from the web, always the same seven clicks, scrolling down and down until you reach your target? When you know the benefits of the command l…
    The purpose of this article is to demonstrate how we can upgrade Python from version 2.7.6 to Python 2.7.10 on the Linux Mint operating system. I am using an Oracle Virtual Box where I have installed Linux Mint operating system version 17.2. Once yo…
    To add imagery to an HTML email signature, you have two options available to you. You can either add a logo/image by embedding it directly into the signature or hosting it externally and linking to it. The vast majority of email clients display l…
    In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

    730 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    18 Experts available now in Live!

    Get 1:1 Help Now