FunctionPatch::FunctionPatch::MemoryLocker Class Reference

Allows retreiving read/write access to read-only kernel memory. More...

List of all members.

Public Member Functions

 MemoryLocker (void *pData, ULONG size)
 Locks read-only pages in memory and creates an additional read-write mapping.
 ~MemoryLocker ()
 Destroys the additional read-write mapping.
void * GetPointer ()
 Returns a write-enabled pointer to a read-only memory block.

Private Attributes

PMDL m_pMdl
PVOID m_pPointer


Detailed Description

Allows retreiving read/write access to read-only kernel memory.

This class allows modifying read-only kernel memory. On x86 targets, all kernel memory is always writable by kernel-mode code, however, on x64 targets, some memory (such as code segments) is marked as read-only. This class allows retreiving a write-enabled pointer to a read-only memory block.

Definition at line 33 of file kdpatch.cpp.


Constructor & Destructor Documentation

FunctionPatch::FunctionPatch::MemoryLocker::MemoryLocker ( void *  pData,
ULONG  size 
) [inline]

Locks read-only pages in memory and creates an additional read-write mapping.

Definition at line 41 of file kdpatch.cpp.

FunctionPatch::FunctionPatch::MemoryLocker::~MemoryLocker (  )  [inline]

Destroys the additional read-write mapping.

Definition at line 52 of file kdpatch.cpp.


Member Function Documentation

void* FunctionPatch::FunctionPatch::MemoryLocker::GetPointer (  )  [inline]

Returns a write-enabled pointer to a read-only memory block.

Definition at line 60 of file kdpatch.cpp.


Member Data Documentation

PMDL FunctionPatch::FunctionPatch::MemoryLocker::m_pMdl [private]

Definition at line 36 of file kdpatch.cpp.

PVOID FunctionPatch::FunctionPatch::MemoryLocker::m_pPointer [private]

Definition at line 37 of file kdpatch.cpp.


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