929 Commits

Author SHA1 Message Date
Romain Thomas
eeddc38393 Handle PE forwarded exports
Resolve: #307
2019-12-10 06:33:48 +01:00
rthomas
ab349aadc6 Set Python 3.5 as the minimum version 2019-12-08 09:21:51 +01:00
rthomas
172c589d4c Update LIEF version 2019-12-07 09:31:36 +01:00
rthomas
0ade59de75 Add PT_GNU_PROPERTY 2019-12-06 06:22:01 +01:00
rthomas
86568dc77a Update tests 2019-12-01 14:52:54 +01:00
rthomas
74bc77465e Do not break parsing when a symbol is empty.
Seen in ``libbaiduprotect.so`` (4813a0c5cf97f52ccb3d2494d86fc2e3e924df2fbd83936437e3472f64019d22)
2019-12-01 07:51:27 +01:00
rthomas
1cd2db0dca Fix typo 2019-12-01 07:38:50 +01:00
rthomas
da4507fcbb Force patch version to '0' 2019-11-30 16:14:27 +01:00
rthomas
7b7216f14c Update README 2019-11-30 07:29:58 +01:00
rthomas
bfe5414a1e Set date 0.10.1 2019-11-29 21:51:38 +01:00
rthomas
86a35bd7bc Fix typo 2019-11-28 17:16:57 +01:00
rthomas
b0e480c9f2 Fix Python parsing with input 'bytes' 2019-11-28 07:53:27 +01:00
rthomas
ca4e6148fe Add API to demangle strings 2019-11-28 16:25:58 +01:00
rthomas
c93f428d04 Add doc option 2019-11-28 07:47:06 +01:00
rthomas
7fc13786e8 Cleanup 2019-11-28 06:47:49 +01:00
rthomas
91bc294b62 Update README 2019-11-25 08:17:27 +01:00
rthomas
1090d09e1a Update README 2019-11-24 19:12:00 +01:00
rthomas
833d8a626f Fix date 2019-11-24 19:07:38 +01:00
rthomas
845f675627 Clean 0.10.0 2019-11-24 09:54:14 +01:00
rthomas
f5d152ee92 Update API key 2019-11-24 08:52:32 +01:00
rthomas
b9eb5c4043 Update files 2019-11-24 08:33:30 +01:00
rthomas
db4e52dd90 Only wheel files matter 2019-11-24 08:33:17 +01:00
rthomas
fe9315f42d Update changelog 2019-11-23 14:20:38 +01:00
rthomas
bf9e4a259b Fix travis CI 2019-11-23 12:04:12 +01:00
rthomas
42ee4173cd Disable Python 3.8 in Appveyor because of error 2019-11-23 06:53:35 +01:00
Laszlo Kiss-Kollar
5f865a8980 Run build on Python 3.8
Enable Travis and AppVeyor builds on 3.8.
2019-11-23 06:53:35 +01:00
Romain
4744ab12a0
Merge pull request #359 from majin42/fix/pe_missing_offset
[PE] Fix missing offset in resource parsing
2019-11-23 06:32:33 +01:00
rthomas
d838f523bb Trigger Docker on OSX build instead of Linux 2019-11-23 06:31:31 +01:00
majin42
ed2e775e77 reintroduce missing offset parameter in PE resource data parsing 2019-11-22 10:40:49 +01:00
rthomas
934d84ffea Move to Pybind11 v2.4.3 and fix enum conflicts 2019-11-19 06:41:11 +01:00
rthomas
d400ca429d Add blog post about kaitai and LIEF 2019-11-08 16:05:59 +01:00
rthomas
4105c31f61 Missing import 2019-11-08 16:05:59 +01:00
Romain
657d589fae
Merge pull request #352 from recvfrom/master
Expose raw bytes of Authenticode-related structures and other improvements
2019-10-08 10:10:38 +02:00
Andrew
08d31be932 Authenticode-related bug fixes and improvements
Part of Authenticode verification consists of:
 - Comparing the computed Authenticode hash to the digest
   stored in the ContentInfo section
 - Comparing hash(ContentInfo) to the digest stored in the
   AuthenticatedAttributes section
 - Verifying signed(hash(AuthenticatedAttributes)) using a
   certificate identified by the issuer and serial number
   specified in the SignerInfo section

This commit makes it so that the raw bytes needed to
calculate hash(ContentInfo) and hash(AuthenticatedAttributes)
are available for use.

============================================================

Allow missing [0] in SpcSpOpusInfo

Some executables have MoreInfo but not a ProgramName (and the documentation
lists both as OPTIONAL), so handle this case correctly.

Example:

```
01416b1730218454c99b13592650cb170402b86742b4bab971565903b841829b

SEQUENCE(2 elem)
OBJECT IDENTIFIER1.3.6.1.4.1.311.2.1.12spcSpOpusInfo(Microsoft code signing)
SET(1 elem)
  SEQUENCE(1 elem)
  [1](1 elem)
   [0]http://www.mozilla.com
```

============================================================

Improve consistency of parsed serial numbers

When parsing the issuer serial number, call mbedtls_x509_get_serial instead of
parsing it as an integer directly with mbedtls_asn1_get_mpi. These two functions
differ in how they treat serial numbers prepended with '00' to prevent them from
being negative (the former preserves the '00', and the latter discards it). The
embedded certs are parsed via a call to mbedtls_x509_crt_parse_der, which uses
mbedtls_x509_get_serial behind the scenes, so there was an inconsistency between
lief_obj.signature.signer_info.issuer[1] and
lief_obj.signature.certificates[x].serial_number.  Example:

8bf57d97dd917c4f823659266caaa33e7398406daf11ba8318e3f7414ee3fb24

============================================================

Handle SpcLink and SpcString CHOICEs in SpcSpOpusInfo

The Authenticode spec doc says that these can be CHOICES, so
handle the easy ones and safely skip the others.

============================================================

Allow Authenticode sig to be parsed even if cert parsing fails

By default, mbedtls doesn't support MD2 certs, which are fairly
common in older signed executables.  Ex:

1cb16f94cebdcad7dd05c8537375a6ff6379fcdb08528fc83889f26efaa84e2a

============================================================

Enable mbed TLS MD2 and MD4 support; add Unix debug options

By default, mbedtls doesn't support MD2 certs, which are fairly
common in older signed executables.  Ex:

1cb16f94cebdcad7dd05c8537375a6ff6379fcdb08528fc83889f26efaa84e2a

============================================================

Set MBEDTLS_X509_ALLOW_UNSUPPORTED_CRITICAL_EXTENSION flag

Some older signed executables use certs with the SpcSpAgencyInfo
Critical Extension, which mbed TLS doesn't support, so set
MBEDTLS_X509_ALLOW_UNSUPPORTED_CRITICAL_EXTENSION to have it
skip this extension.  Example:

781ca31416ec708a587851dafd90c661b86f244ab8b8475c4185e958e54ff838

============================================================

Support accessing non-utf8 issuer names via Python

For a few signatures where the issuer name contained non-utf8
characters, accessing the issuer name field in Python would raise
a UnicodeDecodeError exception. Now this field is handled the
same way the names in the individual certs are (I'm not sure if
they get represented 100% correctly, but at least they are
consistent, which is good enough for me). Example:

048f91b9302c88380fc66adac1e314d82733089ef3a31eadca5f0cb4169b195f
2019-10-07 00:58:40 -04:00
rthomas
208264cb66 Remove unused files
Resolve #348
2019-10-02 08:13:12 +02:00
rthomas
e563d682bf Update changelog 2019-10-02 07:55:04 +02: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
Romain Thomas
e50436164e Fix missing code-block 2019-09-09 17:28:43 +02:00
Romain Thomas
27666e4f02 Add Android x86/x86-64 cmake scripts 2019-09-09 07:44:59 +02:00
Romain Thomas
f6cc8f8ff6 Improve debug build on Windows 2019-08-29 08:24:39 +02:00
Romain Thomas
6cf1e2f9df Fix doc about compilation 2019-08-28 07:16:28 +02:00
Romain Thomas
4d4f96d268 Fix local variable life-time.
Resolve #331
2019-08-27 07:54:33 +02:00
Romain Thomas
273f001895 Add script for AArch64 2019-08-24 17:28:34 +02:00
Romain Thomas
40570e6522 Enhance LIEF modules configuration 2019-08-23 08:07:40 +02:00
Romain Thomas
088951ddb7 Resolve #329 2019-08-23 07:54:23 +02:00
Chris
2cc22a792f Update 09_frida_lief.rst (#330)
Fix typo
2019-08-23 07:25:32 +02:00
Romain Thomas
04037644af Update README 2019-08-21 07:36:05 +02:00
wisk
df2d56c532 Fix PE available sections space
(cherry picked from commit fb311c28f2f6dd682d195a235ebddf549618b84b)
2019-07-29 09:37:54 +02:00
wisk
2b1214b770 Use C++ header for Mach-O
(cherry picked from commit e477afad1f0f13acc8cbca8a80d1bc7935c0923f)
2019-07-29 09:37:54 +02:00
Andrew Williams
fcb9c76be6 Expose the raw bytes backing each PE Authenticode cert (#320) 2019-07-26 19:26:13 +02:00