Expand description
§The MemProcFS API Documentation
The MemProcFS crate contains a wrapper API around the MemProcFS physical
memory analysis framework. The native
libray in the form of vmm.dll
or vmm.so
must be downloaded or compiled
in order to make use of the memprocfs crate.
Physical memory analysis may take place on memory dump files for forensic purposes. Analysis may also take place on live memory - either captured by using PCILeech PCIe DMA devices or by using a driver - such as WinPMEM, LiveCloudKd, VMware or similar.
The base of the MemProcFS API is the Vmm
struct. Once the native vmm
has been initialized it’s possible to retrieve processes in the form of
the VmmProcess
struct. Using the Vmm
and VmmProcess
it’s possible
to undertake a wide range of actions - such as reading/writing memory or
retrieve various information.
The use of the low-level LeechCore
library is also possible. LeechCore
is used for low-level tasks such as setting a memory map,
implementing raw PCIe Transaction Layer Packet (TLP), PCIe Base Address
Register (BAR) support and more.
Read and write memory by using the methods
mem_read()
,
mem_read_ex()
and
mem_write()
.
Virtual memory is read from VmmProcess
struct.
Physical memory is read from the Vmm
struct.
Efficiently read and write memory using the VmmScatterMemory
struct. The scatter struct is retrieved by calling
mem_scatter()
on either the base Vmm
struct or the individual VmmProcess
structs.
Access information about loaded modules, memory regions, registry, process handles, kernel pool allocations and much more!
Access the Virtual File System (VFS) using the Rust API to get access
to the full range of built-in and external plugins. The VFS is accessed by
using the methods
vfs_list()
, vfs_read()
and
vfs_write()
on the Vmm
struct.
The MemProcFS crate and API also supports creation of native MemProcFS
plugins in the form of a library .dll
or .so
.
§Example projects
Check out the Example Project and the Example Plugin.
§Project documentation
Check out the project documentation for MemProcFS, LeechCore and pcileech-fpga:
§Support PCILeech/MemProcFS development:
PCILeech and MemProcFS is free and open source!
I put a lot of time and energy into PCILeech and MemProcFS and related research to make this happen. Some aspects of the projects relate to hardware and I put quite some money into my projects and related research. If you think PCILeech and/or MemProcFS are awesome tools and/or if you had a use for them it’s now possible to contribute by becoming a sponsor!
If you like what I’ve created with PCIleech and MemProcFS with regards to DMA, Memory Analysis and Memory Forensics and would like to give something back to support future development please consider becoming a sponsor at: https://github.com/sponsors/ufrisk
To all my sponsors, Thank You 💖
§Questions and Comments
Please feel free to contact me!
- Github: https://github.com/ufrisk/MemProcFS
- Discord Server: https://discord.gg/pcileech.
- Twitter: https://twitter.com/UlfFrisk
- Email: pcileech@frizk.net
§Get Started!
Check out the Vmm
documentation and the
Example Project!
Best wishes with your memory analysis project!
Structs§
- PCIe BAR info struct.
- PCIe BAR Context: Supplied by LeechCore to the BAR callback function.
- PCIe BAR wrapper context - returned to the caller of the BAR enable function.
- PCIe BAR request struct.
- PCIe TLP Context: Supplied by LeechCore to the TLP callback function.
- PCIe TLP wrapper context - returned to the caller of the TLP enable function.
- LeechCore API Base Struct.
- MemProcFS API Base Struct.
- Kernel information.
- Info: Physical memory map entries.
- Info: Network connections.
- Info: Memory PFN (Page Frame Number).
- Info: Kernel pool entries.
- Info: Services.
- Info: Users.
- Info: Virtual Machines (VMs).
- Debug Symbol API.
- Plugin Context: Supplied by MemProcFS to plugin callback functions.
- Plugin File List: Supplied by MemProcFS to plugin list callback function.
- Plugin Initialization Context.
- Plugin Initialization System Information.
- Process API Base Struct.
- Process Information.
- Info: Process Module: PE data directories.
- Info: Process Module: PE exported entries.
- Info: Process: Handles.
- Info: Process: Heap allocations.
- Info: Process: Heaps.
- Info: Process Module: PE imported entries.
- Info: Process: Modules (loaded DLLs) debug information.
- Info: Process: Modules (loaded DLLs).
- Info: Process: Modules (loaded DLLs) version information.
- Info: Process: PTE memory map entries.
- Info: Process: Threads.
- Info: Process: Unloaded modules.
- Info: Process: VAD (Virtual Address Descriptor) memory map entries.
- Info: Process: Extended VAD memory map entries.
- Info: Process Module: PE sections.
- Registry Hive API.
- Registry Key API.
- Registry Value API.
- Efficient Memory Reading API.
- Search API.
- Info: Search Progress/Result.
- VFS (Virtual File System) entry information - file or directory.
- Yara Search API.
- Info: Yara search match.
- Info: Yara search match string.
- Info: Yara search Progress/Result.
Enums§
Constants§
- Set native library internal custom debug.
- Get/Set enable paging support 1/0.
- Get whether the refresh is enabled or not (1/0).
- Get/Set process refresh (partial) period (in ticks).
- Get/Set process refresh (full) period (in ticks).
- Get/Set memory cache validity period (in ticks).
- Get/Set enable function call statistics (.status/statistics_fncall file).
- Get/Set base tick period in ms.
- Get/Set page table (tlb) cache validity period (in ticks).
- Get MemProcFS major version.
- Get MemProcFS minor version.
- Get MemProcFS revision version.
- Get the LeechCore native handle. (void*) (do not close/free).
- Get max native physical memory address.
- Get the numeric memory model type according to the VMM C-API.
- Get/Set library console printouts.
- Get the numeric system type according to VMM C-API.
- Get/Set standard verbosity.
- Get/Set extra verbosity.
- Get/Set super extra verbosity and PCIe TLP debug.
- Get the vmmid that may be used with startup option ‘-create-from-vmmid’ to create a thread-safe duplicate VMM instance.
- Get/Set enable/retrieve forensic mode type [0-4].
- Set custom process directory table base. [LO-DWORD: Process PID].
- Set - trigger refresh all caches.
- Set - refresh fast frequency - incl. partial process refresh.
- Set - refresh medium frequency - incl. full process refresh.
- Set - refresh memory cache (excl. TLB) (fully).
- Set - refresh memory cache (excl. TLB) [partial 33%/call].
- Set - refresh slow frequency.
- Set - refresh page table (TLB) cache (fully)
- Set - refresh page table (TLB) cache [partial 33%/call].
- Get MemProcFS unique system id.
- Get OS version build.
- Get OS version major.
- Get OS version minor.
- Only fetch from the most recent active cache region when reading.
- Force use of data cache - fail non-cached pages.
- Disable/override any use of VMM_FLAG_FORCECACHE_READ.
- Do not use internal data cache.
- Do not populate the data cache on a successful read.
- Do not retrieve memory from paged out memory.
- Do not retrieve memory from paged out memory***.
- Do not perform additional predictive page reads.
- Zero pad failed memory reads and report success.
- Forensic mode initialization start.
- Forensic mode processing is completed.
- Fast refresh. Partial process refresh.
- Medium refresh. Full process refresh and other refresh tasks.
- Slow refresh. Total refresh of as much as possible.
- Verbosity change. Query new verbosity with:
vmm.get_config()
. - A child VM was attached or detached. Query new state with API.
Functions§
- Initialize plugin information and initialization context.
Type Aliases§
- Result type for MemProcFS API.