232 Commits

Author SHA1 Message Date
Romain Thomas
03ba40b735 Setup Ninja for windows 2020-12-05 11:30:53 +01:00
rthomas
3b7c8fb203 Clean ELF headers 2020-11-20 06:42:23 +01:00
rthomas
8a72f4310e Update documentation & python bindings 2020-11-18 13:07:21 +01:00
rthomas
44e072da15 Handle python utf-16 conversion in LangCodeItem values 2020-11-17 18:18:48 +01:00
rthomas
1364f22c78 Improve logging interface 2020-11-09 21:02:50 +01:00
Meir Komet
1851382170 added eBPF file support (compiled to ELF, via new llvm support) 2020-11-07 15:46:28 +01:00
rthomas
3d9b84c6ec Add support for Python 3.9 2020-10-22 14:48:27 +02:00
rthomas
3bd530b880 Resolve #476 2020-10-15 09:14:18 +02:00
rthomas
1390f8b090 Add method to query binary's virtual size 2020-10-12 16:25:33 +02:00
rthomas
2d0005dc60 Unify GuardFlags 2020-10-11 20:18:20 +02:00
rthomas
2e65a94b7c Export binding's original offset 2020-10-09 18:42:52 +02:00
rthomas
081ec5c0e9 Add DF_1_PIE enum 2020-09-23 13:33:42 +02:00
rthomas
5f26216f90 Resolve #455 2020-08-27 09:59:59 +02:00
Romain
4db8cf8b30
Merge pull request #453 from benjamb/benbrown/fix-404
Fix module entry point declaration (fixes #404)
2020-08-25 15:44:36 +02:00
rthomas
9f1bebb0ff Fix UTF8 (by @tacesrever) 2020-08-25 11:20:16 +02:00
Ben Brown
5e9053988f Fix module entry point declaration
Explicit definition of a py::module was only required when using the
deprecated PYBIND11_PLUGIN macro; remove this as the second argument of
the PYBIND11_MODULE macro will define the variable.

Set the docstring as appropriate.

Fixes #404.
2020-08-24 22:14:26 +01:00
Koh M. Nakagawa
1fd42b4ebf Add parser for resource accelerator
Signed-off-by: Koh M. Nakagawa <tsunekou1019@gmail.com>
2020-08-24 07:15:04 +02:00
Koh M. Nakagawa
eb87ca6ef6 fix to parse html resource
Signed-off-by: Koh M. Nakagawa <tsunekou1019@gmail.com>
2020-07-06 22:01:47 +09:00
Koh M. Nakagawa
96e6fc66ad fix ResourcesManager to parse string table entry
Signed-off-by: Koh M. Nakagawa <tsunekou1019@gmail.com>
2020-06-26 01:18:58 +09:00
Koh M. Nakagawa
1a7f8c41eb fix to avoid SIGSEGV 2020-06-01 22:34:31 +09:00
Koh M. Nakagawa
38f48a6e12 fix wrong EnumToString 2020-05-28 06:26:29 +02:00
rthomas
5684960317 Update dependencies 2020-05-24 06:47:15 +02:00
rthomas
3cee05646c Fix typo 2020-05-20 16:30:38 +02:00
Koh M. Nakagawa
cd05f34bae add IMAGE_DEBUG_TYPE_EX_DLLCHARACTERISTICS 2020-05-11 09:16:59 +02:00
rthomas
a04eb8888a Enhancement 2020-05-03 11:15:36 +02:00
thetufik
2c85678fb6 feature: release the GIL on parse 2020-04-21 16:54:23 +03:00
Romain
a26ae60e83
Merge pull request #365 from mingwandroid/FixMissing-typeinfo-symbol
Export BuildToolVersion and fix typo
2019-12-11 07:46:31 +01:00
Ray Donnelly
68f6154722 Fix typo BuildeVersion => BuildVersion which may lead to my link failures 2019-12-10 15:42:04 +01:00
Romain Thomas
eeddc38393 Handle PE forwarded exports
Resolve: #307
2019-12-10 06:33:48 +01:00
rthomas
0ade59de75 Add PT_GNU_PROPERTY 2019-12-06 06:22:01 +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
934d84ffea Move to Pybind11 v2.4.3 and fix enum conflicts 2019-11-19 06:41:11 +01: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
Andrew Williams
fcb9c76be6 Expose the raw bytes backing each PE Authenticode cert (#320) 2019-07-26 19:26:13 +02:00
Romain Thomas
bd9be9a765 Add notice regarding LIEF imphash implementation
Related to #299
2019-06-26 09:10:35 +02:00
Romain Thomas
778763de88 Fix Python return value policy for `get_symbol()`
Resolve #305
2019-06-23 10:19:14 +02: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
Romain Thomas
36a7eeda2a Fix #292 2019-05-03 20:40:13 +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
b26abae9a9 Fix #285 2019-03-25 20:38:28 +01:00
Romain Thomas
a2403d5eeb Resolve #280 2019-03-14 12:48:03 +01:00
Romain Thomas
90867193b5 Fix #271 2019-03-10 17:49:21 +01:00
Romain Thomas
7e88e2b2c0 Add function to check if a symbol can be removed 2019-02-18 14:17:08 +01:00
Romain Thomas
826aae615b Add function to check format integrity against codesign 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
KOLANICH
8a30e1a3d7 Added a dir with runtime libs i to PATH if it exists 2019-01-27 08:55:14 +01:00