LIEF: Library to Instrument Executable Formats Version 0.17.0
Loading...
Searching...
No Matches
VDEX/File.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_FILE_H
17#define LIEF_VDEX_FILE_H
18#include <ostream>
19
20#include "LIEF/VDEX/Header.hpp"
22
23#include "LIEF/visibility.h"
24#include "LIEF/Object.hpp"
25#include "LIEF/iterators.hpp"
26
27#include <vector>
28#include <memory>
29
30namespace LIEF {
31namespace DEX {
32class File;
33}
34namespace OAT {
35class Binary;
36}
37
38namespace VDEX {
39class Parser;
40class LIEF_API File : public Object {
43 friend class Parser;
44 friend class OAT::Binary;
45
46 public:
47 using dex_files_t = std::vector<std::unique_ptr<DEX::File>>;
48 using it_dex_files = ref_iterator<dex_files_t&, DEX::File*>;
49 using it_const_dex_files = const_ref_iterator<const dex_files_t&, const DEX::File*>;
50
51 File& operator=(const File& copy) = delete;
52 File(const File& copy) = delete;
53 const Header& header() const;
56 Header& header();
57 it_dex_files dex_files();
60 it_const_dex_files dex_files() const;
61
62 dex2dex_info_t dex2dex_info() const;
63
64 std::string dex2dex_json_info();
65
66 void accept(Visitor& visitor) const override;
67
68
69 ~File() override;
70
71 LIEF_API friend std::ostream& operator<<(std::ostream& os, const File& vdex_file);
72
73 private:
74 File();
75
76 Header header_;
77 dex_files_t dex_files_;
78};
79
80}
81}
82
83#endif
Class that represents a DEX file.
Definition DEX/File.hpp:39
Definition OAT/Binary.hpp:41
Main class for the VDEX module which represents a VDEX file.
Definition VDEX/File.hpp:42
std::string dex2dex_json_info()
it_dex_files dex_files()
Iterator over LIEF::DEX::Files registered.
~File() override
File(const File &copy)=delete
File & operator=(const File &copy)=delete
it_const_dex_files dex_files() const
const Header & header() const
VDEX Header.
friend std::ostream & operator<<(std::ostream &os, const File &vdex_file)
void accept(Visitor &visitor) const override
dex2dex_info_t dex2dex_info() const
Header & header()
Class which parse an VDEX file and transform into a VDEX::File object.
Definition VDEX/Parser.hpp:32
Definition DEX/Class.hpp:30
Definition ELF/Parser.hpp:32
Definition OAT/Binary.hpp:31
LIEF namespace.
Definition Abstract/Binary.hpp:36
#define LIEF_API
Definition visibility.h:41