plugify
1.0.0.0
|
Represents an assembly (module) within a process. More...
#include <assembly.hpp>
Classes | |
struct | Section |
Represents a section of the assembly. More... | |
Public Types | |
using | SearchDirs = std::vector< std::filesystem::path > |
Public Member Functions | |
Assembly () | |
Default constructor initializing handle to nullptr. | |
~Assembly () | |
Destructor. | |
Assembly (const Assembly &)=delete | |
Assembly & | operator= (const Assembly &)=delete |
Assembly (Assembly &&rhs) noexcept=delete | |
Assembly & | operator= (Assembly &&rhs) noexcept=delete |
Assembly (std::string_view moduleName, LoadFlag flags=LoadFlag::Default, const SearchDirs &additionalSearchDirectories={}, bool sections=false) | |
Constructs an Assembly object with the specified module name, flags, and sections. More... | |
Assembly (const char *moduleName, LoadFlag flags=LoadFlag::Default, const SearchDirs &additionalSearchDirectories={}, bool sections=false) | |
Constructs an Assembly object with a char pointer as module name. More... | |
Assembly (const std::string &moduleName, LoadFlag flags=LoadFlag::Default, const SearchDirs &additionalSearchDirectories={}, bool sections=false) | |
Constructs an Assembly object with a string as module name. More... | |
Assembly (const std::filesystem::path &modulePath, LoadFlag flags=LoadFlag::Default, const SearchDirs &additionalSearchDirectories={}, bool sections=false) | |
Constructs an Assembly object with a filesystem path as module path. More... | |
Assembly (MemAddr moduleMemory, LoadFlag flags=LoadFlag::Default, const SearchDirs &additionalSearchDirectories={}, bool sections=false) | |
Constructs an Assembly object with a memory address. More... | |
MemAddr | FindPattern (MemAddr pattern, std::string_view mask, MemAddr startAddress=nullptr, Section *moduleSection=nullptr) const |
Finds an array of bytes in process memory using SIMD instructions. More... | |
MemAddr | FindPattern (std::string_view pattern, MemAddr startAddress=nullptr, Section *moduleSection=nullptr) const |
Finds a string pattern in process memory using SIMD instructions. More... | |
MemAddr | GetVirtualTableByName (std::string_view tableName, bool decorated=false) const |
Gets an address of a virtual method table by RTTI type descriptor name. More... | |
MemAddr | GetFunctionByName (std::string_view functionName) const noexcept |
Gets an address of a function by its name. More... | |
Section | GetSectionByName (std::string_view sectionName) const noexcept |
Gets a module section by name. More... | |
void * | GetHandle () const noexcept |
Returns the module handle. More... | |
MemAddr | GetBase () const noexcept |
Returns the module base address. More... | |
const std::filesystem::path & | GetPath () const noexcept |
Returns the module path. More... | |
const std::string & | GetError () const noexcept |
Returns the module error. More... | |
bool | IsValid () const noexcept |
Checks if the assembly is valid. More... | |
operator bool () const noexcept | |
Conversion operator to check if the assembly is valid. More... | |
bool | operator== (const Assembly &assembly) const noexcept |
Equality operator. More... | |
Static Public Member Functions | |
static std::pair< std::vector< uint8_t >, std::string > | PatternToMaskedBytes (std::string_view input) |
Converts a string pattern with wildcards to an array of bytes and mask. More... | |
Represents an assembly (module) within a process.
Definition at line 15 of file assembly.hpp.
|
explicit |
Constructs an Assembly object with the specified module name, flags, and sections.
moduleName | The name of the module. |
flags | Optional flags for module initialization. |
additionalSearchDirectories | Optional additional search directories. |
sections | Optional flag indicating if sections should be initialized. |
|
inlineexplicit |
Constructs an Assembly object with a char pointer as module name.
moduleName | The name of the module as a char pointer. |
flags | Optional flags for module initialization. |
additionalSearchDirectories | Optional additional search directories. |
sections | Optional flag indicating if sections should be initialized. |
Definition at line 85 of file assembly.hpp.
|
inlineexplicit |
Constructs an Assembly object with a string as module name.
moduleName | The name of the module as a string. |
flags | Optional flags for module initialization. |
additionalSearchDirectories | Optional additional search directories. |
sections | Optional flag indicating if sections should be initialized. |
Definition at line 95 of file assembly.hpp.
|
explicit |
Constructs an Assembly object with a filesystem path as module path.
modulePath | The filesystem path of the module. |
flags | Optional flags for module initialization. |
additionalSearchDirectories | Optional additional search directories. |
sections | Optional flag indicating if sections should be initialized. |
|
explicit |
Constructs an Assembly object with a memory address.
moduleMemory | The memory address of the module. |
flags | Optional flags for module initialization. |
additionalSearchDirectories | Optional additional search directories. |
sections | Optional flag indicating if sections should be initialized. |
MemAddr plugify::Assembly::FindPattern | ( | MemAddr | pattern, |
std::string_view | mask, | ||
MemAddr | startAddress = nullptr , |
||
Section * | moduleSection = nullptr |
||
) | const |
Finds an array of bytes in process memory using SIMD instructions.
pattern | The byte pattern to search for. |
mask | The mask corresponding to the byte pattern. |
startAddress | The start address for the search. |
moduleSection | The module section to search within. |
MemAddr plugify::Assembly::FindPattern | ( | std::string_view | pattern, |
MemAddr | startAddress = nullptr , |
||
Section * | moduleSection = nullptr |
||
) | const |
Finds a string pattern in process memory using SIMD instructions.
pattern | The string pattern to search for. |
startAddress | The start address for the search. |
moduleSection | The module section to search within. |
|
noexcept |
Returns the module base address.
|
noexcept |
Returns the module error.
|
noexcept |
Gets an address of a function by its name.
functionName | The name of the function. |
|
noexcept |
Returns the module handle.
|
noexcept |
Returns the module path.
|
noexcept |
Gets a module section by name.
sectionName | The name of the section (e.g., ".rdata", ".text"). |
MemAddr plugify::Assembly::GetVirtualTableByName | ( | std::string_view | tableName, |
bool | decorated = false |
||
) | const |
Gets an address of a virtual method table by RTTI type descriptor name.
tableName | The name of the virtual table. |
decorated | Indicates whether the name is decorated. |
|
inlinenoexcept |
Checks if the assembly is valid.
Definition at line 192 of file assembly.hpp.
|
inlineexplicitnoexcept |
Conversion operator to check if the assembly is valid.
Definition at line 198 of file assembly.hpp.
|
inlinenoexcept |
Equality operator.
assembly | The other Assembly object to compare with. |
Definition at line 205 of file assembly.hpp.
|
static |
Converts a string pattern with wildcards to an array of bytes and mask.
input | The input pattern string. |