|
BLACKBONE_API | MemBlock (class ProcessMemory *mem, ptr_t ptr, bool own=true) |
| MemBlock ctor More...
|
|
BLACKBONE_API | MemBlock (class ProcessMemory *mem, ptr_t ptr, size_t size, DWORD prot, bool own=true, bool physical=false) |
| MemBlock ctor More...
|
|
BLACKBONE_API ptr_t | Realloc (size_t size, ptr_t desired=0, DWORD protection=PAGE_EXECUTE_READWRITE) |
| Reallocate existing block for new size More...
|
|
BLACKBONE_API NTSTATUS | Protect (DWORD protection, size_t offset=0, size_t size=0, DWORD *pOld=nullptr) |
| Change memory protection More...
|
|
BLACKBONE_API NTSTATUS | Free (size_t size=0) |
| Free memory More...
|
|
BLACKBONE_API NTSTATUS | Read (size_t offset, size_t size, PVOID pResult, bool handleHoles=false) |
| Read data More...
|
|
BLACKBONE_API NTSTATUS | Write (size_t offset, size_t size, const void *pData) |
| Write data More...
|
|
template<class T > |
T | Read (size_t offset, const T &def_val) |
| Read data More...
|
|
template<class T > |
NTSTATUS | Write (size_t offset, const T &data) |
| Write data More...
|
|
BLACKBONE_API void | Reset () |
| Try to free memory and reset pointers More...
|
|
BLACKBONE_API void | Release () |
| Memory will not be deallocated upon object destruction More...
|
|
template<typename T = ptr_t> |
T | ptr () const |
| Get memory pointer More...
|
|
BLACKBONE_API size_t | size () const |
| Get block size More...
|
|
BLACKBONE_API DWORD | protection () const |
| Get block memory protection More...
|
|
BLACKBONE_API bool | valid () const |
| Validate memory block - Returns
- true if memory pointer isn't 0
|
|
BLACKBONE_API | operator ptr_t () const |
| Get memory pointer More...
|
|
BLACKBONE_API MemBlock & | operator= (const MemBlock &other) |
|
blackbone::MemBlock::MemBlock |
( |
class ProcessMemory * |
mem, |
|
|
ptr_t |
ptr, |
|
|
bool |
own = true |
|
) |
| |
MemBlock ctor
- Parameters
-
mem | Process memory routines |
ptr | Memory address |
own | true if caller will be responsible for block deallocation |
blackbone::MemBlock::MemBlock |
( |
class ProcessMemory * |
mem, |
|
|
ptr_t |
ptr, |
|
|
size_t |
size, |
|
|
DWORD |
prot, |
|
|
bool |
own = true , |
|
|
bool |
physical = false |
|
) |
| |
MemBlock ctor
- Parameters
-
mem | Process memory routines |
ptr | Memory address |
size | Block size |
prot | Memory protection |
own | true if caller will be responsible for block deallocation |
MemBlock blackbone::MemBlock::Allocate |
( |
class ProcessMemory & |
process, |
|
|
size_t |
size, |
|
|
ptr_t |
desired = 0 , |
|
|
DWORD |
protection = PAGE_EXECUTE_READWRITE |
|
) |
| |
|
static |
Allocate new memory block
- Parameters
-
process | Process memory routines |
size | Block size |
desired | Desired base address of new block |
protection | Win32 Memory protection flags |
- Returns
- Memory block. If failed - returned block will be invalid
- Parameters
-
process | Process memory routines |
size | Block size |
desired | Desired base address of new block |
protection | Memory protection |
- Returns
- Memory block. If failed - returned block will be invalid
NTSTATUS blackbone::MemBlock::Free |
( |
size_t |
size = 0 | ) |
|
Free memory
- Parameters
-
size | Size of memory chunk to free. If 0 - whole block is freed |
BLACKBONE_API blackbone::MemBlock::operator ptr_t |
( |
| ) |
const |
|
inline |
Get memory pointer
- Returns
- Memory pointer
NTSTATUS blackbone::MemBlock::Protect |
( |
DWORD |
protection, |
|
|
size_t |
offset = 0 , |
|
|
size_t |
size = 0 , |
|
|
DWORD * |
pOld = nullptr |
|
) |
| |
Change memory protection
- Parameters
-
protection | New protection flags |
offset | Memory offset in block |
size | Block size |
pOld | Old protection flags |
- Returns
- Status
BLACKBONE_API DWORD blackbone::MemBlock::protection |
( |
| ) |
const |
|
inline |
Get block memory protection
- Returns
- Memory protection flags
template<typename T = ptr_t>
T blackbone::MemBlock::ptr |
( |
| ) |
const |
|
inline |
Get memory pointer
- Returns
- Memory pointer
NTSTATUS blackbone::MemBlock::Read |
( |
size_t |
offset, |
|
|
size_t |
size, |
|
|
PVOID |
pResult, |
|
|
bool |
handleHoles = false |
|
) |
| |
Read data
- Parameters
-
offset | Data offset in block |
size | Size of data to read |
pResult | Output buffer |
handleHoles | If true, function will try to read all committed pages in range ignoring uncommitted. Otherwise function will fail if there is at least one non-committed page in region. |
- Returns
- Status
template<class T >
T blackbone::MemBlock::Read |
( |
size_t |
offset, |
|
|
const T & |
def_val |
|
) |
| |
|
inline |
Read data
- Parameters
-
offset | Data offset in block |
def_val | Defult return value if read has failed |
- Returns
- Read data
ptr_t blackbone::MemBlock::Realloc |
( |
size_t |
size, |
|
|
ptr_t |
desired = 0 , |
|
|
DWORD |
protection = PAGE_EXECUTE_READWRITE |
|
) |
| |
Reallocate existing block for new size
- Parameters
-
size | New block size |
desired | Desired base address of new block |
protection | Memory protection |
- Returns
- New block address
BLACKBONE_API void blackbone::MemBlock::Release |
( |
| ) |
|
|
inline |
Memory will not be deallocated upon object destruction
void blackbone::MemBlock::Reset |
( |
| ) |
|
Try to free memory and reset pointers
BLACKBONE_API size_t blackbone::MemBlock::size |
( |
| ) |
const |
|
inline |
Get block size
- Returns
- Block size
NTSTATUS blackbone::MemBlock::Write |
( |
size_t |
offset, |
|
|
size_t |
size, |
|
|
const void * |
pData |
|
) |
| |
Write data
- Parameters
-
offset | Data offset in block |
size | Size of data to write |
pData | Buffer to write |
- Returns
- Status
template<class T >
NTSTATUS blackbone::MemBlock::Write |
( |
size_t |
offset, |
|
|
const T & |
data |
|
) |
| |
|
inline |
Write data
- Parameters
-
offset | Offset in block |
data | Data to write |
- Returns
- Status
The documentation for this class was generated from the following files:
- C:/Users/Ton/Documents/Visual Studio 2013/Projects/BlackBone/src/BlackBone/Process/MemBlock.h
- C:/Users/Ton/Documents/Visual Studio 2013/Projects/BlackBone/src/BlackBone/Process/MemBlock.cpp