LIEF: Library to Instrument Executable Formats Version 2.0.0
Loading...
Searching...
No Matches
VDEX/Header.hpp
Go to the documentation of this file.
1/* Copyright 2017 - 2026 R. Thomas
2 *
3 * Licensed under the Apache License, Version 2.0 (the "License");
4 * you may not use this file except in compliance with the License.
5 * You may obtain a copy of the License at
6 *
7 * http://www.apache.org/licenses/LICENSE-2.0
8 *
9 * Unless required by applicable law or agreed to in writing, software
10 * distributed under the License is distributed on an "AS IS" BASIS,
11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 * See the License for the specific language governing permissions and
13 * limitations under the License.
14 */
15#ifndef LIEF_VDEX_HEADER_H
16#define LIEF_VDEX_HEADER_H
17#include <array>
18#include <ostream>
19
20#include "LIEF/Object.hpp"
22#include "LIEF/visibility.h"
23
24
25namespace LIEF::VDEX {
26class Parser;
27
28class LIEF_API Header : public Object {
29 friend class Parser;
30
31 public:
32 using magic_t = std::array<uint8_t, 4>;
33
35
36 template<class T>
37 LIEF_LOCAL Header(const T* header);
38
39 Header(const Header&);
41
43 magic_t magic() const;
44
47
49 uint32_t nb_dex_files() const;
50
52 uint32_t dex_size() const;
53
55 uint32_t verifier_deps_size() const;
56
58 uint32_t quickening_info_size() const;
59
60 void accept(Visitor& visitor) const override;
61
62
63 LIEF_API friend std::ostream& operator<<(std::ostream& os, const Header& header);
64
65 ~Header() override;
66
67 private:
68 magic_t magic_;
69 vdex_version_t version_;
70
71 uint32_t nb_dex_files_;
72 uint32_t dex_size_;
73
74 uint32_t verifier_deps_size_;
75 uint32_t quickening_info_size_;
76};
77
78} // Namespace VDEX
79// Namespace LIEF
80
81#endif
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)
friend class Parser
Definition VDEX/Header.hpp:29
Header(const Header &)
friend std::ostream & operator<<(std::ostream &os, const Header &header)
std::array< uint8_t, 4 > magic_t
Definition VDEX/Header.hpp:32
void accept(Visitor &visitor) const override
~Header() override
Class which parses a VDEX file and transforms it into a VDEX::File object.
Definition VDEX/Parser.hpp:32
Definition Visitor.hpp:211
Definition OAT/Binary.hpp:31
uint32_t vdex_version_t
Definition VDEX/type_traits.hpp:27
#define LIEF_API
Definition visibility.h:44
#define LIEF_LOCAL
Definition visibility.h:45