LSPlant  LSPosed Developers
lsplant::v2::InitInfo Struct Reference

Information and configuration that are needed to call Init() More...

#include <lsplant.hpp>

Public Types

using InlineHookFunType = std::function< void *(void *target, void *hooker)>
 Type of inline hook function. In std::function form so that user can use lambda expression with capture list.
target is the target function to be hooked.
hooker is the hooker function to replace the target function.
return is the backup function that points to the previous target function. it should return null if hook fails and nonnull if successes. More...
 
using InlineUnhookFunType = std::function< bool(void *func)>
 Type of inline unhook function. In std::function form so that user can use lambda expression with capture list.
func is the target function that is previously hooked.
return should indicate the status of unhooking.
More...
 
using ArtSymbolResolver = std::function< void *(std::string_view symbol_name)>
 Type of symbol resolver to libart.so. In std::function form so that user can use lambda expression with capture list.
symbol_name is the symbol name that needs to retrieve.
return is the absolute address in the memory that points to the target symbol. It should be null if the symbol cannot be found.
More...
 
using ArtSymbolPrefixResolver = std::function< void *(std::string_view symbol_prefix)>
 Type of prefix symbol resolver to libart.so. In std::function form so that user can use lambda expression with capture list.
symbol_prefix is the symbol prefix that needs to retrieve.
return is the first absolute address in the memory that points to the target symbol. It should be null if the symbol cannot be found.
More...
 

Data Fields

InlineHookFunType inline_hooker
 The inline hooker function. Must not be null. More...
 
InlineUnhookFunType inline_unhooker
 The inline unhooker function. Must not be null. More...
 
ArtSymbolResolver art_symbol_resolver
 The symbol resolver to libart.so. Must not be null. More...
 
ArtSymbolPrefixResolver art_symbol_prefix_resolver
 The symbol prefix resolver to libart.so. May be null. More...
 
std::string_view generated_class_name = "LSPHooker_"
 The generated class name. Must not be empty. It contains a field and a method and they could be set by generated_field_name and generated_method_name respectively. More...
 
std::string_view generated_source_name = "LSP"
 The generated source name. Could be empty. More...
 
std::string_view generated_field_name = "hooker"
 The generated field name. Must not be empty. More...
 
std::string_view generated_method_name = "{target}"
 The generated class name. Must not be emtpy. If {target} is set, it will follows the name of the target. More...
 

Detailed Description

Information and configuration that are needed to call Init()

Definition at line 14 of file lsplant.hpp.

Member Typedef Documentation

◆ ArtSymbolPrefixResolver

Type of prefix symbol resolver to libart.so. In std::function form so that user can use lambda expression with capture list.
symbol_prefix is the symbol prefix that needs to retrieve.
return is the first absolute address in the memory that points to the target symbol. It should be null if the symbol cannot be found.

Note
It should be able to resolve symbols from both .dynsym and .symtab.

Definition at line 41 of file lsplant.hpp.

◆ ArtSymbolResolver

Type of symbol resolver to libart.so. In std::function form so that user can use lambda expression with capture list.
symbol_name is the symbol name that needs to retrieve.
return is the absolute address in the memory that points to the target symbol. It should be null if the symbol cannot be found.

Note
It should be able to resolve symbols from both .dynsym and .symtab.

Definition at line 33 of file lsplant.hpp.

◆ InlineHookFunType

using lsplant::v2::InitInfo::InlineHookFunType = std::function<void *(void *target, void *hooker)>

Type of inline hook function. In std::function form so that user can use lambda expression with capture list.
target is the target function to be hooked.
hooker is the hooker function to replace the target function.
return is the backup function that points to the previous target function. it should return null if hook fails and nonnull if successes.

Definition at line 21 of file lsplant.hpp.

◆ InlineUnhookFunType

Type of inline unhook function. In std::function form so that user can use lambda expression with capture list.
func is the target function that is previously hooked.
return should indicate the status of unhooking.

Definition at line 26 of file lsplant.hpp.

Field Documentation

◆ art_symbol_prefix_resolver

ArtSymbolPrefixResolver lsplant::v2::InitInfo::art_symbol_prefix_resolver

The symbol prefix resolver to libart.so. May be null.

Definition at line 51 of file lsplant.hpp.

◆ art_symbol_resolver

ArtSymbolResolver lsplant::v2::InitInfo::art_symbol_resolver

The symbol resolver to libart.so. Must not be null.

Definition at line 48 of file lsplant.hpp.

◆ generated_class_name

std::string_view lsplant::v2::InitInfo::generated_class_name = "LSPHooker_"

The generated class name. Must not be empty. It contains a field and a method and they could be set by generated_field_name and generated_method_name respectively.

Definition at line 55 of file lsplant.hpp.

◆ generated_field_name

std::string_view lsplant::v2::InitInfo::generated_field_name = "hooker"

The generated field name. Must not be empty.

Definition at line 59 of file lsplant.hpp.

◆ generated_method_name

std::string_view lsplant::v2::InitInfo::generated_method_name = "{target}"

The generated class name. Must not be emtpy. If {target} is set, it will follows the name of the target.

Definition at line 62 of file lsplant.hpp.

◆ generated_source_name

std::string_view lsplant::v2::InitInfo::generated_source_name = "LSP"

The generated source name. Could be empty.

Definition at line 57 of file lsplant.hpp.

◆ inline_hooker

InlineHookFunType lsplant::v2::InitInfo::inline_hooker

The inline hooker function. Must not be null.

Definition at line 44 of file lsplant.hpp.

◆ inline_unhooker

InlineUnhookFunType lsplant::v2::InitInfo::inline_unhooker

The inline unhooker function. Must not be null.

Definition at line 46 of file lsplant.hpp.


The documentation for this struct was generated from the following file: