Projects STRLCPY LIEF Commits ef95d0ab
🤬
  • ■ ■ ■ ■
    CMakeLists.txt
    skipped 35 lines
    36 36   
    37 37  # LIEF version
    38 38  set(LIEF_VERSION_MAJOR 0)
    39  -set(LIEF_VERSION_MINOR 7)
     39 +set(LIEF_VERSION_MINOR 8)
    40 40  set(LIEF_VERSION_PATCH 0)
    41 41   
    42 42  project(LIEF VERSION ${LIEF_VERSION_MAJOR}.${LIEF_VERSION_MINOR}.${LIEF_VERSION_PATCH})
    skipped 725 lines
  • ■ ■ ■ ■ ■ ■
    README.md
    skipped 19 lines
    20 20   </a>
    21 21   &nbsp;
    22 22   <a href="https://github.com/lief-project/LIEF/releases">
    23  - <img src="https://img.shields.io/badge/release-0.7.0-brightgreen.svg?style=default">
     23 + <img src="https://img.shields.io/badge/release-0.8.0-brightgreen.svg?style=default">
    24 24   </a>
    25 25  </p>
    26 26   
    skipped 15 lines
    42 42   
    43 43  Pre-built packages from the [master](https://github.com/lief-project/LIEF/tree/master)'s **latest commit** are automatically uploaded in the [*lief-project/packages*](https://github.com/lief-project/packages) repository:
    44 44   
    45  -:warning: *master* **SDK** packages have a same name as *tagged* packages (e.g. ``LIEF-0.7.0-Linux.tar.gz``) :warning:
     45 +:warning: *master* **SDK** packages have a same name as *tagged* packages (e.g. ``LIEF-0.8.0-Linux.tar.gz``) :warning:
    46 46   
    47  -:warning: *master* **Python** package has ``dev`` suffix (e.g. ``pylief-0.7.0.dev.zip``) :warning:
     47 +:warning: *master* **Python** package has ``dev`` suffix (e.g. ``pylief-0.8.0.dev.zip``) :warning:
    48 48   
    49 49  <table>
    50 50  <tr><td colspan="4"><img src="https://img.shields.io/badge/release-master-brightgreen.svg?style=default"></td></tr>
    skipped 5 lines
    56 56  </tr>
    57 57   
    58 58  <tr>
    59  - <td><a href="https://github.com/lief-project/packages/raw/lief-master-latest/LIEF-0.7.0-Linux.tar.gz">SDK</a></td>
    60  - <td><a href="https://github.com/lief-project/packages/raw/lief-master-latest/LIEF-0.7.0-win32.zip">SDK</a></td>
    61  - <td><a href="https://github.com/lief-project/packages/raw/lief-master-latest/LIEF-0.7.0-win64.zip">SDK</a></td>
    62  - <td><a href="https://github.com/lief-project/packages/raw/lief-master-latest/LIEF-0.7.0-Darwin.tar.gz">SDK</a></td>
    63  -</tr>
    64  - 
    65  -<tr>
    66  - <td colspan="4"><p align="center"><a href="https://github.com/lief-project/packages/raw/lief-master-latest/pylief-0.7.0.dev.zip">Python</a></p></td>
     59 + <td><a href="https://github.com/lief-project/packages/raw/lief-master-latest/LIEF-0.8.0-Linux.tar.gz">SDK</a></td>
     60 + <td><a href="https://github.com/lief-project/packages/raw/lief-master-latest/LIEF-0.8.0-win32.zip">SDK</a></td>
     61 + <td><a href="https://github.com/lief-project/packages/raw/lief-master-latest/LIEF-0.8.0-win64.zip">SDK</a></td>
     62 + <td><a href="https://github.com/lief-project/packages/raw/lief-master-latest/LIEF-0.8.0-Darwin.tar.gz">SDK</a></td>
    67 63  </tr>
    68 64   
    69  -<tr><td colspan="4"><b><img src="https://img.shields.io/badge/release-0.7.0-brightgreen.svg?style=default"></b></td></tr>
    70 65  <tr>
    71  - <td><a href="https://github.com/lief-project/LIEF/releases/download/0.7.0/LIEF-0.7.0-Linux.tar.gz">SDK</a></td>
    72  - <td><a href="https://github.com/lief-project/LIEF/releases/download/0.7.0/LIEF-0.7.0-win32.zip">SDK</a></td>
    73  - <td><a href="https://github.com/lief-project/LIEF/releases/download/0.7.0/LIEF-0.7.0-win64.zip">SDK</a></td>
    74  - <td><a href="https://github.com/lief-project/LIEF/releases/download/0.7.0/LIEF-0.7.0-Darwin.tar.gz">SDK</a></td>
     66 + <td colspan="4"><p align="center"><a href="https://github.com/lief-project/packages/raw/lief-master-latest/pylief-0.8.0.dev.zip">Python</a></p></td>
    75 67  </tr>
    76 68   
     69 +<tr><td colspan="4"><b><img src="https://img.shields.io/badge/release-0.8.0-brightgreen.svg?style=default"></b></td></tr>
    77 70  <tr>
    78  - <td><a href="https://github.com/lief-project/LIEF/releases/download/0.7.0/linux_lief-0.7.0_py2.7.tar.gz">Python 2.7</a></td>
    79  - <td><a href="https://github.com/lief-project/LIEF/releases/download/0.7.0/windows_x86_lief-0.7.0_py2.7.zip">Python 2.7</a></td>
    80  - <td><a href="https://github.com/lief-project/LIEF/releases/download/0.7.0/windows_x64_lief-0.7.0_py2.7.zip">Python 2.7</a></td>
    81  - <td><a href="https://github.com/lief-project/LIEF/releases/download/0.7.0/osx_lief-0.7.0_py2.7.tar.gz">Python 2.7</a></td>
     71 + <td><a href="https://github.com/lief-project/LIEF/releases/download/0.8.0/LIEF-0.8.0-Linux.tar.gz">SDK</a></td>
     72 + <td><a href="https://github.com/lief-project/LIEF/releases/download/0.8.0/LIEF-0.8.0-win32.zip">SDK</a></td>
     73 + <td><a href="https://github.com/lief-project/LIEF/releases/download/0.8.0/LIEF-0.8.0-win64.zip">SDK</a></td>
     74 + <td><a href="https://github.com/lief-project/LIEF/releases/download/0.8.0/LIEF-0.8.0-Darwin.tar.gz">SDK</a></td>
    82 75  </tr>
    83 76   
    84  -<tr>
    85  - <td><a href="https://github.com/lief-project/LIEF/releases/download/0.7.0/linux_lief-0.7.0_py3.5.tar.gz">Python 3.5</a></td>
    86  - <td><a href="https://github.com/lief-project/LIEF/releases/download/0.7.0/windows_x86_lief-0.7.0_py3.5.zip">Python 3.5</a></td>
    87  - <td><a href="https://github.com/lief-project/LIEF/releases/download/0.7.0/windows_x64_lief-0.7.0_py3.5.zip">Python 3.5</a></td>
    88  - <td><a href="https://github.com/lief-project/LIEF/releases/download/0.7.0/osx_lief-0.7.0_py3.5.tar.gz">Python 3.5</a></td>
    89  -</tr>
    90 77   
    91 78  <tr>
    92  - <td><a href="https://github.com/lief-project/LIEF/releases/download/0.7.0/linux_lief-0.7.0_py3.6.tar.gz">Python 3.6</a></td>
    93  - <td><a href="https://github.com/lief-project/LIEF/releases/download/0.7.0/windows_x86_lief-0.7.0_py3.6.zip">Python 3.6</a></td>
    94  - <td><a href="https://github.com/lief-project/LIEF/releases/download/0.7.0/windows_x64_lief-0.7.0_py3.6.zip">Python 3.6</a></td>
    95  - <td><a href="https://github.com/lief-project/LIEF/releases/download/0.7.0/osx_lief-0.7.0_py3.6.tar.gz">Python 3.6</a></td>
     79 + <td colspan="4"><p align="center"><a href="https://github.com/lief-project/LIEF/releases/download/0.8.0/pylief-0.8.0.zip">Python</a></p></td>
    96 80  </tr>
    97 81   
    98 82   
    skipped 104 lines
  • ■ ■ ■ ■
    doc/CMakeLists.txt
    skipped 121 lines
    122 122   
    123 123   add_custom_target(doc-lief ALL
    124 124   COMMAND ${DOXYGEN_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/doxygen/Doxyfile
    125  - COMMAND ${CMAKE_COMMAND} -E env "PYTHONPATH=${PROJECT_BINARY_DIR}/api/python:$ENV{PYTHONPATH}" ${SPHINX_BUILD_BIN} ${CMAKE_CURRENT_BINARY_DIR}/sphinx-src sphinx-doc
     125 + COMMAND ${CMAKE_COMMAND} -E env "PYTHONPATH=${PROJECT_BINARY_DIR}/api/python:$ENV{PYTHONPATH}" ${SPHINX_BUILD_BIN} -a -E ${CMAKE_CURRENT_BINARY_DIR}/sphinx-src sphinx-doc
    126 126   DEPENDS pyLIEF LIB_LIEF_STATIC
    127 127   WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
    128 128   COMMENT "Generating documentation with Doxygen and Sphinx" VERBATIM)
    skipped 17 lines
  • ■ ■ ■ ■ ■ ■
    doc/sphinx/api/cpp/abstract.rst
    skipped 40 lines
    41 41   :project: lief
    42 42   
    43 43   
     44 +----------
     45 + 
     46 +Relocation
     47 +**********
     48 + 
     49 +.. doxygenclass:: LIEF::Relocation
     50 + :project: lief
     51 + 
     52 + 
    44 53  Enums
    45 54  *****
    46 55   
    skipped 18 lines
  • ■ ■ ■ ■ ■ ■
    doc/sphinx/api/python/abstract.rst
    skipped 48 lines
    49 49   :undoc-members:
    50 50   
    51 51   
     52 +----------
     53 + 
     54 +Relocation
     55 +**********
     56 + 
     57 +.. autoclass:: lief.Relocation
     58 + :members:
     59 + :inherited-members:
     60 + :undoc-members:
     61 + 
     62 + 
    52 63  Enums
    53 64  *****
    54 65   
    skipped 52 lines
  • ■ ■ ■ ■ ■
    doc/sphinx/changelog.rst
    1 1  Changelog
    2 2  =========
    3 3   
    4  -0.8.0 - XXXX
    5  -------------
     4 +0.8.0 - October 16, 2017
     5 +------------------------
     6 + 
     7 +LIEF 0.8.0 mainly improves the MachO parser and the ELF builder. It comes with `Dockerfiles <https://github.com/lief-project/Dockerlief>`_ for `CentOS <https://github.com/lief-project/Dockerlief/blob/v0.1.0/dockerlief/dockerfiles/centos.docker>`_ and `Android <https://github.com/lief-project/Dockerlief/blob/v0.1.0/dockerlief/dockerfiles/android.docker>`_.
     8 + 
     9 +`LibFuzzer <https://llvm.org/docs/LibFuzzer.html>`_ has also been integrated in the project to enhance the parsers
     10 + 
    6 11   
    7 12  Features
    8 13  ********
    skipped 1 lines
    10 15   
    11 16  :Abstract Layer:
    12 17   
    13  - * :class:`~lief.Relocation` are now abstracted from the 3 formats.
     18 + * :class:`~lief.Relocation` are now abstracted from the 3 formats - :commit:`9503f2fc7b6c14bebd4c220bda4a243d87f14bd1`
    14 19   * ``PIE`` and ``NX`` are abstracted through the :attr:`~lief.Binary.is_pie` and :attr:`~lief.Binary.has_nx` properties
     20 + * Add the :meth:`lief.Section.search` and :meth:`lief.Section.search_all` methods to look for patterns in the section's content.
    15 21   
    16 22  :ELF:
    17 23   
    18  - * DT_FLAGS and DT_FLAGS_1
     24 + * ``DT_FLAGS`` and ``DT_FLAGS_1`` are now parsed into :class:`~lief.ELF.DynamicEntryFlags` - :commit:`754b8afa2b41993e6c37d2d9003cebdccc641d23`
     25 + * Handle relocations of object files (``.o``) - :commit:`483b8dc2eabee3da29ce5e5ff2e25c2a3c9ca297`
     26 + 
     27 + * Global enhancement of the ELF builder:
     28 + 
     29 + One can now add **multiple** :class:`~lief.ELF.Section` or :class:`~lief.ELF.Segment` into an ELF:
     30 + 
     31 + .. code-block:: python
     32 + 
     33 + elf = lief.parse("/bin/cat")
     34 + 
     35 + for i in range(3):
     36 + segment = Segment()
     37 + segment.type = SEGMENT_TYPES.LOAD
     38 + segment.content = [i & 0xFF] * 0x1000
     39 + elf += segment
     40 + 
     41 + 
     42 + for i in range(3):
     43 + section = Section("lief_{:02d}".format(i))
     44 + section.content = [i & 0xFF] * 0x1000
     45 + elf += section
     46 + 
     47 + elf.write("foo")
     48 + 
     49 + .. code-block:: console
     50 + 
     51 + $ readelf -l ./foo
     52 + PHDR 0x0000000000000040 0x0000000000000040 0x0000000000000040
     53 + 0x00000000000061f8 0x00000000000061f8 R E 0x8
     54 + INTERP 0x0000000000006238 0x0000000000006238 0x0000000000006238
     55 + 0x000000000000001c 0x000000000000001c R 0x1
     56 + [Requesting program interpreter: /lib64/ld-linux-x86-64.so.2]
     57 + LOAD 0x0000000000000000 0x0000000000000000 0x0000000000000000
     58 + 0x000000000000d6d4 0x000000000000d6d4 R E 0x200000
     59 + LOAD 0x000000000000da90 0x000000000020da90 0x000000000020da90
     60 + 0x0000000000000630 0x00000000000007d0 RW 0x200000
     61 + LOAD 0x000000000000f000 0x000000000040f000 0x000000000040f000
     62 + 0x0000000000001000 0x0000000000001000 0x1000
     63 + LOAD 0x0000000000010000 0x0000000000810000 0x0000000000810000
     64 + 0x0000000000001000 0x0000000000001000 0x1000
     65 + LOAD 0x0000000000011000 0x0000000001011000 0x0000000001011000
     66 + 0x0000000000001000 0x0000000000001000 0x1000
     67 + ....
     68 + 
     69 + $ readelf -S ./foo
     70 + ...
     71 + [27] lief_00 PROGBITS 0000000002012000 00012000
     72 + 0000000000001000 0000000000000000 0 0 4096
     73 + [28] lief_01 PROGBITS 0000000004013000 00013000
     74 + 0000000000001000 0000000000000000 0 0 4096
     75 + [29] lief_02 PROGBITS 0000000008014000 00014000
     76 + 0000000000001000 0000000000000000 0 0 4096
     77 + 
     78 + .. warning::
     79 + 
     80 + There are issues with executables statically linked with libraries that use ``TLS``
     81 + 
     82 + See: :issue:`98`
     83 + 
     84 + 
     85 + 
     86 + 
     87 + One can now add **multiple** entries in the dynamic table:
     88 + 
     89 + .. code-block:: python
     90 + 
     91 + elf = lief.parse("/bin/cat")
     92 + 
     93 + elf.add_library("libfoo.so")
     94 + elf.add(DynamicEntryRunPath("$ORIGIN"))
     95 + elf.add(DynamicEntry(DYNAMIC_TAGS.INIT, 123))
     96 + elf.add(DynamicSharedObject("libbar.so"))
     97 + 
     98 + elf.write("foo")
     99 + 
     100 + .. code-block:: console
     101 + 
     102 + $ readelf -d foo
     103 + 0x0000000000000001 (NEEDED) Bibliothèque partagée: [libfoo.so]
     104 + 0x0000000000000001 (NEEDED) Bibliothèque partagée: [libc.so.6]
     105 + 0x000000000000000c (INIT) 0x7b
     106 + 0x000000000000000c (INIT) 0x3600
     107 + ...
     108 + 0x000000000000001d (RUNPATH) Bibliothèque runpath:[$ORIGIN]
     109 + 0x000000000000000e (SONAME) Bibliothèque soname: [libbar.so]
     110 + 
     111 + See :commit:`b94900ca7f500912bfe249cd534055942e28e34b`, :commit:`1e410e6c950c391f0d1a3f12cb6f8e4c9fb16539` for details.
     112 + 
     113 + * :commit:`b2d36940f60eacfa602c115cb542e11c70b6841c` enables modification of the ELF interpreter without **length restriction**
     114 + 
     115 + .. code-block:: python
     116 + 
     117 + elf = lief.parse("/bin/cat")
     118 + elf.interpreter = "/a/very/long/path/to/another/interpreter"
     119 + elf.write("foo")
     120 + 
     121 + .. code-block:: console
     122 + 
     123 + $ readelf -l foo
     124 + Program Headers:
     125 + Type Offset VirtAddr PhysAddr
     126 + FileSiz MemSiz Flags Align
     127 + PHDR 0x0000000000000040 0x0000000000000040 0x0000000000000040
     128 + 0x00000000000011f8 0x00000000000011f8 R E 0x8
     129 + INTERP 0x000000000000a000 0x000000000040a000 0x000000000040a000
     130 + 0x0000000000001000 0x0000000000001000 R 0x1
     131 + [Requesting program interpreter: /a/very/long/path/to/another/interpreter]
     132 + ....
     133 + 
     134 + * Enhancement of the dynamic symbols counting - :commit:`985d1249b72494a0e62f34042b3c9cbfa0706e90`
     135 + * Enable editing ELF's notes:
     136 + 
     137 + .. code-block:: python
     138 + 
     139 + elf = lief.parse("/bin/ls")
     140 + build_id = elf[NOTE_TYPES.BUILD_ID]
     141 + build_id.description = [0xFF] * 20
     142 + elf.write("foo")
     143 + 
     144 + .. code-block:: console
     145 + 
     146 + $ readelf -n foo
     147 + Displaying notes found in: .note.gnu.build-id
     148 + Owner Data size Description
     149 + GNU 0x00000014 NT_GNU_BUILD_ID (unique build ID bitstring)
     150 + Build ID: ffffffffffffffffffffffffffffffffffffffff
     151 + 
     152 + See commit :commit:`3be9dd0ff58ec68cb8813e01d6798c16b42dac22` for more details
    19 153   
    20 154  :PE:
    21 155   
    22  - * import hash / resolve ordinals
     156 + * Add :func:`~lief.PE.get_imphash` and :func:`~lief.PE.resolve_ordinals` functions - :commit:`a89bc6df4f242d7641292acdb184927449d14fff`, :commit:`dfa8e985c0561427a20088750693a004de587b1c`
     157 + * Parse the *Load Config Table* into :class:`~lief.PE.LoadConfiguration` (up to Windows 10 SDK 15002 with *hotpatch_table_offset*)
     158 + 
     159 + .. code-block:: python
     160 + 
     161 + from lief import to_json
     162 + import json
     163 + pe = lief.parse("some.exe")
     164 + loadconfig = to_json(pe.load_configuration)) # Using the lief.to_json function
     165 + pprint(json.loads(to_json(loadconfig)))
     166 + 
     167 + .. code-block:: javascript
     168 + 
     169 + {'characteristics': 248,
     170 + 'code_integrity': {'catalog': 0,
     171 + 'catalog_offset': 0,
     172 + 'flags': 0,
     173 + 'reserved': 0},
     174 + 'critical_section_default_timeout': 0,
     175 + 'csd_version': 0,
     176 + 'editlist': 0,
     177 + ...
     178 + 'guard_cf_check_function_pointer': 5368782848,
     179 + 'guard_cf_dispatch_function_pointer': 5368782864,
     180 + 'guard_cf_function_count': 15,
     181 + 'guard_cf_function_table': 5368778752,
     182 + 'guard_flags': 66816,
     183 + 'guard_long_jump_target_count': 0,
     184 + 'guard_long_jump_target_table': 0,
     185 + 'guard_rf_failure_routine': 5368713280,
     186 + 'guard_rf_failure_routine_function_pointer': 5368782880,
     187 + ...
     188 + 
     189 + For details, see commit: :commit:`0234e3b8bbb6f6f3490392f8c295fde284a99334`
     190 + 
     191 + 
    23 192   
    24 193   
    25 194  :MachO:
    26 195   
    27  - * The ``dyld`` structure is parsed into :class:`~lief.MachO.DyldInfo`. It includes:
     196 + * The ``dyld`` structure is parsed (deeply) into :class:`~lief.MachO.DyldInfo`. It includes:
     197 + 
    28 198   * Binding opcodes
    29 199   * Rebases opcodes
    30 200   * Export trie
    31 201   
    32  - * Section's relocations are now parsed. See: :attr:`lief.MachO.Section.relocations`
    33  - * ``LC_FUNCTION_STARTS`` is parsed into :class:`~lief.MachO.FunctionStarts`
     202 + See: :commit:`e2b81e0a8e187cae5f0f115241243a84ee7696b6`, :commit:`0e972d69ce35731867d82c047eef7eb9ea58e3ec`, :commit:`f7cc518dcfbb0557fd8d396144bf99a222d96705`, :commit:`782295bfb86d2a12584c5b16a37a26d56d1ee235`, :issue:`67`
     203 + 
     204 + * Section relocations are now parsed into :attr:`lief.MachO.Section.relocations` - :commit:`29c8157ecc3b308bd521cb1daee3c2e3a2cffb28`
     205 + * ``LC_FUNCTION_STARTS`` is parsed into :class:`~lief.MachO.FunctionStarts` (:commit:`18d89198a0cc63ff291ae9110f465354c3b8f1e6`)
    34 206   * ``LC_SOURCE_VERSION``, ``LC_VERSION_MIN_MACOSX`` and ``LC_VERSION_MIN_IPHONEOS`` are
    35  - parsed into :class:`~lief.MachO.SourceVersion` and :class:`~lief.MachO.VersionMin`
     207 + parsed into :class:`~lief.MachO.SourceVersion` and :class:`~lief.MachO.VersionMin` (:commit:`c359778194db874669884aaccb52a4b05546bc07`, :commit:`0b4bb7d56520cd0ea08bbcb9530e5e0c96ac14ae`, :commit:`5b993117ed391db18ba775cabefa5f3981b2f1cc`, :issue:`45`)
     208 + * ``LC_THREAD`` and ``LC_UNIXTHREAD`` are now parsed into :class:`~lief.MachO.ThreadCommand` - :commit:`23257830b291c40a3aed92360040f2b0b11ffa72`
     209 + 
    36 210   
     211 +Fixes
     212 +*****
    37 213   
    38  -Bug Fixes
    39  -*********
     214 +Fix enums conflicts(:issue:`32`) - :commit:`66b4cd4550ecf6cf3adb4900e6ad7ac33f1f7f32`
    40 215   
    41  -Fix enums conflicts 66b4cd4550ecf6cf3adb4900e6ad7ac33f1f7f32
     216 +Fix most of the memory leaks: :commit:`88dafa8db6e752393f69d73f68d295e91963b8da`, :commit:`d9b1436730b5d33a753e7dfa4301697a0c676066`, :commit:`554fa153af943b97a16fc4a52ab8459a3d0a9bc7`, :commit:`3602643f5d02a1c78c4de609cc47f193f3a8840f`
    42 217   
    43 218  :ELF:
    44 219   
     220 + * Bug Fix when counting dynamic symbols from the GnuHash Table - :commit:`9036a2405dc44726f40cb77cab1bcbf371ab7a70`
     221 + 
    45 222  :PE:
    46 223   
    47  - * Fix nullptr deref - `ce66916 <https://github.com/lief-project/LIEF/commit/ce6691682e231dbc9ebe97695229ee0afdc185a5>`_
     224 + * Fix nullptr dereference in resources - :commit:`e90fe1b6c6f6a605390bcd1026435ce7503e7e6a`
    48 225   * Handle encoding issues in the Python API - `8c7ceaf <https://github.com/lief-project/LIEF/commit/8c7ceafa823bda508259bf3c7cdc05b865f13d5c>`_
     226 + * Sanitize DLL names
    49 227   
    50  - * Sanitize DLL name
    51  - * Relocations (117f8663e57ff81369630a575b4a4d0695db29b6)
     228 +:MachO:
    52 229   
    53  -:MachO:
     230 + * Fix :issue:`87`, :issue:`92`
     231 + * Fix memory leaks and *some* performance issues: :issue:`94`
    54 232   
    55 233   
    56 234   
     235 + 
    57 236  API
    58 237  ***
    59 238   
    60  -Logger --> configuration
     239 +In the C++ API ``get_XXX()`` getters have been renamed into ``XXX()`` (e.g. ``get_header()`` becomes ``header()``) - :commit:`a4c69f7868da1de5d09aa26e977dedb720e36cbd`, :commit:`e805669865b130057413f456958a471d8f0ac0b1`
    61 240   
    62 241  :Abstract:
    63 242   
    64  - * parser can take a list of integer
     243 + * :class:`lief.Binary` gains the :attr:`~lief.Binary.format` property - :commit:`9391238f114fe963890777c2d8b90f2caaa5510c`
     244 + * :func:`lief.parse` can now takes a list of integers - :commit:`f330fa887d14d47f0683144430ac9695d3136561`
     245 + * Add :meth:`~lief.Binary.has_symbol` and :meth:`~lief.Binary.get_symbol` to :class:`lief.Binary` - :commit:`f121af5ca61a22fd83acc5c7094b50ed1cda8226`
     246 + * [Python API] Enhance the access to the abstract layer through the :attr:`~lief.Binary.abstract` attribute - :commit:`07138549a46db87c7b924fd072356030b1d5c6bc`
     247 + 
     248 + One can now do:
     249 + 
     250 + .. code-block:: python
     251 + 
     252 + elf = lief.ELF.parse("/bin/ls") # Could be lief.MachO / lief.PE
     253 + abstract = elf.abstract # Return the lief.Binary object
     254 + 
    65 255   
    66 256  :ELF:
    67 257   
    68  - * Relocation gains the :attr:`~lief.ELF.Relocation.purpose` property - `b7b0bde <https://github.com/lief-project/LIEF/commit/b7b0bde4d51c54d8d226e5320b1b0d2cc48137c4>`_
    69  -()
    70  - * C++ get_XXX -> XXX
    71  - * Header.sizeof_section_header -> section_header_size
    72  - * Segment.flags -> segment.flags
    73  - * Header flags (730d045e05dca7ef3cd6a51d1175f280be356c70)
    74  - * 3b200b30503847be4779447c76f5207d18daf77f
    75  - * 43bd06f8f32196454ee2305201f4e27b3a3c8a1e
     258 + * Relocation gains the :attr:`~lief.ELF.Relocation.purpose` property - :commit:`b7b0bde4d51c54d8d226e5320b1b0d2cc48137c4`
     259 + * Add :attr:`lief.ELF.Binary.symbols` which return an iterator over **all** symbols (static and dynamic) - :commit:`af6ab65dc91169627f4fbb87cda92093eb699a1e`
     260 + * ``Header.sizeof_section_header`` has been renamed into :attr:`~lief.ELF.Header.section_header_size` - :commit:`d96971b0c3f8ff50add349957f571b8daa00708a`
     261 + * ``Segment.flag`` has been renamed into :attr:`~lief.ELF.Segment.flags` - :commit:`20a5f666deb89b06b79a1c4418ac938497fb658c`
     262 + * Add:
     263 + 
     264 + * :attr:`~lief.ELF.Header.arm_flags_list`,
     265 + * :attr:`~lief.ELF.Header.mips_flags_list`
     266 + * :attr:`~lief.ELF.Header.ppc64_flags_list`
     267 + * :attr:`~lief.ELF.Header.hexagon_flags_list`
     268 + 
     269 + to :class:`~lief.ELF.Header` - :commit:`730d045e05dca7ef3cd6a51d1175f280be356c70`
     270 + 
     271 + To check if a given flag is set, one can do:
     272 + 
     273 + .. code-block:: python
     274 + 
     275 + >>> if lief.ELF.ARM_EFLAGS.EABI_VER5 in lief.ELF.Header "yes" else "no"
     276 + * [Python] Segment flags: ``PF_X``, ``PF_W``, ``PF_X`` has been renamed into :attr:`~lief.ELF.SEGMENT_FLAGS.X`, :attr:`~lief.ELF.SEGMENT_FLAGS.W`, :attr:`~lief.ELF.SEGMENT_FLAGS.X` - :commit:`d70ef9ec2c42619434352dbd7b74a835ebad7569`
     277 + * Add :attr:`lief.ELF.Section.flags_list` - :commit:`4937b7193a5760df85d0ac1567afc011a22cdb98`
     278 + * Enhancement for :attr:`~lief.ELF.DynamicEntryRpath` and :attr:`~lief.ELF.DynamicEntryRunPath`: :commit:`c375a47da7c4c524e886f9238f8dd51a44501087`
     279 + * Enhancement for :attr:`~lief.ELF.DynamicEntryArray`: :commit:`81440ce00cdfc793161a0dc394ada345307dc24b`
     280 + * Add some *operators* :commit:`3b200b30503847be4779447c76f5207d18daf77f`, :commit:`43bd06f8f32196454ee2305201f4e27b3a3c8a1e`
     281 + 
     282 + 
    76 283   
    77 284  :PE:
    78  - 
    79  - * 5666351e07b7bf4a9624033f670d02b8806d2663
     285 + * Add some *operators* :commit:`5666351e07b7bf4a9624033f670d02b8806d2663`
    80 286   
    81 287  :MachO:
    82 288   
    83  - * cbe835484751396daffe7f8d238cbb85d66470ab
     289 + * :func:`lief.MachO.parse` can now takes a list of integers - :commit:`f330fa887d14d47f0683144430ac9695d3136561`
     290 + * :func:`lief.MachO.parse` now returns a :class:`~lief.MachO.FatBinary` instead of a ``list`` of :class:`~lief.MachO.Binary`. :class:`~lief.MachO.FatBinary` has a similar API as a list - :commit:`3602643f5d02a1c78c4de609cc47f193f3a8840f`
     291 + * Add some *operators*: :commit:`cbe835484751396daffe7f8d238cbb85d66470ab`
    84 292   
    85  -TODO: Findlief.cmake
    86  -Make JSON related API optional
     293 +:Logging:
     294 + 
     295 + Add an API to configure the logger - :commit:`4600c2ba8d7d17b5965c2b74faeb7e4d2128de17`
     296 + 
     297 + Example:
     298 + 
     299 + .. code-block:: python
     300 + 
     301 + from lief import Logger
     302 + Logger.disable()
     303 + Logger.enable()
     304 + Logger.set_level(lief.LOGGING_LEVEL.INFO)
     305 + 
     306 + See: :class:`lief.Logger`
     307 + 
     308 +Build system
     309 +************
     310 + 
     311 + * Add `FindLIEF.cmake <https://github.com/lief-project/LIEF/blob/e8ac976c994f6612e8dcca994032403c2d6f580f/scripts/FindLIEF.cmake>`_ - :commit:`6dd8b10325e832a7520bf5ae3a588b9e022d0345`
     312 + * Add ASAN, TSAN, USAN, LSAN - :commit:`7f6aeb0d0d74eae886f4b312e12e8f71e1d5da6a`
     313 + * Add LibFuzzer - :commit:`7a0dc28ea29a30209e944ebcde27f7c0ab234651`
     314 + 
    87 315   
    88 316  Documentation
    89 317  *************
    skipped 6 lines
    96 324  Acknowledgements
    97 325  ****************
    98 326   
    99  -alvaro, aguinet
     327 + * :github_user:`alvarofe` for :pr:`47`
     328 + * :github_user:`aguinet` for :pr:`55`, :pr:`61`, :pr:`65`, :pr:`77`
     329 + * :github_user:`jevinskie` for :pr:`75`
     330 + * :github_user:`liumuqing` for :pr:`80`
     331 + * :github_user:`Manouchehri` for :pr:`106`
     332 + 
    100 333   
    101 334  0.7.0 - July 3, 2017
    102 335  ---------------------
    skipped 3 lines
    106 339   
    107 340  :Abstract Layer:
    108 341   
    109  - * Add bitness (32bits / 64bits) - `78d1adb <https://github.com/lief-project/LIEF/commit/78d1adb41e8b0d21a6f6fe94014753ce68e0ffa1>`_
    110  - * Add object type (Library, executable etc) - `78d1adb <https://github.com/lief-project/LIEF/commit/78d1adb41e8b0d21a6f6fe94014753ce68e0ffa1>`_
    111  - * Add *mode* Thumbs, 16bits etc - `78d1adb <https://github.com/lief-project/LIEF/commit/78d1adb41e8b0d21a6f6fe94014753ce68e0ffa1>`_
    112  - * Add endianness - `7ea08f7 <https://github.com/lief-project/LIEF/commit/7ea08f72c43212f2e3f401b5c2c2614bc9aab8de>`_, `#29 <https://github.com/lief-project/LIEF/issues/29>`_
     342 + * Add bitness (32bits / 64bits) - :commit:`78d1adb41e8b0d21a6f6fe94014753ce68e0ffa1`
     343 + * Add object type (Library, executable etc) - :commit:`78d1adb41e8b0d21a6f6fe94014753ce68e0ffa1`
     344 + * Add *mode* Thumbs, 16bits etc - :commit:`78d1adb41e8b0d21a6f6fe94014753ce68e0ffa1`
     345 + * Add endianness - :commit:`7ea08f72c43212f2e3f401b5c2c2614bc9aab8de`, :issue:`29`
    113 346   
    114 347  :ELF:
    115 348   
    116  - * Enable dynamic symbols permutation - `2dea7cb <https://github.com/lief-project/LIEF/commit/2dea7cb6d631b69995567e056a97e526f588b8ff>`_
    117  - * Fully handle section-less binaries - `de40c06 <https://github.com/lief-project/LIEF/commit/de40c068316b3334e4c8d81ecb3efc177ab24c3b>`_
    118  - * Parse ELF notes - `241aac7 <https://github.com/lief-project/LIEF/commit/241aac7bedaf18ab5e3f0c9775a8a51cb0b40a3e>`_
    119  - * Parse SYSV hash table - `afa74ce <https://github.com/lief-project/LIEF/commit/afa74cee88f730acef84fe6d9c984455a28463e7>`_, `#36 <https://github.com/lief-project/LIEF/issues/36>`_
    120  - * Add relocation size - `f1766f2 <https://github.com/lief-project/LIEF/commit/f1766f2c297caed636c7f32730cd10b62bfcc757>`_
     349 + * Enable dynamic symbols permutation - :commit:`2dea7cb6d631b69995567e056a97e526f588b8ff`
     350 + * Fully handle section-less binaries - :commit:`de40c068316b3334e4c8d81ecb3efc177ab24c3b`
     351 + * Parse ELF notes - :commit:`241aac7bedaf18ab5e3f0c9775a8a51cb0b40a3e`
     352 + * Parse SYSV hash table - :commit:`afa74cee88f730acef84fe6d9c984455a28463e7`, :issue:`36`
     353 + * Add relocation size - :commit:`f1766f2c297caed636c7f32730cd10b62bfcc757`
    121 354   
    122 355  :PE:
    123 356   
    124  - * Parse PE Overlay - `e0634c1 <https://github.com/lief-project/LIEF/commit/e0634c1cf6d12fbdc5bcc1745059005e46e5d805>`_
    125  - * Enable PE Hooking - `24f6b72 <https://github.com/lief-project/LIEF/commit/24f6b7213647469e269ead9441d78204162d08ec>`_
    126  - * Parse and rebuilt dos stub - `3f06397 <https://github.com/lief-project/LIEF/commit/3f0639712617007e2e0431cb5eeb9be204c5d74b>`_
    127  - * Add a *resources manager* to provide an enhanced API over the resources - `8473c8e <https://github.com/lief-project/LIEF/commit/8473c8e126f2a8f14728ad3f8ebb59c45ac55d2d>`_
    128  - * Serialize PE objects into JSON - `673f5a3 <https://github.com/lief-project/LIEF/commit/673f5a36f0d339ad9390427292fa6e725b8fd907>`_, `#18 <https://github.com/lief-project/LIEF/issues/18>`_
    129  - * Parse Rich Header - `0893bd9 <https://github.com/lief-project/LIEF/commit/0893bd9b08f2248ae8f656ccd81b1be12e8ae57e>`_, `#15 <https://github.com/lief-project/LIEF/issues/15>`_
     357 + * Parse PE Overlay - :commit:`e0634c1cf6d12fbdc5bcc1745059005e46e5d805`
     358 + * Enable PE Hooking - :commit:`24f6b7213647469e269ead9441d78204162d08ec`
     359 + * Parse and rebuilt dos stub - :commit:`3f0639712617007e2e0431cb5eeb9be204c5d74b`
     360 + * Add a *resources manager* to provide an enhanced API over the resources - :commit:`8473c8e126f2a8f14728ad3f8ebb59c45ac55d2d`
     361 + * Serialize PE objects into JSON - :commit:`673f5a36f0d339ad9390427292fa6e725b8fd907`, :issue:`18`
     362 + * Parse Rich Header - :commit:`0893bd9b08f2248ae8f656ccd81b1be12e8ae57e`, :issue:`15`
    130 363   
    131 364  Bug Fixes
    132 365  *********
    skipped 4 lines
    137 370   
    138 371  :PE:
    139 372   
    140  - * Bug fix in the signature parser: `#30 <https://github.com/lief-project/LIEF/issues/30>`_, `4af0256 <https://github.com/lief-project/LIEF/commit/4af0256ce7c5577e0b1010c6f9b566634f0a3993>`_
    141  - * Bug fix in the resources parser: Infinite loop - `a569cc1 <https://github.com/lief-project/LIEF/commit/a569cc13d99354ff96932460f5b1fd859378f252>`_
    142  - * Add more *out-of-bounds* checks on relocations and exports - `9364f64 <https://github.com/lief-project/LIEF/commit/9364f644e937a6a5d69c64c2ef4eaa1fbdd2cfad>`_
    143  - * Use ``min(SizeOfRawData, VirtualSize)`` for the section's size and truncate the size to the file size - `61bf14b <https://github.com/lief-project/LIEF/commit/61bf14ba1182fe458453599ff014de5d71d25680>`_
     373 + * Bug fix in the signature parser: :issue:`30`, :commit:`4af0256ce7c5577e0b1010c6f9b566634f0a3993`
     374 + * Bug fix in the resources parser: Infinite loop - :commit:`a569cc13d99354ff96932460f5b1fd859378f252`
     375 + * Add more *out-of-bounds* checks on relocations and exports - :commit:`9364f644e937a6a5d69c64c2ef4eaa1fbdd2cfad`
     376 + * Use ``min(SizeOfRawData, VirtualSize)`` for the section's size and truncate the size to the file size - :commit:`61bf14ba1182fe458453599ff014de5d71d25680`
    144 377   
    145 378   
    146 379  :MachO:
    147 380   
    148  - * Bug fix when a binary hasn't a ``LC_MAIN`` command - `957501f <https://github.com/lief-project/LIEF/commit/957501fe76596e0396c66d08540884876cea049c>`_
     381 + * Bug fix when a binary hasn't a ``LC_MAIN`` command - :commit:`957501fe76596e0396c66d08540884876cea049c`
    149 382   
    150 383  API
    151 384  ***
    skipped 116 lines
    268 501  Acknowledgements
    269 502  ****************
    270 503   
    271  - * `ek0 <https://github.com/ek0>`_: `#24 <https://github.com/lief-project/LIEF/pull/24>`_
    272  - * `ACSC-CyberLab <https://github.com/ACSC-CyberLab>`_: `#33 <https://github.com/lief-project/LIEF/pull/33>`_, `#34 <https://github.com/lief-project/LIEF/pull/34>`_, `#37 <https://github.com/lief-project/LIEF/pull/37>`_, `#39 <https://github.com/lief-project/LIEF/pull/39>`_
     504 + * `ek0 <https://github.com/ek0>`_: :pr:`24`
     505 + * `ACSC-CyberLab <https://github.com/ACSC-CyberLab>`_: :pr:`33`, :pr:`34`, :pr:`37`, :pr:`39`
    273 506   * Hyrum Anderson who pointed bugs in the PE parser
    274 507   * My collegues for the feedbacks and suggestions (Adrien, SebK, Pierrick)
    275 508   
    skipped 5 lines
    281 514   
    282 515  :ELF:
    283 516   
    284  - * Don't rely on :attr:`lief.ELF.Section.entry_size` to count symbols - `004c676 <https://github.com/lief-project/LIEF/commit/004c6769bec37e303bbe7aaceb49f4b05c8eec84>`_
     517 + * Don't rely on :attr:`lief.ELF.Section.entry_size` to count symbols - :commit:`004c6769bec37e303bbe7aaceb49f4b05c8eec84`
    285 518   
    286 519  API
    287 520  ***
    skipped 26 lines
  • ■ ■ ■ ■ ■
    doc/sphinx/compilation.rst
    skipped 64 lines
    65 65  Docker
    66 66  ------
    67 67   
    68  -.. code-block:: console
    69  - 
    70  - $ docker build -t lief LIEF
    71  - $ docker run -i -t lief /bin/bash
    72  - 
     68 +See the `Dockerlief <https://github.com/lief-project/Dockerlief>`_ repo.
    73 69   
    74 70   
    75 71   
    skipped 2 lines
  • ■ ■ ■ ■ ■ ■
    doc/sphinx/conf.py.in
    skipped 14 lines
    15 15   
    16 16  import sys
    17 17  import os
     18 +import re
     19 +import six
     20 + 
     21 +from datetime import datetime
     22 +from docutils import nodes
     23 +from docutils.parsers.rst import directives
     24 +from sphinx.util.compat import Directive
    18 25   
    19 26  # If extensions (or modules to document with autodoc) are in another directory,
    20 27  # add these directories to sys.path here. If the directory is relative to the
    skipped 93 lines
    114 121   
    115 122   
    116 123  # -- Options for HTML output ----------------------------------------------
     124 +def commit_role(name, rawtext, text, lineno, inliner, options={}, content=[]):
     125 + commit_link = nodes.reference(
     126 + "", text[:7], refuri="https://github.com/lief-project/LIEF/commit/{}".format(text), **options)
     127 + 
     128 + return [commit_link], []
     129 + 
     130 + 
     131 +def pr_role(name, rawtext, text, lineno, inliner, options={}, content=[]):
     132 + pr_link = nodes.reference(
     133 + "", '#' + text, refuri="https://github.com/lief-project/LIEF/pull/{}".format(text), **options)
     134 + 
     135 + return [pr_link], []
     136 + 
     137 + 
     138 +def issue_role(name, rawtext, text, lineno, inliner, options={}, content=[]):
     139 + issue_link = nodes.reference(
     140 + "", '#' + text, refuri="https://github.com/lief-project/LIEF/issues/{}".format(text), **options)
     141 + 
     142 + return [issue_link], []
     143 + 
     144 +def github_user(name, rawtext, text, lineno, inliner, options={}, content=[]):
     145 + issue_link = nodes.reference(
     146 + "", text, refuri="https://github.com/{}".format(text), **options)
     147 + 
     148 + return [issue_link], []
     149 + 
    117 150  def setup(app):
    118 151   app.add_stylesheet('css/custom.css') # may also be an URL
     152 + 
     153 + app.add_role('commit', commit_role)
     154 + app.add_role('pr', pr_role)
     155 + app.add_role('issue', issue_role)
     156 + app.add_role('github_user', github_user)
    119 157  import sphinx_rtd_theme
    120 158   
    121 159   
    skipped 197 lines
  • ■ ■ ■ ■
    scripts/FindLIEF.cmake
    skipped 38 lines
    39 39  #
    40 40  # .. code-block:: cmake
    41 41  #
    42  -# find_package(LIEF 0.7.0 REQUIRED COMPONENTS STATIC)
     42 +# find_package(LIEF 0.8.0 REQUIRED COMPONENTS STATIC)
    43 43   
    44 44   
    45 45   
    skipped 122 lines
Please wait...
Page is in error, reload to recover