16#ifndef LIEF_OAT_BINARY_H
17#define LIEF_OAT_BINARY_H
49 using classes_t = std::unordered_map<std::string, Class*>;
58 using methods_t = std::vector<std::unique_ptr<Method>>;
62 using dex2dex_info_t = std::unordered_map<const DEX::File*, DEX::dex2dex_info_t>;
85 bool has_class(
const std::string& class_name)
const;
109 return vdex_ !=
nullptr;
113 return bin->
format() == Binary::FORMATS::OAT;
124 void add_class(std::unique_ptr<Class> cls);
135 std::unique_ptr<VDEX::File> vdex_;
Abstract binary that exposes an uniform API for the different executable file formats.
Definition Abstract/Binary.hpp:41
FORMATS format() const
Executable format (ELF, PE, Mach-O) of the underlying binary.
Definition Abstract/Binary.hpp:98
Class which represents an ELF binary.
Definition ELF/Binary.hpp:59
Definition OAT/Binary.hpp:41
Class * get_class(const std::string &class_name)
it_dex_files dex_files()
Iterator over LIEF::DEX::File.
friend std::ostream & operator<<(std::ostream &os, const Binary &binary)
Binary(const Binary ©)=delete
std::unordered_map< std::string, Class * > classes_t
Definition OAT/Binary.hpp:49
void accept(Visitor &visitor) const override
Method associated with the visitor pattern.
Class * get_class(size_t index)
dex2dex_info_t dex2dex_info() const
std::vector< std::unique_ptr< DEX::File > > dex_files_t
Definition OAT/Binary.hpp:45
const Class * get_class(size_t index) const
Return the LIEF::OAT::Class at the given index or a nullptr if it does not exist.
bool has_class(const std::string &class_name) const
Check if the current OAT has the given class.
const Class * get_class(const std::string &class_name) const
Return the LIEF::OAT::Class with the given name or a nullptr if the class can't be found.
it_oat_dex_files oat_dex_files()
Iterator over LIEF::OAT::DexFile.
std::vector< std::unique_ptr< Method > > methods_t
Definition OAT/Binary.hpp:58
it_const_oat_dex_files oat_dex_files() const
it_const_dex_files dex_files() const
std::string dex2dex_json_info()
std::vector< std::unique_ptr< Class > > classes_list_t
Definition OAT/Binary.hpp:50
it_const_methods methods() const
Iterator over LIEF::OAT::Method.
std::vector< std::unique_ptr< DexFile > > oat_dex_files_t
Definition OAT/Binary.hpp:54
it_const_classes classes() const
Iterator over LIEF::OAT::Class.
Binary & operator=(const Binary ©)=delete
std::unordered_map< const DEX::File *, DEX::dex2dex_info_t > dex2dex_info_t
Definition OAT/Binary.hpp:62
const Header & header() const
OAT Header.
bool has_vdex() const
Definition OAT/Binary.hpp:108
static bool classof(const LIEF::Binary *bin)
Definition OAT/Binary.hpp:112
Definition OAT/Class.hpp:35
Class to parse an OAT file to produce an OAT::Binary.
Definition OAT/Parser.hpp:38
Main interface to parse an executable regardless of its format.
Definition Abstract/Parser.hpp:30
Main class for the VDEX module which represents a VDEX file.
Definition VDEX/File.hpp:42
Definition Visitor.hpp:224
Iterator which returns reference on container's values.
Definition iterators.hpp:48
LIEF namespace.
Definition Abstract/Binary.hpp:32
#define LIEF_API
Definition visibility.h:41