LIEF: Library to Instrument Executable Formats Version 0.15.0
Loading...
Searching...
No Matches
VDEX/Header.hpp
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
21#include "LIEF/VDEX/type_traits.hpp"
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
35 Header();
36
37 template<class T>
38 LIEF_LOCAL Header(const T* header);
39
40 Header(const Header&);
41 Header& operator=(const Header&);
42
44 magic_t magic() const;
45
47 vdex_version_t version() const;
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.
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.
Class which parse an VDEX file and transform into a VDEX::File object.
Definition VDEX/Parser.hpp:32
Definition Visitor.hpp:219
LIEF namespace.
Definition Abstract/Binary.hpp:32