|
BlackBone
Windows memory hacking library
|
Primitive PE parsing class More...
#include <PEImage.h>
Public Member Functions | |
| BLACKBONE_API NTSTATUS | Load (const std::wstring &path, bool skipActx=false) |
| Load image from file More... | |
| BLACKBONE_API NTSTATUS | Load (void *pData, size_t size, bool plainData=true) |
| Load image from memory location More... | |
| BLACKBONE_API void | Release () |
| Release mapping, if any More... | |
| BLACKBONE_API NTSTATUS | Parse (void *pImageBase=nullptr) |
| Parses PE image More... | |
| BLACKBONE_API mapImports & | GetImports (bool useDelayed=false) |
| Processes image imports More... | |
| BLACKBONE_API void | GetExports (vecExports &exports) |
| Retrieve all exported functions with names More... | |
| BLACKBONE_API int | GetTLSCallbacks (module_t targetBase, std::vector< ptr_t > &result) const |
| Retrieve image TLS callbacks Callbacks are rebased for target image More... | |
| BLACKBONE_API size_t | DirectoryAddress (int index, bool keepRelative=false) const |
| Retrieve data directory address More... | |
| BLACKBONE_API size_t | DirectorySize (int index) const |
| Get data directory size More... | |
| BLACKBONE_API size_t | ResolveRVAToVA (size_t Rva, bool keepRelative=false) const |
| Resolve virtual memory address to physical file offset More... | |
| BLACKBONE_API const std::wstring & | path () const |
| Get image path More... | |
| BLACKBONE_API std::wstring | name () const |
| Get image name More... | |
| BLACKBONE_API void * | base () const |
| Get image load address More... | |
| BLACKBONE_API module_t | imageBase () const |
| Get image base address More... | |
| BLACKBONE_API size_t | imageSize () const |
| Get image size in bytes More... | |
| BLACKBONE_API size_t | headersSize () const |
| Get size of image headers More... | |
| BLACKBONE_API ptr_t | entryPoint (module_t base) const |
| Get image entry point rebased to another image base More... | |
| BLACKBONE_API const vecSections & | sections () const |
| Get image sections More... | |
| BLACKBONE_API bool | IsExe () const |
| Check if image is an executable file and not a dll More... | |
| BLACKBONE_API bool | IsPureManaged () const |
| Check if image is pure IL image More... | |
| BLACKBONE_API eModType | mType () const |
| Get image type. 32/64 bit More... | |
| BLACKBONE_API HANDLE | actx () const |
| Get activation context handle More... | |
| BLACKBONE_API bool | isPlainData () const |
| true if image is mapped as plain data file More... | |
| BLACKBONE_API int | manifestID () const |
| Get manifest resource ID More... | |
| BLACKBONE_API uint32_t | subsystem () const |
| Get image subsystem More... | |
| BLACKBONE_API const std::wstring & | manifestFile () const |
| Get manifest resource file More... | |
| BLACKBONE_API bool | noPhysFile () const |
| If true - no actual PE file available on disk More... | |
Primitive PE parsing class
|
inline |
Get activation context handle
|
inline |
Get image load address
| size_t blackbone::pe::PEImage::DirectoryAddress | ( | int | index, |
| bool | keepRelative = false |
||
| ) | const |
Retrieve data directory address
| index | Directory index |
| keepRelative | Keep address relative to image base |
| size_t blackbone::pe::PEImage::DirectorySize | ( | int | index | ) | const |
Get data directory size
| index | Data directory index |
|
inline |
Get image entry point rebased to another image base
| base | New image base |
| BLACKBONE_API void blackbone::pe::PEImage::GetExports | ( | vecExports & | exports | ) |
Retrieve all exported functions with names
| names | Found exports |
| mapImports & blackbone::pe::PEImage::GetImports | ( | bool | useDelayed = false | ) |
| int blackbone::pe::PEImage::GetTLSCallbacks | ( | module_t | targetBase, |
| std::vector< ptr_t > & | result | ||
| ) | const |
Retrieve image TLS callbacks Callbacks are rebased for target image
| targetBase | Target image base |
| result | Found callbacks |
|
inline |
Get size of image headers
|
inline |
Get image base address
|
inline |
Get image size in bytes
|
inline |
Check if image is an executable file and not a dll
|
inline |
true if image is mapped as plain data file
|
inline |
Check if image is pure IL image
| NTSTATUS blackbone::pe::PEImage::Load | ( | const std::wstring & | path, |
| bool | skipActx = false |
||
| ) |
Load image from file
| path | File path |
| skipActx | If true - do not initialize activation context |
| NTSTATUS blackbone::pe::PEImage::Load | ( | void * | pData, |
| size_t | size, | ||
| bool | plainData = true |
||
| ) |
Load image from memory location
| pData | Image data |
| size | Data size. |
| plainData | If false - data has image layout |
|
inline |
Get manifest resource file
|
inline |
Get manifest resource ID
|
inline |
Get image type. 32/64 bit
|
inline |
Get image name
|
inline |
If true - no actual PE file available on disk
| NTSTATUS blackbone::pe::PEImage::Parse | ( | void * | pImageBase = nullptr | ) |
Parses PE image
|
inline |
Get image path
| void blackbone::pe::PEImage::Release | ( | ) |
Release mapping, if any
| size_t blackbone::pe::PEImage::ResolveRVAToVA | ( | size_t | Rva, |
| bool | keepRelative = false |
||
| ) | const |
Resolve virtual memory address to physical file offset
| Rva | Memory address |
| keepRelative | Keep address relative to file start |
|
inline |
Get image sections
|
inline |
Get image subsystem