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
VDEX
VDEX/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_VDEX_PARSER_H
17
#define LIEF_VDEX_PARSER_H
18
19
#include <string_view>
20
#include <memory>
21
#include <vector>
22
23
#include "
LIEF/VDEX/type_traits.hpp
"
24
#include "
LIEF/path.hpp
"
25
#include "
LIEF/visibility.h
"
26
27
namespace
LIEF
{
28
class
VectorStream
;
29
namespace
VDEX
{
30
class
File
;
31
33
class
LIEF_API
Parser
{
34
public
:
35
static
std::unique_ptr<File>
parse
(std::string_view file);
36
39
template
<
class
PathT, enable_if_path_t<PathT> = 0>
40
static
std::unique_ptr<File>
parse
(
const
PathT& file) {
41
return
parse
(file.string());
42
}
43
44
static
std::unique_ptr<File>
parse
(
const
std::vector<uint8_t>& data,
45
std::string_view name =
""
);
46
47
Parser
&
operator=
(
const
Parser
& copy) =
delete
;
48
Parser
(
const
Parser
& copy) =
delete
;
49
50
private
:
51
Parser
();
52
Parser
(std::string_view file);
53
Parser
(
const
std::vector<uint8_t>& data, std::string_view name);
54
~Parser
();
55
56
void
init(std::string_view name,
vdex_version_t
version
);
57
58
template
<
typename
VDEX_T>
59
void
parse_file();
60
61
template
<
typename
VDEX_T>
62
void
parse_header();
63
64
template
<
typename
VDEX_T>
65
void
parse_checksums();
66
67
template
<
typename
VDEX_T>
68
void
parse_dex_files();
69
70
template
<
typename
VDEX_T>
71
void
parse_verifier_deps();
72
73
template
<
typename
VDEX_T>
74
void
parse_quickening_info();
75
76
LIEF::VDEX::File
* file_ =
nullptr
;
77
std::unique_ptr<VectorStream> stream_;
78
};
79
80
}
81
}
82
#endif
type_traits.hpp
LIEF::VDEX::File
Main class for the VDEX module which represents a VDEX file.
Definition
VDEX/File.hpp:42
LIEF::VDEX::Parser::parse
static std::unique_ptr< File > parse(const std::vector< uint8_t > &data, std::string_view name="")
LIEF::VDEX::Parser::parse
static std::unique_ptr< File > parse(const PathT &file)
Same as parse(std::string_view) but the file is given as a std::filesystem::path.
Definition
VDEX/Parser.hpp:40
LIEF::VDEX::Parser::operator=
Parser & operator=(const Parser ©)=delete
LIEF::VDEX::Parser::parse
static std::unique_ptr< File > parse(std::string_view file)
LIEF::VDEX::Parser::Parser
Parser(const Parser ©)=delete
LIEF::VectorStream
Definition
VectorStream.hpp:29
LIEF::VDEX
Definition
OAT/Binary.hpp:31
LIEF::VDEX::version
vdex_version_t version(std::string_view file)
Return the VDEX version of the given file.
LIEF::VDEX::vdex_version_t
uint32_t vdex_version_t
Definition
VDEX/type_traits.hpp:28
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