LIEF: Library to Instrument Executable Formats
Version 1.0.0
Toggle main menu visibility
Loading...
Searching...
No Matches
install
linux
x86_64
sdk
static
include
LIEF
runtime
android
android/Module.hpp
Go to the documentation of this file.
1
/* Copyright 2017 - 2026 R. Thomas
2
* Copyright 2017 - 2026 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_RUNTIME_ANDROID_MODULE_H
17
#define LIEF_RUNTIME_ANDROID_MODULE_H
18
19
#include "
LIEF/runtime/Module.hpp
"
20
#include "
LIEF/runtime/utils.hpp
"
21
22
namespace
LIEF
{
23
24
namespace
ELF
{
25
class
Binary
;
26
struct
ParserConfig
;
27
}
28
29
namespace
runtime
{
30
namespace
android
{
31
33
class
LIEF_API
Module
:
public
runtime::Module
{
34
public
:
35
using
runtime::Module::Module
;
36
38
static
std::unique_ptr<Module>
from_handle
(
void
* H);
39
43
void
*
handle
()
const
;
44
46
void
*
dlsym
(
const
std::string&
name
)
const
;
47
49
std::unique_ptr<ELF::Binary>
parse_from_path
()
const
;
50
53
std::unique_ptr<ELF::Binary>
54
parse_from_path
(
const
ELF::ParserConfig
& config)
const
;
55
57
std::unique_ptr<ELF::Binary>
58
parse_from_memory
(
const
ELF::ParserConfig
& config)
const
;
59
61
std::unique_ptr<ELF::Binary>
parse_from_memory
()
const
;
62
63
~Module
()
override
=
default
;
64
65
static
constexpr
bool
classof
(
const
runtime::Module
*) {
66
return
platform() ==
PLATFORMS::ANDROID_
;
67
}
68
};
69
71
LIEF_API
std::unique_ptr<Module>
dlopen
(
const
std::string& name);
72
73
}
74
}
75
}
76
#endif
Module.hpp
LIEF::ELF::Binary
Class which represents an ELF binary.
Definition
ELF/Binary.hpp:60
LIEF::runtime::Module
This class represents an in-memory module which can be an executable or a library.
Definition
Module.hpp:42
LIEF::runtime::Module::Module
Module()=delete
LIEF::runtime::Module::name
std::string name() const
Name of the module (e.g. libc.so.6, kernel32.dll, libsystem_c.dylib).
LIEF::runtime::android::Module::Module
Module()=delete
LIEF::runtime::android::Module::parse_from_path
std::unique_ptr< ELF::Binary > parse_from_path() const
Parse the ELF module from its path on the filesystem.
LIEF::runtime::android::Module::dlsym
void * dlsym(const std::string &name) const
Resolve the symbol from with the given name for the current module.
LIEF::runtime::android::Module::parse_from_memory
std::unique_ptr< ELF::Binary > parse_from_memory(const ELF::ParserConfig &config) const
Parse the ELF module from memory with the given configuration.
LIEF::runtime::android::Module::handle
void * handle() const
Return the dlopen handle for this library.
LIEF::runtime::android::Module::~Module
~Module() override=default
LIEF::runtime::android::Module::parse_from_memory
std::unique_ptr< ELF::Binary > parse_from_memory() const
Parse the ELF module from memory.
LIEF::runtime::android::Module::classof
static constexpr bool classof(const runtime::Module *)
Definition
android/Module.hpp:65
LIEF::runtime::android::Module::parse_from_path
std::unique_ptr< ELF::Binary > parse_from_path(const ELF::ParserConfig &config) const
Parse the ELF module from its path on the filesystem and given the parser configuration.
LIEF::runtime::android::Module::from_handle
static std::unique_ptr< Module > from_handle(void *H)
Instantiate a Module from the given dlopen handle.
LIEF::ELF
Namespace related to the LIEF's ELF module.
Definition
Abstract/Header.hpp:28
LIEF::runtime::android
Definition
android/Host.hpp:25
LIEF::runtime::android::dlopen
std::unique_ptr< Module > dlopen(const std::string &name)
Load the library with the given path/name.
LIEF::runtime
Definition
android/Host.hpp:24
LIEF::runtime::PLATFORMS::ANDROID_
@ ANDROID_
Definition
runtime/utils.hpp:32
LIEF
LIEF namespace.
Definition
Abstract/Binary.hpp:41
utils.hpp
LIEF::ELF::ParserConfig
This structure is used to tweak the ELF Parser (ELF::Parser).
Definition
ELF/ParserConfig.hpp:26
LIEF_API
#define LIEF_API
Definition
visibility.h:45
Generated by
1.18.0