114 Commits

Author SHA1 Message Date
Antonio Flores Montoya
fe7c725f3b remove leftover debugging code. 2020-03-23 08:59:03 -04:00
Antonio Flores Montoya
594ea3b356 add test for binary with all relocations. 2020-03-23 08:53:25 -04:00
Romain Thomas
eeddc38393 Handle PE forwarded exports
Resolve: #307
2019-12-10 06:33:48 +01:00
rthomas
86568dc77a Update tests 2019-12-01 14:52:54 +01:00
rthomas
b0e480c9f2 Fix Python parsing with input 'bytes' 2019-11-28 07:53:27 +01:00
rthomas
934d84ffea Move to Pybind11 v2.4.3 and fix enum conflicts 2019-11-19 06:41:11 +01:00
Laszlo Kiss-Kollar
3550e45f18 Build manylinux1-compliant wheels in Travis
* Temporarily disable Melkor in test suite
The Makefile uses the -executable flag which doesn't work on RHEL5.
Disabling until I find a workaround for this.

* Patch Makefile in Melkor fuzzer
This replaces the `-executable` flag which is not supported by `find` on
CentOS 5.

* Respect CC environment variable
Several tests hard coded /usr/bin/cc which might not exist in some
environments. We first check the CC environment variable and fall back
to the hard coded path if CC is unset.

* Skip tests on GLIBC < 2.17
Some test binaries were linked against GLIBC 2.17. Skip tests which use
this binary if the platform does not have the required GLIBC version.

* Enable ccache in Docker in Travis builds

* Run `auditwheel repair` on the produced wheels
This will vendor the needed external shared libraries into the wheel and
tag it as manylinux1.

* Install ccache in Docker image

* Avoid using bind mount volume in Docker build

The bind mount volume wrote files as 'root' which causes issues with the
deploy script in Travis. Copying the source code into the image and
retrieving the built wheels instead of mounting the source tree fixes
this issue.

* Fix missing build folder when building with Docker

After finishing the build inside Docker we need the build directory from
the container to be able to deploy the built artifacts with deploy.sh.

* Use the right Python interpreter for Linux builds

The Dockerized .travis.yml builds attempt to invoke the interpreter in
the PYTHON_BINARY environment variable, which is only valid inside the
Docker image. To fix this, override the variable on Linux for tasks
which require the host's Python interpreter.

* Fix missing pip installation in Travis

The Ubuntu image in Travis does not come with `pip` preinstalled for
Python 3.

* Remove .git directory from .dockerignore

As `setup.py` uses `git` to determine the version number we need to copy
the contents of `.git` into the image.
2019-10-02 07:49:45 +02:00
Joshua Mack
89c7afa680 Adds regression check for Note::dump segfault 2019-06-07 18:04:08 -07:00
Romain Thomas
fa3195b1bd Add API to check if a section associated with an Off/VA exists 2019-05-28 09:47:33 +02:00
Cédric Tessier
9fc3a8a433 Add coredump support in LIEF 2019-04-18 07:17:46 +02:00
Romain Thomas
0d03b4bdb8 Improve Python setup 2019-03-31 10:15:08 +02:00
Romain Thomas
6fc676387a Enhance tests 2019-02-18 14:17:08 +01:00
Romain Thomas
616d739da5 Enable to remove Mach-O symbols 2019-02-18 14:17:08 +01:00
1orenz0
3537440b8d Add support to parse POGO debug entries 2018-12-16 16:34:12 +01:00
Romain Thomas
6f967238fc Introduce Mach-O Build Version command
New API:
  LIEF::MachO::BuildVersion
  LIEF::MachO::BuildToolVersion

  LIEF::MachO::Binary::has_build_version
  LIEF::MachO::Binary::build_version
2018-12-13 15:37:19 +01:00
Romain Thomas
35b3d039f7 Only relocate section if the original one was not empty.
We also introduce ELF API for overlay:
  * lief.ELF.Binary.eof_offset
  * lief.ELF.Binary.has_overlay
  * lief.ELF.Binary.overlay
2018-12-13 09:32:54 +01:00
1orenz0
fcc75dd879 Parse PE debug data directory as a list of debug entries
PE's DATA_DIRECTORY_DEBUG does not define a single debug entry, but
a list of struct pe_debug entries (the number of entries is determined
by the data directory's size).

This commit reflect this layout by returning a vector<> when calling
PE.debug()
2018-11-29 09:16:34 +01:00
Romain Thomas
b5a08463ad Expose API to list functions found in a binary 2018-09-12 14:44:18 +02:00
Romain Thomas
196717c999 Fix gnu hash table 2018-09-08 09:19:02 +02:00
Romain Thomas
b716003f59 Fix alignement issue 2018-09-08 06:17:42 +02:00
Romain Thomas
6c62bed5ab WIP 2018-09-08 05:46:00 +02:00
Romain Thomas
4b649ad231 WIP 2018-09-08 05:25:21 +02:00
Romain Thomas
9142c2bfb3 Update Yamlcpp 2018-09-08 04:56:10 +02:00
Adrien Guinet
89d4de54c8 Fix git tag commmand to always work
Forward CRT on other targets
2018-08-29 13:38:27 +02:00
Adrien Guinet
4b03ac45e0 Remove LIEF_SHARED_LIB from cmake
Moreover, add macros to force the CRT usage when using MSVC.
This is based on the LLVM one.
2018-08-29 08:50:56 +02:00
Romain Thomas
38e84d6d2c Fix encoding issue 2018-08-11 04:11:56 +02:00
Romain Thomas
bce9ebe170 Add support for Android 9 2018-08-10 16:10:51 +02:00
Romain Thomas
04dddd3710 Fix alignment issue when removing a PE section 2018-08-10 15:16:29 +02:00
pbrunet
d1b98d69ad Add support for static relocation writing. 2018-07-23 14:47:39 +02:00
Romain Thomas
16595316fd Enable write on Fat Mach-O 2018-07-16 13:32:00 +02:00
Romain Thomas
918438c6be Enable to remove sections using the abstract layer 2018-07-09 15:08:39 +02:00
Romain Thomas
31a4b19c54 Update tests 2018-06-28 16:14:00 +02:00
Romain Thomas
c3f99aebda Remove useless 'remove' 2018-06-27 16:10:03 +02:00
Romain Thomas
406115c8d0 Enhance Mach-O modification
* Add load command
  * Add sections
  * Add segments

Resolve #46 (partially)
2018-06-27 14:44:42 +02:00
Romain Thomas
67d924a220 Add constructor functions in the abstract layer
New API:
  * LIEF::ELF::Binary::get_relocation
  * LIEF::Binary::ctor_functions
2018-06-19 15:27:35 +02:00
Romain Thomas
6e7e373660 Update test 2018-06-19 10:48:41 +02:00
Romain Thomas
fa5790ca80 Update tests 2018-06-19 10:25:25 +02:00
Romain Thomas
a9f3cb8f9b Enable to add relocation associated with symbol
Resolve #184
2018-06-19 09:59:29 +02:00
Romain Thomas
3cdfb29612 Bug fix 2018-06-08 11:06:21 +02:00
Romain Thomas
9e3b5b45f7 Support new Mach-O command:
* Segment split info
  * Sub framework
  * Dyld environment
2018-05-14 16:34:45 +02:00
Romain Thomas
4ef1bb845f Add new formats: OAT, DEX, VDEX, ART 2018-05-04 12:46:28 +02:00
Romain Thomas
9a2ef208bb Update iterators tests 2018-04-23 09:55:09 +02:00
Romain Thomas
4ef839c3d8 Enhance BinaryStream Interface 2018-04-15 08:55:23 +02:00
Romain Thomas
a16e1c4d13 Expose DataInCode 2018-04-02 08:21:15 +02:00
Romain Thomas
fda5f65d1c Fix test 2018-03-18 18:52:57 +01:00
Romain Thomas
3b17aba10e Refactor some parts of the Architecture:
* JSON visitor are located in the format namespace
  * Visitor are *real* visitor
  * Visitable class has been renamed to Object
  * Due to a bug in Visual Studio 2015, we move to VS2017
2018-03-13 16:49:02 +01:00
Romain Thomas
d26fdb41ec Use /MTd when Debug build
Fix: #147
2018-03-09 08:29:31 +01:00
Romain Thomas
5d56141061 Show Mach-O opcodes and export-trie 2018-03-02 09:24:59 +01:00
Romain Thomas
a40da3e3b4 Enable to export and create dynamic symbols
New API:

  * Binary::{has_dynamic_symbol, has_static_symbol}
  * Binary::{get_dynamic_symbol, get_static_symbol}
  * Binary::add_exported_function
  * Binary::export_symbol

  * Symbol::visibility
  * SymbolVersion::local / SymbolVersion::global

Resolve #112
2018-02-28 16:18:33 +01:00
Romain Thomas
253c2b5e62 Fix type (tuple to list) 2018-02-28 16:17:32 +01:00