亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? tutorial.docbook

?? C++寫的,提供操作ELF格式文件的API
?? DOCBOOK
字號(hào):
<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook V3.1//EN" [
]>

<book>
  <bookinfo>
    <date>2002-5-25</date>
    <title>ELFIO</title>
    <subtitle>Tutorial</subtitle>
    <authorgroup>
      <author>
        <firstname>Allan</firstname>
        <surname>Finch</surname>
      </author>
      <author>
        <firstname>Serge</firstname>
        <surname>Lamikhov-Center</surname>
      </author>
    </authorgroup>
  </bookinfo>
  <toc></toc>
  <preface id="introduction">
    <title>Introduction</title>
    <para>
      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.
    </para>
    <para>
      While the library's 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 library's source code.
    </para>
  </preface>
  <chapter id="get-started">
    <title>Getting Started With ELFIO</title>

    <sect1><title>Initialization</title>
      <para>
        The ELFIO library consists of two independent parts: ELF File Reader
        (<interfacename>IELFI</interfacename>)
        and ELF Producer (<interfacename>IELFO</interfacename>).
        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 library's functionality.
      </para>
      <para>
        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.
<programlisting><![CDATA[
    #include <ELFIO.h>
]]></programlisting>
      </para>
      <para>
        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:
<programlisting><![CDATA[
    IELFI* pReader;
    ELFIO::GetInstance()->CreateELFI( &pReader );
]]></programlisting>
      </para>
      <para>
        Now, that there is a pointer on the
        <interfacename>IELFI</interfacename> interface: initialize the
        object by loading the ELF file:
<programlisting><![CDATA[
    char* filename = "file.o";
    pReader->Load( filename );
]]></programlisting>
      </para>
      <para>
        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:
<programlisting><![CDATA[
    unsigned char encoding = pReader->GetEncoding();
]]></programlisting>
      </para>
      <para>
        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.
    </para>
    </sect1>

    <sect1><title>ELF File Sections</title>
      <para>
        ELF binary files consist of several sections. Each section has it's 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.
      </para>
      <para>
        To see how many sections the ELF file contains, including their
        names and sizes, is demonstated in the following code:
<programlisting><![CDATA[
    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();
    }
]]></programlisting>
      </para>
      <para>
        First, the number of sections are received; next, a pointer
        on the <interfacename>IELFISection</interfacename> interface.
        Using this interface, access is gained to the different section
        attributes: size, type, flags and address.
        To get a buffer that contains the section's bytes use the
        <methodname>GetData()</methodname> member function of this interface.
        See the <interfacename>IELFISection</interfacename> declaration for
        a full description of the <interfacename>IELFISection</interfacename>
        interface.
      </para>
    </sect1>

    <sect1><title>Section Readers</title>
      <para>
        After the section data is received through the
        <methodname>GetData()</methodname> 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:
<programlisting><![CDATA[
    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
    };
]]></programlisting>
      </para>
      <para>
        How to use the symbol table reader will be demonstated in the
        following example:
      </para>
      <para>
        First, get the symbol section:
<programlisting><![CDATA[
    const IELFISection* pSec = pReader->GetSection( ''.symtab'' );
]]></programlisting>
      </para>
      <para>
        Second, create a symbol section reader:
<programlisting><![CDATA[
    IELFISymbolTable* pSymTbl = 0;
    pReader->CreateSectionReader( IELFI::ELFI_SYMBOL,
                                  pSec,
                                  (void**)&pSymTbl );
]]></programlisting>
      </para>
      <para>
        And finally, use the section reader to process all entries
        (print operations are omitted):
<programlisting><![CDATA[
    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();
]]></programlisting>
      </para>
    </sect1>

    <sect1><title>Finalization</title>
      <para>
        All interfaces from the ELFIO library should be freed after
        use. Each interface has a <methodname>Release()</methodname> 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.
      </para>
      <para>
        The interfaces are freed immediately after their use, in this
        example we will free only the pReader object:
<programlisting><![CDATA[
    pReader->Release();
]]></programlisting>
      </para>
    </sect1>
  </chapter>
  <chapter id="elfdump">
    <title>ELFDump Utility</title>
    <para>
      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.
    </para>
  </chapter>
  <chapter id="ielfo">
    <title>
      <interfacename>IELFO</interfacename> - ELF File Producer Interface
    </title>
    <para>
      The ELFIO library can help you build a very short ELF executable file.
      This chapter shows how to build an executable file that will run on
      x86 Linux machines and print "Hello World!" on your console.
    </para>
    <para>
      Just as with the reader, the first step is to get
      a pointer onto the ELF File Writer (Producer):
<programlisting><![CDATA[
    IELFO* pELFO;
    ELFIO::GetInstance()->CreateELFO( &pELFO );
]]></programlisting>
    </para>
    <para>
      Before continuing, the library must be informed about the main
      attributes of the executable file to be built. To do this, declare
      that the executable ELF file will run on a 32 bit x86 machine; has little
      endian encoding and uses the current version of the ELF file format:
<programlisting><![CDATA[
    // You can't proceed without this function call!
    pELFO->SetAttr( ELFCLASS32, ELFDATA2LSB, EV_CURRENT,
                    ET_EXEC, EM_386, EV_CURRENT, 0 );
]]></programlisting>
    </para>
    <para>
      Some sections of an ELF executable file should reside in the program
      segments. To create this loadable segment call the
      <methodname>AddSegment()</methodname> function.
<programlisting><![CDATA[
    // Create a loadable segment
    IELFOSegment* pSegment = pELFO->AddSegment( PT_LOAD,
                                                0x08040000,
                                                0x08040000,
                                                PF_X | PF_R,
                                                0x1000 );
]]></programlisting>
    </para>
    <para>
      The following segment serves as a placeholder for our code section.
      To create this code section call the AddSection() function:
<programlisting><![CDATA[
    // Create code section
    IELFOSection* pTextSec = pELFO->AddSection( ".text",
                                   SHT_PROGBITS,
                                   SHF_ALLOC | SHF_EXECINSTR,
                                   0,
                                   0x10,
                                   0 );
]]></programlisting>
    </para>
    <para>
      Then, add the executable code for the section:
<programlisting><![CDATA[
    char text[] =
    { '\xB8', '\x04', '\x00', '\x00', '\x00',   // mov eax, 4
      '\xBB', '\x01', '\x00', '\x00', '\x00',   // mov ebx, 1
      '\xB9', '\xFD', '\x00', '\x04', '\x08',   // mov ecx, msg
      '\xBA', '\x0E', '\x00', '\x00', '\x00',   // mov edx, 14
      '\xCD', '\x80',                           // int 0x80
      '\xB8', '\x01', '\x00', '\x00', '\x00',   // mov eax, 1
      '\xCD', '\x80',                           // int 0x80
      '\x48', '\x65', '\x6C', '\x6C', '\x6F',   // db 'Hello'
      '\x2C', '\x20', '\x57', '\x6F', '\x72',   // db ', Wor'
      '\x6C', '\x64', '\x21', '\x0A'            // db 'ld!', 10
    };
    pTextSec->SetData( text, sizeof( text ) );
]]></programlisting>
    </para>
    <para>
      Next, this code section is put into the loadable segment:
<programlisting><![CDATA[
    // Add code section into program segment
    pSegment->AddSection( pTextSec );
    pTextSec->Release();
    pSegment->Release();
]]></programlisting>
    </para>
    <para>
      Finally, define the start address of the program
      and create the result file:
<programlisting><![CDATA[
    // Set program entry point
    pELFO->SetEntry( 0x08040000 );
    // Create ELF file
    pELFO->Save( "test.elf" );
    pELFO->Release();
]]></programlisting>
    </para>
    <para>
      Please note: Call the <methodname>Release()</methodname> functions
      for each interface you have used.
      This will free all resources the ELFIO library has created.
    </para>
    <para>
      Now compile the program and run it. The result is a new ELF file
      called "test.elf". The size of this working executable file is only
      267 bytes! Run it on your Linux machine with the following commands:
<programlisting><![CDATA[
    [Writer]$ ./Writer
    [Writer]$ chmod +x test.elf
    [Writer]$ ./test.elf
    Hello, World!
]]></programlisting>
    </para>
    <para>
      The full text for this program can be found in the "Writer" directory.
      Also, in the "Examples" directory, two other programs "WriteObj"
      and "WriteObj2" demonstrate the creation of ELF object files.
    </para>
  </chapter>
</book>

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美精品一区在线观看| 国产精品另类一区| 岛国精品在线播放| 免费三级欧美电影| 成人欧美一区二区三区白人 | 日本成人超碰在线观看| 国产精品美日韩| 欧美成人精品3d动漫h| 色综合久久久久网| 国产成人av电影在线| 日韩av在线发布| 亚洲麻豆国产自偷在线| 欧美激情在线免费观看| 欧美一区二区视频在线观看2022| 91色.com| 成人激情校园春色| 国产美女一区二区| 另类小说欧美激情| 视频一区视频二区中文字幕| 一区二区三区四区乱视频| 国产色一区二区| 精品国产一区二区三区忘忧草| 欧美视频在线一区二区三区 | 国产精一品亚洲二区在线视频| 亚洲成人av一区| 一区二区三区中文字幕精品精品 | 欧美日韩aaaaa| 91久久久免费一区二区| 99re这里都是精品| 成人夜色视频网站在线观看| 国产真实精品久久二三区| 日韩高清不卡在线| 日韩精品欧美成人高清一区二区| 亚洲一区免费视频| 亚洲自拍都市欧美小说| 一区二区三区不卡在线观看| 亚洲欧美精品午睡沙发| 日韩美女啊v在线免费观看| 国产精品美女久久久久久久久久久 | 国产精品天干天干在线综合| 精品国产乱码久久久久久闺蜜 | 欧美成人猛片aaaaaaa| 日本精品一区二区三区四区的功能| 丁香婷婷综合网| 国产精品一区二区不卡| 国产精品资源在线看| 国产高清在线精品| 国产69精品久久777的优势| 成人性生交大片免费看中文网站| 国产精品1024| 成人禁用看黄a在线| 99精品在线免费| 欧美综合视频在线观看| 在线电影国产精品| 欧美电影免费观看高清完整版在线观看 | 国产精品三级av| 亚洲欧洲一区二区在线播放| 亚洲免费看黄网站| 亚洲444eee在线观看| 蜜臀av在线播放一区二区三区| 久久99精品久久久久久国产越南| 精品夜夜嗨av一区二区三区| 国产ts人妖一区二区| 色婷婷国产精品| 91精品午夜视频| 久久精品视频在线看| 国产精品福利一区| 午夜精品视频一区| 国产精品自拍av| 色8久久精品久久久久久蜜| 欧美精品久久天天躁| 久久久亚洲欧洲日产国码αv| 中文字幕不卡在线| 亚洲成人在线观看视频| 久久99精品久久久久婷婷| 成人av在线电影| 欧美日韩精品二区第二页| 欧美精品一区二区久久婷婷 | 免费美女久久99| 国产福利一区在线| 欧美性大战久久| 日韩欧美国产综合| 综合婷婷亚洲小说| 秋霞国产午夜精品免费视频| 国产91丝袜在线播放| 欧美日韩美女一区二区| 久久精品欧美日韩精品| 亚洲综合999| 丰满少妇在线播放bd日韩电影| 欧美日韩和欧美的一区二区| 国产日韩精品一区二区三区在线| 亚洲影视在线播放| 国产在线播精品第三| 欧美色男人天堂| 中文字幕第一区第二区| 日韩黄色一级片| 91日韩在线专区| 久久精品人人做人人综合 | 在线观看不卡一区| 久久久精品欧美丰满| 成人激情av网| 日韩欧美国产一区二区三区| 一区二区在线看| 高清不卡在线观看| 精品国产露脸精彩对白| 丝袜诱惑亚洲看片| 色猫猫国产区一区二在线视频| 国产夜色精品一区二区av| 亚洲chinese男男1069| 91小视频在线免费看| 久久精品亚洲麻豆av一区二区| 视频精品一区二区| 欧美亚州韩日在线看免费版国语版| 国产调教视频一区| 国内偷窥港台综合视频在线播放| 欧美日韩国产另类不卡| 亚洲乱码国产乱码精品精的特点| 成人一区二区三区在线观看| 久久久久久久久久久99999| 日韩国产精品91| 欧美久久免费观看| 亚洲第一搞黄网站| 欧美性感一区二区三区| 亚洲男人的天堂在线aⅴ视频| 成人91在线观看| 中文一区二区完整视频在线观看| 国产做a爰片久久毛片| 日韩免费观看高清完整版| 视频在线观看国产精品| 欧美日韩高清一区二区三区| 亚洲国产欧美日韩另类综合| 在线看一区二区| 亚洲一区二区三区四区在线观看| 色偷偷久久一区二区三区| 日韩理论片中文av| 色婷婷av一区二区| 丁香网亚洲国际| 欧美国产欧美亚州国产日韩mv天天看完整| 激情五月激情综合网| 久久综合色综合88| 国产麻豆日韩欧美久久| 国产亚洲美州欧州综合国| 国产高清不卡一区| 国产精品国产自产拍高清av王其| 成人av先锋影音| 亚洲激情在线激情| 欧美日韩在线播放三区四区| 婷婷久久综合九色综合绿巨人| 3atv在线一区二区三区| 久久精品国产精品青草| 久久精品一区二区三区不卡牛牛| 国产91在线|亚洲| 亚洲精品一二三四区| 欧美精选午夜久久久乱码6080| 日韩av在线发布| 久久综合999| a4yy欧美一区二区三区| 亚洲一区二区免费视频| 欧美精品在线观看播放| 久久国产免费看| 中文字幕第一区二区| 在线区一区二视频| 蜜桃视频免费观看一区| 久久精品欧美一区二区三区麻豆| av电影在线观看不卡| 亚洲一卡二卡三卡四卡五卡| 欧美一区二区三区免费大片| 国产福利一区二区| 亚洲在线观看免费视频| 欧美一区二区三区在| 国产成都精品91一区二区三| 亚洲精品国产一区二区三区四区在线| 91.com视频| 成人精品免费网站| 午夜欧美大尺度福利影院在线看| 久久色在线观看| 91福利资源站| 国产精品一二三在| 亚洲国产成人91porn| 久久久99精品久久| 欧美日韩一区小说| 豆国产96在线|亚洲| 丝袜国产日韩另类美女| 国产精品乱人伦| 欧美一个色资源| 91浏览器在线视频| 极品少妇一区二区| 亚洲在线视频免费观看| 国产亚洲欧美在线| 6080午夜不卡| 99久久99久久免费精品蜜臀| 蜜桃久久av一区| 亚洲精品国产精华液| 久久久蜜桃精品| 欧美一区二区播放| 色94色欧美sute亚洲线路二| 国产一区二区91| 日韩电影一二三区| 亚洲精品写真福利| 中文一区二区在线观看|