LIEF: Library to Instrument Executable Formats
Version 2.0.0
Toggle main menu visibility
Loading...
Searching...
No Matches
lief-install
x86_64
static
include
LIEF
Abstract
Abstract/Parser.hpp
Go to the documentation of this file.
1
/* Copyright 2017 - 2026 R. Thomas
2
* Copyright 2017 - 2026 Quarkslab
3
*
4
* Licensed under the Apache License, Version 2.0 (the "License");
5
* you may not use this file except in compliance with the License.
6
* You may obtain a copy of the License at
7
*
8
* http://www.apache.org/licenses/LICENSE-2.0
9
*
10
* Unless required by applicable law or agreed to in writing, software
11
* distributed under the License is distributed on an "AS IS" BASIS,
12
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
* See the License for the specific language governing permissions and
14
* limitations under the License.
15
*/
16
#ifndef LIEF_ABSTRACT_PARSER_H
17
#define LIEF_ABSTRACT_PARSER_H
18
19
#include <string_view>
20
#include <cstdint>
21
#include <memory>
22
#include <vector>
23
24
#include "
LIEF/path.hpp
"
25
#include "
LIEF/visibility.h
"
26
27
namespace
LIEF
{
28
class
BinaryStream
;
29
class
Binary
;
30
32
class
LIEF_API
Parser {
33
public
:
38
static
std::unique_ptr<Binary>
parse
(std::string_view filename);
39
42
template
<
class
PathT, enable_if_path_t<PathT> = 0>
43
static
std::unique_ptr<Binary>
parse
(
const
PathT& filename) {
44
return
parse
(filename.string());
45
}
46
47
52
static
std::unique_ptr<Binary>
parse
(
const
std::vector<uint8_t>& raw);
53
58
static
std::unique_ptr<Binary>
parse
(std::unique_ptr<BinaryStream> stream);
59
60
protected
:
61
Parser(std::string_view file);
62
uint64_t binary_size_ = 0;
63
64
~Parser() =
default
;
65
Parser();
66
};
67
}
68
69
#endif
LIEF::BinaryStream
Class that is used to a read stream of data from different sources.
Definition
BinaryStream.hpp:35
LIEF::Binary
Generic interface representing a binary executable.
Definition
Abstract/Binary.hpp:60
LIEF::Parser::parse
static std::unique_ptr< Binary > parse(const std::vector< uint8_t > &raw)
Construct an LIEF::Binary from the given raw data.
LIEF::Parser::parse
static std::unique_ptr< Binary > parse(std::unique_ptr< BinaryStream > stream)
Construct an LIEF::Binary from the given stream.
LIEF::Parser::parse
static std::unique_ptr< Binary > parse(std::string_view filename)
Construct an LIEF::Binary from the given filename.
LIEF::Parser::parse
static std::unique_ptr< Binary > parse(const PathT &filename)
Same as parse(std::string_view) but the file is given as a std::filesystem::path.
Definition
Abstract/Parser.hpp:43
LIEF
LIEF namespace.
Definition
Abstract/Binary.hpp:41
path.hpp
visibility.h
LIEF_API
#define LIEF_API
Definition
visibility.h:45
Generated by
1.18.0