21 Commits

Author SHA1 Message Date
a.yankovich
d7fa0b2d4b Merge remote-tracking branch 'rem/master' 2019-12-23 18:37:16 +03:00
Stefan Siegfried
bd68ba418f Populate Rich header version strings (#94) 2019-11-16 17:45:55 +01:00
William Woodruff
67a09499bf
parse: Fix unsafe cast (#96)
* parse: Fix unsafe cast

* parse: Fix uninitialized warning

This is a false positive from cl.exe's /W4: We only
use this variable in a branch where it ends up initialized.
2019-10-24 01:15:56 -04:00
William Woodruff
40987e1f7e
pe-parser-library: Fix GetDataDirectoryEntry (#95)
* pe-parser-library: Fix GetDataDirectoryEntry

Avoids UB.

* pe-parser-library: clang-format

* pe-parser-library: Use ref
2019-10-21 19:51:41 -04:00
William Woodruff
b3ab75577d
parse: Remove debug print 2019-10-21 12:18:18 -04:00
William Woodruff
2c775e5d6a
Directory entry retrieval (#90)
* pe-parser-library: Directory entry extraction

Also runs clang-format on all library files.

* dump-pe: Refactor, clang-format

* pe-parser-library: Use enum for directory kinds

* travis: Refactor

* travis: Fixup stages

* travis: Fix matrix

* examples, pe-parser-library, pepy: clang-format

* travis: Use minimal for lint

* travis: Use find

* clang-format: Remove old option

* travis: More experimentation

* travis: Move addons

* travis: Remove coverity

* travis: Hackery

* travis: Move addons up

* .travis: clang-format-8

* examples: clang-format

* travis: Fix homebrew

* CONTRIBUTING: Add contrib guidelines

* travis: Build python ext, reenable coverity

Remove old build files.

* travis: Re-add coverity secret

* travis: Build with coverity in a separate dir
2019-10-21 09:00:54 -04:00
b69a5fdcbb Merge remote-tracking branch 'r/master' 2019-10-16 12:01:56 +03:00
Stefan Siegfried
1544c61c38 Initial impl. of Rich header parser. (#89)
* Initial impl. of Rich header parser. Closes trailofbits/pe-parse#83

* Fix const correctness per @woodruffw PR review
2019-10-14 15:57:54 -04:00
Jack Williams
6ee67f63e1 Icu and codecvt 2 (#88)
* Support for Windows codecvt and icu4c

* Add dependency for Travis

* Update README

* Fix codecvt build for linux

* Fix linux builds

* Fix copyright
2019-09-16 20:59:24 -04:00
2674c08364 remove worning log 2019-04-06 14:39:14 +03:00
e2aa74a854 qmake support added 2019-03-25 15:27:06 +03:00
59c4c1c0de added support for qmake 2019-03-23 20:39:36 +03:00
Jack Williams
724247d321 Goodness for dump-pe utility (#80) 2018-10-16 17:37:48 -04:00
Jack Williams
766b183a1b Explicit use of std namespace, prefer std::vector over std::list, never use std::endl (#74) 2018-09-24 11:10:29 -04:00
William Woodruff
697714b379
parse: Limit resource table recursion to 3 levels (#77) 2018-09-21 11:06:08 -04:00
William Woodruff
0f740c43ab
buffer, parse: Fix overread on {d,q,}words
When read 2, 4, or 8 bytes from a bounded_buffer, we only
checked to see if the offset, not the whole span, was in bounds.

This results in an arbitrary memory read of up to 1, 3, or 7 bytes
when the offset is aligned with the very end of the buffer.
2018-09-20 10:57:22 -04:00
Jack Williams
6fa093aa42 Minor update to machine and subsytem constants (#72) 2018-09-05 15:22:05 +02:00
Jack Williams
2664eec5f6 Add machine and subsytem to-string methods (#71)
* Add machine and subsytem enums and to-string methods

* Minor fix
2018-08-31 17:44:22 +02:00
Alessandro Gario
9545944ea5 Fix symbol table parsing (#65)
The following issues were found and corrected:

1. Auxiliary symbols were not being counted; this caused
   the parser to loop above the actual number of symbols
2. When parsing auxiliary symbols, it is best to position
   the offset manually at the start of the next data
   structure (everything is padded to 18 bytes)
3. Some auxiliary symbol handlers were not correctly
   updating the file offset
4. Print a warning when skipping auxiliary symbols

This closes #65
2018-04-16 10:26:55 +02:00
Alessandro Gario
50ca8192e6
MSVC: Fix compilation warning caused by ::toupper (#64) 2018-03-26 13:40:48 +02:00
Alessandro Gario
b60b908fa2 Install public headers, add Arch package, build pepy under Travis and more (#57)
* CMake: Added install directives

* CMake: Added support for find_package(pe-parse)

* Fixed a compilation error on Linux

* CMake: Fix cmake module installation

* Added ArchLinux package

* Finished implementing the address converted example

* peaddrconv: Print the image base address.

* peaddrconv: Enable more warnings.

* Update travis to also build the examples

* Fix a compilation warning on Ubuntu 14.04

* Travis: Add macOS support.

* Better output for Travis, fix a compilation error on macOS.

* Travis: Do not build examples under macOS.

* Travis: Also compile the python module (pepy)

* Readme: Add a section to show how to use the library.

* Windows: Fix a compilation error, enable /analyze (see details).

The nt-headers.h include file is defining several constexpr values
using reserved (by windows.h) names.

These names (i.e.: IMAGE_FILE_MACHINE_UNKNOWN) are in fact macros
defined inside the Windows header files, and causes the preprocessor
to break definitions such as the following one:

constexpr std::uint16_t IMAGE_FILE_MACHINE_UNKNOWN = 0x0;

The fix (for now) consists in including the nt-headers.h file before
windows.h, but we should probably choose whether to use different
names or avoid defining those values (since they are inside the
system header anyway).
2017-11-25 16:01:53 -05:00