Commit Graph

317 Commits

Author SHA1 Message Date
Romain Thomas 969411f8ef Welcome 2023 2023-01-03 10:38:09 +01:00
Romain Thomas 1149e81c2b Merge pull request #849 from mrexodia/msvc-runtime
Fix MSVC runtime selection
2023-01-03 09:20:42 +00:00
Duncan Ogilvie bbdc62f691 Fix MSVC runtime selection 2023-01-02 17:30:42 +01:00
Romain Thomas b3167cb78b Fix missing relationship between symbols and sections
See: #841
2022-12-11 09:01:31 +01:00
Romain Thomas 2a10494b8a Enhance the Python IO interface
Related to #832
2022-12-09 10:22:53 +01:00
Romain Thomas 81fd78e81e Use the span/bytes interface (#833) 2022-12-07 08:22:25 +01:00
Romain Thomas 85ce881011 Process #833 2022-12-07 08:22:25 +01:00
Romain Thomas d445beaac3 Expose 'remove_dynamic_symbol' 2022-11-24 04:22:22 +01:00
Romain Thomas 91d5162be4 Enable support for parsing a Mach-O from memory 2022-11-22 10:55:15 +01:00
Romain Thomas 803127cf52 Resolve #816 2022-11-09 17:55:54 +01:00
Romain Thomas 9dbbc39c65 Update dependencies 2022-11-01 08:16:36 +01:00
Wilson Martin 7e624c997a Bugfix for ImportEntry to accept PE_TYPE
In the Python bindings, a new instance of ImportEntry
has it's type hard-coded to PE_TYPE::PE32, with no
way to change the type once created.

This prevents adding new ordinal imports to PE32+,
aka 64-bit, binaries.

The fix is to allow ImportEntry to also accept PE_TYPE.
In addition, the unittest also documents how to add an ordinal
using LIEF.

* Update ImportEntry to accept PE_TYPE
* Update python bindings for ImportEntry
* Add unittest for ImportEntry and ordinals
2022-10-12 14:38:56 -04:00
Romain Thomas f29aa6ba0d Fix DOWNLOAD_EXTRACT_TIMESTAMP warning 2022-09-12 06:31:28 +02:00
Romain Thomas 27754bc698 Update bindings 2022-08-13 04:53:27 +02:00
ζeh Matt 6085bbc949 Use explicit function signature for python bindings on write function 2022-07-22 06:36:35 +02:00
Romain Thomas 0c244dab90 Fix #735 2022-07-03 06:41:38 +02:00
David Sanders 10f8d01b8d Improve Mach-O handling of page size 2022-06-18 11:00:27 -07:00
David Sanders 06d492b8f6 Fix ordering of resource node childs in PE 2022-06-17 05:07:57 +00:00
Romain Thomas fa306af477 Bump pybind11 version 2022-06-17 06:48:58 +02:00
David Sanders 0ecd6682c7 Add API to remove a section from a segment & section names 2022-06-12 07:03:48 +00:00
Romain Thomas e1a8244b92 Enhance Mach-O's builder and add support for recent LC commands 2022-04-16 15:10:56 +02:00
Romain Thomas 7412a4c50c Add API to get a section from a segment & section names 2022-04-04 06:24:37 +02:00
Romain Thomas 266f989e52 Enable support for modifying section-less ELF binaries 2022-04-03 19:34:44 +02:00
Romain Thomas baa023b914 Remove exceptions 2022-04-01 05:38:30 +02:00
Romain Thomas 946b66550c Fix Python life time issue
Resolve #688
2022-03-31 07:15:46 +02:00
Romain Thomas b421535b8e Re-compute the OptionalHeader's checksum
Resolve #660
2022-03-07 07:44:28 +01:00
Romain Thomas 7f878f40ee Enable to re-compute the PE rich header
Resolve #587
2022-03-05 21:29:53 +01:00
Wolf Vollprecht a15c6d1240 allow external pybind11 2022-03-05 11:42:04 +01:00
Romain Thomas 9511d9fccf Update doc according to #675 2022-03-05 10:19:12 +01:00
Romain Thomas ba54ea632b Add support for PE delayed imports
Resolve #664
2022-03-01 06:18:44 +01:00
Adrian Haensler 9331982bfe support update of auxiliary symbol versions and adding new SymbolVersionAuxRequirements 2022-02-25 05:08:44 +01:00
Romain Thomas 3816cccd95 Improve Mach-O relocations parser 2022-02-16 22:42:03 +01:00
Romain Thomas 8fcff6e8e3 Proprify PE resources handling 2022-02-16 05:32:25 +01:00
Romain Thomas 274d887e17 Update PE parser interface 2022-02-14 06:40:06 +01:00
Romain Thomas 50986fcaf1 Use a span interface 2022-02-13 10:39:38 +01:00
Romain Thomas 05e3c6eb7c Fix memory issues 2022-02-12 17:10:23 +01:00
Romain Thomas 77328b0071 Bump year 2022-02-08 21:16:25 +01:00
Romain Thomas e9782c5927 Clean & modernize LIEF code base
This commit (obviously non-atomic) cleans LIEF's code base by:
  - Using pointer semantics (`std::unique_ptr<>`)
  - Using LEAF boost error in the binary stream
  - Reducing the scope of the iterators (`it_section`, ...)
  - Removing `Structures.hpp` from the public headers
  - etc
2022-02-05 06:09:06 +01:00
Romain Thomas b730ec068d Hide the JSON implementation of LIEF
This commit removes the public include of nlohmann/json
as it is a *detail of implementation*. Instead, the public
API exposes:

```cpp
std::string to_json(...);
```

In addition, it enables to externally provide nlohmann/json using
the cmake option ``-DLIEF_OPT_NLOHMANN_JSON_EXTERNAL=on``.
For instance, this option can be used as follows:

```bash
$ cmake -DLIEF_OPT_NLOHMANN_JSON_EXTERNAL=on \
        -Dnlohmann_json_DIR=<PATH>/lib/cmake/nlohmann_json
```

Related to #605
2022-01-29 09:51:03 +01:00
rthomas a615adbee4 This commit cleans and modernizes the code base of LIEF.
Among the changes:

- It removes the ``and, or, not`` keywords
- It updates the Documentation
- It moves the internal structures in the ``details::`` namespace
2022-01-27 20:18:54 +01:00
Nicolas Iooss bb7faf3e72 Support setting ELF header identity from bytes
The following Python code currently fails with Python 3.9:

    import lief
    elf = lief.ELF.Binary("test", lief.ELF.ELF_CLASS.CLASS32)
    elf.header.identity = bytes.fromhex("7f454c46010101000000000000000000")

The reported error is:

    TypeError: b'\x7fELF\x01\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00' is not supported!

It is possible to use `.decode()` to convert the bytes to string, or to
use `list(...)` to convert them to a list of integers. Both these
solutions work, but they are not as elegant as directly using `bytes`.

Modify the `identity` setter to support bytes. As `Header::identity_t`
is directly an array of `uint8_t`, casting it from `py::bytes` is
straightforward.
2022-01-24 23:18:20 +01:00
Romain Thomas 72ebe0d89e Refector the ELF builder 2022-01-22 13:23:52 +01:00
Romain Thomas 076bd5cd23 Resolve #644 2022-01-16 17:04:47 +01:00
hypervis0r e12dafbfc0 Add reserved PE data directory 2022-01-02 10:48:07 +01:00
Romain Thomas 47b8495973 Bump Pybind11 2021-12-24 12:04:13 +01:00
fanquake f080d582b6 Add RISCV architecture 2021-12-21 06:54:46 +01:00
Romain Thomas 92812dfe2e Redesign the configuration of the MachO parser 2021-12-18 12:05:30 +01:00
Romain Thomas b2fc5ba9be Update fields in PE::LoadConfiguration
It seems that on recent version on the SDK, Microsoft renamed the
field LoadConfiguration::reserved1 into DependentLoadFlags.

This commit create an alias on this field

Resolve #621
2021-10-19 05:27:33 +02:00
Dongdong Zhang 89ea7a12c6 Fix iterator performance issue 2021-10-12 11:24:37 +08:00
Dongdong Zhang f619864eca Fix broken python API doc for Android formats 2021-09-23 13:29:01 +00:00