LIEF: Library to Instrument Executable Formats Version 0.15.1
Loading...
Searching...
No Matches
VDEX/Header.hpp
Go to the documentation of this file.
1/* Copyright 2017 - 2024 R. Thomas
2 * Copyright 2017 - 2024 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_HEADER_H
17#define LIEF_VDEX_HEADER_H
18#include <ostream>
19#include <array>
20
22#include "LIEF/visibility.h"
23#include "LIEF/Object.hpp"
24
25namespace LIEF {
26namespace VDEX {
27class Parser;
28
29class LIEF_API Header : public Object {
30 friend class Parser;
31
32 public:
33 using magic_t = std::array<uint8_t, 4>;
34
36
37 template<class T>
38 LIEF_LOCAL Header(const T* header);
39
40 Header(const Header&);
42
44 magic_t magic() const;
45
48
50 uint32_t nb_dex_files() const;
51
53 uint32_t dex_size() const;
54
56 uint32_t verifier_deps_size() const;
57
59 uint32_t quickening_info_size() const;
60
61 void accept(Visitor& visitor) const override;
62
63
64 LIEF_API friend std::ostream& operator<<(std::ostream& os, const Header& header);
65
66 ~Header() override;
67
68 private:
69 magic_t magic_;
70 vdex_version_t version_;
71
72 uint32_t nb_dex_files_;
73 uint32_t dex_size_;
74
75 uint32_t verifier_deps_size_;
76 uint32_t quickening_info_size_;
77};
78
79} // Namespace VDEX
80} // Namespace LIEF
81
82#endif
Definition Object.hpp:25
Definition VDEX/Header.hpp:29
uint32_t nb_dex_files() const
Number of LIEF::DEX::File files registered.
Header & operator=(const Header &)
uint32_t verifier_deps_size() const
Size of verifier deps section.
magic_t magic() const
Magic value used to identify VDEX.
vdex_version_t version() const
VDEX version number.
uint32_t dex_size() const
Size of all LIEF::DEX::File.
uint32_t quickening_info_size() const
Size of quickening info section.
Header(const T *header)
Header(const Header &)
friend std::ostream & operator<<(std::ostream &os, const Header &header)
std::array< uint8_t, 4 > magic_t
Definition VDEX/Header.hpp:33
void accept(Visitor &visitor) const override
~Header() override
Class which parse an VDEX file and transform into a VDEX::File object.
Definition VDEX/Parser.hpp:32
Definition Visitor.hpp:224
uint32_t vdex_version_t
Definition VDEX/type_traits.hpp:28
LIEF namespace.
Definition Abstract/Binary.hpp:32
#define LIEF_API
Definition visibility.h:41
#define LIEF_LOCAL
Definition visibility.h:42