Files
lief-project-LIEF/examples/cpp/pe_authenticode_check.cpp
T
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

23 lines
499 B
C++

#include <iostream>
#include <memory>
#include <LIEF/PE.hpp>
#include <LIEF/logging.hpp>
using namespace LIEF::PE;
int main(int argc, char **argv) {
if (argc != 2) {
std::cerr << "Usage: " << argv[0] << " <PE binary>" << "\n";
return 1;
}
std::unique_ptr<const Binary> binary = Parser::parse(argv[1]);
if (binary->verify_signature() != Signature::VERIFICATION_FLAGS::OK) {
std::cerr << "Signature failed!\n";
return 1;
}
std::cout << "Signature ok!\n";
return 0;
}