4
0
mirror of https://github.com/QuasarApp/LIEF.git synced 2025-05-11 19:09:33 +00:00

684 Commits

Author SHA1 Message Date
Chris
2cc22a792f Update 09_frida_lief.rst ()
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 () 2019-07-26 19:26:13 +02:00
Romain Thomas
1b1a616ac7 Add missing entry 2019-07-26 09:09:07 +02:00
Romain Thomas
715448d3b8 Merge branch 'fix/cmake' 2019-07-25 13:09:59 +02:00
Andrew Williams
20f46e74a3 Unify SignerInfo issuer field format ()
* Unify SignerInfo issuer field format

This makes it so that the SignerInfo issuer field has the same
format as the issuer fields in each x509 cert, so the two can
be more easily compared.

Also, this commit adds '0x' in front of the Data Directory
RVAs and sizes to make it more clear that the values are printed
in hex.

* Add missing include in SignerInfo.cpp

* Address Codacy feedback and minor change to text

The serial number of the signing certificate will now be
printed as 'Serial Number' instead of 'Issuer Serial Number'
since the latter is a bit confusing (the serial number in
the SignerInfo section is the serial number of the certificate
that actually signed the executable)

* Update python pe_reader example based on issuer changes
2019-07-25 11:38:42 +02:00
Romain Thomas
d4ad532c58 Downgrade cmake_minimum_required to 3.5 2019-07-24 14:56:25 +02:00
Romain Thomas
3a11b24798 Add alias 2019-07-10 06:59:41 +02:00
Romain
bab1c1d5b7
Merge pull request from recvfrom/master
Update the PE Authenticode parsing code
2019-07-10 06:54:08 +02:00
Andrew
535623de3a Update the PE Authenticode parsing code
- Allow UTF8String and IA5String types when parsing the Issuer fields
   (previously only PrintableString types were handled).  Handling these
   three types should be sufficient, based on the default types indicated
   at https://github.com/ARMmbed/mbedtls/blob/master/library/x509_create.c#L52.
   The approach used is similar to what's done in mbedtls's internal
   x509_get_attr_type_value function.

   Examples:
```
     8a364e0881fd7201cd6f0a0ff747451c9b93182d5699afb28ad8466f7f726660:
     SEQUENCE (4 elem)
       SET (1 elem)
         SEQUENCE (2 elem)
           OBJECT IDENTIFIER 2.5.4.6 countryName (X.520 DN component)
           PrintableString PL
       SET (1 elem)
         SEQUENCE (2 elem)
           OBJECT IDENTIFIER 2.5.4.10 organizationName (X.520 DN component)
           UTF8String Unizeto Technologies S.A.
       SET (1 elem)
         SEQUENCE (2 elem)
           OBJECT IDENTIFIER 2.5.4.11 organizationalUnitName (X.520 DN component)
           UTF8String Certum Certification Authority
       SET (1 elem)
         SEQUENCE (2 elem)
           OBJECT IDENTIFIER 2.5.4.3 commonName (X.520 DN component)
           UTF8String Certum Code Signing CA SHA2

     From a test binary compiled with osslsigncode:
     SEQUENCE (6 elem)
       SET (1 elem)
         SEQUENCE (2 elem)
           OBJECT IDENTIFIER 2.5.4.6 countryName (X.520 DN component)
           PrintableString US
       SET (1 elem)
         SEQUENCE (2 elem)
           OBJECT IDENTIFIER 2.5.4.8 stateOrProvinceName (X.520 DN component)
           UTF8String State
       SET (1 elem)
         SEQUENCE (2 elem)
           OBJECT IDENTIFIER 2.5.4.7 localityName (X.520 DN component)
           UTF8String City
       SET (1 elem)
         SEQUENCE (2 elem)
           OBJECT IDENTIFIER 2.5.4.10 organizationName (X.520 DN component)
           UTF8String Cisco Talos
       SET (1 elem)
         SEQUENCE (2 elem)
           OBJECT IDENTIFIER 2.5.4.11 organizationalUnitName (X.520 DN component)
           UTF8String Test CA 1704a8ea9e24d8ed
       SET (1 elem)
         SEQUENCE (2 elem)
           OBJECT IDENTIFIER 1.2.840.113549.1.9.1 emailAddress (PKCS . Deprecated, use an altName extension instead)
           IA5String rfc2606@example.net
```

 - Allow any order for the AuthenticatedAttributes, and ignore ones that
   aren't recognized. The code was looking for a strict ordering of the
   attributes, but Windows seems to be OK with any order.
   Example:
```
     From f91e258ea71dcbfc82371b2ee3e20852e45bef0cb946223d1141a6ef1dfb793f:
     SEQUENCE (2 elem)
       OBJECT IDENTIFIER 1.3.6.1.4.1.311.2.1.12 spcSpOpusInfo (Microsoft code signing)
       SET (1 elem)
         SEQUENCE (0 elem)
     SEQUENCE (2 elem)
       OBJECT IDENTIFIER 1.2.840.113549.1.9.3 contentType (PKCS )
       SET (1 elem)
         OBJECT IDENTIFIER 1.3.6.1.4.1.311.2.1.4 spcIndirectDataContext (Microsoft code signing)
     SEQUENCE (2 elem)
       OBJECT IDENTIFIER 1.3.6.1.4.1.311.2.1.11 spcStatementType (Microsoft code signing)
       SET (1 elem)
         SEQUENCE (1 elem)
           OBJECT IDENTIFIER 1.3.6.1.4.1.311.2.1.21 individualCodeSigning (Microsoft)
     SEQUENCE (2 elem)
       OBJECT IDENTIFIER 1.2.840.113549.1.9.4 messageDigest (PKCS )
       SET (1 elem)
         OCTET STRING (20 byte) 7C87D331C6E62C0EC840BC23CA63FBC2CE68586F
```

 - Allow the program name and/or more info to be missing from SpcSpOpusInfo.
   Examples:
```
     8a364e0881fd7201cd6f0a0ff747451c9b93182d5699afb28ad8466f7f726660:
     SEQUENCE (2 elem)
       OBJECT IDENTIFIER 1.3.6.1.4.1.311.2.1.12 spcSpOpusInfo (Microsoft code signing)
       SET (1 elem)
         SEQUENCE (0 elem)

     0059fb3f225c5784789622eeccb97197d591972851b63d59f5bd107ddfdb7a21:
     SEQUENCE (2 elem)
       OBJECT IDENTIFIER 1.3.6.1.4.1.311.2.1.12 spcSpOpusInfo (Microsoft code signing)
       SET (1 elem)
         SEQUENCE (1 elem)
           [0] (1 elem)
             [0] (22 byte) 0047006F0054006F0020004F00700065006E00650072
```

 - I removed the #if 0 ContentInfo from being populated, and the code worked
   with all of the test samples I used... Is there another reason this code
   is commented out?

 - The authenticated_attribytes content_name_ member now gets populated. This
   was commented out with a TODO by it... Is there a reason this field wasn't
   being populated?

 - When the SignerInfo is printed, it will now show 'N/A' if no value was
   parsed out from the executable
2019-07-09 13:51:20 -04:00
Romain Thomas
91eb4783c3 Resolve 2019-07-08 08:40:10 +02:00
Romain Thomas
8f2770506d Remove unecessary file 2019-07-08 08:14:20 +02:00
Romain
826965be1b
Merge pull request from jlewallen/master
Fix performance issue parsing relocations.
2019-06-26 09:18:15 +02:00
Romain Thomas
bd9be9a765 Add notice regarding LIEF imphash implementation
Related to 
2019-06-26 09:10:35 +02:00
Jacob Lewallen
3be83b7b22 Fix performance issue parsing relocations.
Uses a map to track added relocations.
2019-06-24 19:53:15 -07:00
Romain Thomas
7ff0859879 Fix terminal columns 2019-06-23 10:20:21 +02:00
Romain Thomas
778763de88 Fix Python return value policy for `get_symbol()`
Resolve 
2019-06-23 10:19:14 +02:00
Romain
9dd9ded098
Merge pull request from mackncheesiest/LIEF-300
Fixes issues with printing/serializing notes
2019-06-08 15:38:16 +02:00
Joshua Mack
89c7afa680 Adds regression check for Note::dump segfault 2019-06-07 18:04:08 -07:00
Joshua Mack
d188fbdd23 Assigns alignment of note segments that are added by lief user
Adds support for serialization of hwcap and unknown notes through
Builder::build()

Gives unknown note types a default ".note" namespace rather than
potentially alias a ".note.unknown" type in the future
2019-06-07 14:37:34 -07:00
Joshua Mack
c9c49bb4b8 Adds ability to clone ELF NoteDetails objects
Subsequently, calling print(mybin) on an ELF binary that has a new note
added it no longer segfaults
2019-06-06 21:34:03 -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
Romain Thomas
8fb74bec60 Fix ELF `patch_address` function for object files (.o) 2019-05-20 11:01:40 +02:00
Romain Thomas
22344e764e Fix conflict when the builder tries to resolve the DT_XXX_ARRAY section 2019-05-20 10:59:39 +02:00
Romain Thomas
3730e447e1 Add ANBU 2019-05-13 17:09:11 +02:00
Romain Thomas
1bd6cb8120 Use compiler shstrtab name 2019-05-13 17:04:40 +02:00
Romain Thomas
ca846b3ce7 Add Wiggle 2019-05-11 10:41:08 +02:00
Romain Thomas
352fa954a1 Set LIEF_EXPORTS for LIEF shared library 2019-05-11 10:40:52 +02:00
Romain Thomas
31db3adf34 Fix typo 2019-05-11 08:39:45 +02:00
Romain Thomas
084fc4544f Resolve 2019-05-11 08:14:19 +02:00
Romain Thomas
6824548665 Bump version for nightly build
Issue: 
2019-05-11 08:08:23 +02:00
Romain Thomas
f4ba8b199e Fix (bad) bound checking 2019-05-07 16:12:16 +02:00
Romain Thomas
27a03a6fd3 Force GLIBCXX_USE_CXX11_ABI 2019-05-04 07:17:03 +02:00
Romain Thomas
35805fb598 Explicitly export function 2019-05-03 21:00:08 +02:00
Romain Thomas
36a7eeda2a Fix 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
4608af8280 Remove not unnecessary dependencies 2019-04-15 21:01:35 +02:00
Romain Thomas
f20b1600c9 Install elf,pe,macho_reader when installing python api 2019-04-02 17:10:21 +02:00
Romain Thomas
22cd81cfd8 Fix typo 2019-04-01 14:47:51 +02:00
Romain Thomas
449a56b3a9 Merge branch 'enhancement/setup' 2019-03-31 10:15:38 +02:00
Romain Thomas
0d03b4bdb8 Improve Python setup 2019-03-31 10:15:08 +02:00
Romain
57c30b8bd5
Update issue templates 2019-03-30 16:13:12 +01:00
Romain
779529b1b8
Merge pull request from lief-project/romainthomas-patch-1
Update issue templates
2019-03-30 16:12:02 +01:00
Romain
2129f645e3
Update issue templates 2019-03-30 16:11:22 +01:00
Romain
6c5889d9f2
Merge pull request from nezetic/fix_macho
Add support for adding LC_UNIXTHREAD commands in a MachO
2019-03-30 09:38:37 +01:00
Cédric Tessier
64d2597284 Add support for adding LC_UNIXTHREAD commands in a MachO (include minor fixes) 2019-03-29 16:54:17 +01:00
Romain Thomas
a6adf242df Fix typo 2019-03-29 13:45:09 +01:00
Romain Thomas
b26abae9a9 Fix 2019-03-25 20:38:28 +01:00