1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93
|
/* Copyright 2017 R. Thomas
* Copyright 2017 Quarkslab
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef LIEF_VDEX_STRUCTURES_H_
#define LIEF_VDEX_STRUCTURES_H_
#include <cstring>
#include <tuple>
#include "LIEF/types.hpp"
#include "LIEF/VDEX/enums.hpp"
namespace LIEF {
//! @brief Namespace related to the LIEF's VDEX module
namespace VDEX {
static constexpr uint8_t magic[] = { 'v', 'd', 'e', 'x' };
static constexpr vdex_version_t vdex_version = 0;
using checksum_t = uint32_t;
struct header {
uint8_t magic[4];
uint8_t version[4];
uint32_t number_of_dex_files;
uint32_t dex_size;
uint32_t verifier_deps_size;
uint32_t quickening_info_size;
};
// =======================
// VDEX Version 6
// ========================
namespace VDEX_6 {
using header = VDEX::header;
static constexpr vdex_version_t vdex_version = 6;
}
// =======================
// VDEX Version 10
// ========================
namespace VDEX_10 {
using header = VDEX::header;
static constexpr vdex_version_t vdex_version = 10;
}
// =======================
// VDEX Version 11
// ========================
namespace VDEX_11 {
using header = VDEX::header;
static constexpr vdex_version_t vdex_version = 11;
}
class VDEX6 {
public:
using vdex_header = VDEX_6::header;
static constexpr vdex_version_t vdex_version = VDEX_6::vdex_version;
};
class VDEX10 {
public:
using vdex_header = VDEX_10::header;
static constexpr vdex_version_t vdex_version = VDEX_10::vdex_version;
};
class VDEX11 {
public:
using vdex_header = VDEX_11::header;
static constexpr vdex_version_t vdex_version = VDEX_11::vdex_version;
};
@LIEF_VDEX_STRUCTURES@
} /* end namespace VDEX */
} /* end namespace LIEF */
#endif
|