Package vmm
Interface IVmm
public interface IVmm
The main MemProcFS implementation for Java.
MemProcFS for Java requires JNA - https://github.com/java-native-access/jna which must be on the classpath.
Check out the example code to get started! https://github.com/ufrisk/MemProcFS/
MemProcFS for Java requires JNA - https://github.com/java-native-access/jna which must be on the classpath.
Check out the example code to get started! https://github.com/ufrisk/MemProcFS/
- Author:
- Ulf Frisk - pcileech@frizk.net
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final long
static final long
static final long
static final long
static final long
static final long
static final long
static final long
static final long
static final long
static final long
static final long
static final long
static final long
static final long
static final long
static final long
static final long
static final long
static final long
Forensic mode.static final long
Retrieve the MemProcFS generated system id.static final long
Retrieve the OS kernel build.static final long
Retrieve the OS kernel major version.static final long
Retrieve the OS kernel minor version.static final long
Total refresh.static final long
Refresh fast frequency (minor refresh).static final long
Refresh medium frequency (medium refresh).static final long
Refresh total memory caches.static final long
Refresh partial (1/3) memory caches.static final long
Refresh slow frequency (maximum refresh).static final long
Refresh completely page table caches.static final long
Refresh partial (1/3) of page table caches. -
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
Close the active instance of MemProcFSlong
getConfig
(long fOption) Get a device specific option value.Retrieve the native library path set at initialization time.static IVmm
initializeVmm
(String vmmNativeLibraryPath, String[] argv) Initialize a new MemProcFS instance.boolean
isValid()
Check whether the current VMM instance is active/valid or not.int
Retrieve the kernel build number.Retrieve the kernel debug symbols.Retrieve the kernel process.mapNet()
Retrieve network info.Retrieve the system physical memory map.mapPool
(boolean isBigPoolOnly) Retrieve pool allocations sorted by virtual address and pool tag.Retrieve services.mapUser()
Retrieve users.void
memPrefetchPages
(long[] pas) Prefetch a number of addresses into the internal memory cache.byte[]
memRead
(long pa, int size) Read a single chunk of memory.byte[]
memRead
(long pa, int size, int flags) Read a single chunk of memory with the given flagsmemScatterInitialize
(int flags) Create a new IVmmMemScatter object used for efficient reading and writing.void
memWrite
(long pa, byte[] data) Write data to the memory.processGet
(int pid) Retrieve a process by its pid.processGet
(String name) Retrieve a process by its name.Retrieve all processes in the systemregHive()
Enumerate all the hives in the system and return them in a list.Retrieve a registry key by its full path.Retrieve a registry value by its full path.void
setConfig
(long fOption, long qw) Set a device specific option value.List entries in a virtual directory in the virtual file system.byte[]
Read a file in the virtual file system.vfsReadString
(String file, long offset, int size) Read a file as a String in the virtual file system.void
Write to a file in the virtual file system.
-
Field Details
-
OPT_CORE_PRINTF_ENABLE
static final long OPT_CORE_PRINTF_ENABLE- See Also:
-
OPT_CORE_VERBOSE
static final long OPT_CORE_VERBOSE- See Also:
-
OPT_CORE_VERBOSE_EXTRA
static final long OPT_CORE_VERBOSE_EXTRA- See Also:
-
OPT_CORE_VERBOSE_EXTRA_TLP
static final long OPT_CORE_VERBOSE_EXTRA_TLP- See Also:
-
OPT_CORE_MAX_NATIVE_ADDRESS
static final long OPT_CORE_MAX_NATIVE_ADDRESS- See Also:
-
OPT_CORE_LEECHCORE_HANDLE
static final long OPT_CORE_LEECHCORE_HANDLE- See Also:
-
OPT_CORE_SYSTEM
static final long OPT_CORE_SYSTEM- See Also:
-
OPT_CORE_MEMORYMODEL
static final long OPT_CORE_MEMORYMODEL- See Also:
-
OPT_CONFIG_IS_REFRESH_ENABLED
static final long OPT_CONFIG_IS_REFRESH_ENABLED- See Also:
-
OPT_CONFIG_TICK_PERIOD
static final long OPT_CONFIG_TICK_PERIOD- See Also:
-
OPT_CONFIG_READCACHE_TICKS
static final long OPT_CONFIG_READCACHE_TICKS- See Also:
-
OPT_CONFIG_TLBCACHE_TICKS
static final long OPT_CONFIG_TLBCACHE_TICKS- See Also:
-
OPT_CONFIG_PROCCACHE_TICKS_PARTIAL
static final long OPT_CONFIG_PROCCACHE_TICKS_PARTIAL- See Also:
-
OPT_CONFIG_PROCCACHE_TICKS_TOTAL
static final long OPT_CONFIG_PROCCACHE_TICKS_TOTAL- See Also:
-
OPT_CONFIG_VMM_VERSION_MAJOR
static final long OPT_CONFIG_VMM_VERSION_MAJOR- See Also:
-
OPT_CONFIG_VMM_VERSION_MINOR
static final long OPT_CONFIG_VMM_VERSION_MINOR- See Also:
-
OPT_CONFIG_VMM_VERSION_REVISION
static final long OPT_CONFIG_VMM_VERSION_REVISION- See Also:
-
OPT_CONFIG_STATISTICS_FUNCTIONCALL
static final long OPT_CONFIG_STATISTICS_FUNCTIONCALL- See Also:
-
OPT_CONFIG_IS_PAGING_ENABLED
static final long OPT_CONFIG_IS_PAGING_ENABLED- See Also:
-
OPT_WIN_VERSION_MAJOR
static final long OPT_WIN_VERSION_MAJORRetrieve the OS kernel major version.- See Also:
-
OPT_WIN_VERSION_MINOR
static final long OPT_WIN_VERSION_MINORRetrieve the OS kernel minor version.- See Also:
-
OPT_WIN_VERSION_BUILD
static final long OPT_WIN_VERSION_BUILDRetrieve the OS kernel build.- See Also:
-
OPT_WIN_SYSTEM_UNIQUE_ID
static final long OPT_WIN_SYSTEM_UNIQUE_IDRetrieve the MemProcFS generated system id.- See Also:
-
OPT_FORENSIC_MODE
static final long OPT_FORENSIC_MODEForensic mode.- See Also:
-
VMMDLL_OPT_REFRESH_ALL
static final long VMMDLL_OPT_REFRESH_ALLTotal refresh.- See Also:
-
VMMDLL_OPT_REFRESH_FREQ_MEM
static final long VMMDLL_OPT_REFRESH_FREQ_MEMRefresh total memory caches.- See Also:
-
VMMDLL_OPT_REFRESH_FREQ_MEM_PARTIAL
static final long VMMDLL_OPT_REFRESH_FREQ_MEM_PARTIALRefresh partial (1/3) memory caches.- See Also:
-
VMMDLL_OPT_REFRESH_FREQ_TLB
static final long VMMDLL_OPT_REFRESH_FREQ_TLBRefresh completely page table caches.- See Also:
-
VMMDLL_OPT_REFRESH_FREQ_TLB_PARTIAL
static final long VMMDLL_OPT_REFRESH_FREQ_TLB_PARTIALRefresh partial (1/3) of page table caches.- See Also:
-
VMMDLL_OPT_REFRESH_FREQ_FAST
static final long VMMDLL_OPT_REFRESH_FREQ_FASTRefresh fast frequency (minor refresh).- See Also:
-
VMMDLL_OPT_REFRESH_FREQ_MEDIUM
static final long VMMDLL_OPT_REFRESH_FREQ_MEDIUMRefresh medium frequency (medium refresh).- See Also:
-
VMMDLL_OPT_REFRESH_FREQ_SLOW
static final long VMMDLL_OPT_REFRESH_FREQ_SLOWRefresh slow frequency (maximum refresh).- See Also:
-
FLAG_NOCACHE
static final int FLAG_NOCACHE- See Also:
-
FLAG_ZEROPAD_ON_FAIL
static final int FLAG_ZEROPAD_ON_FAIL- See Also:
-
FLAG_FORCECACHE_READ
static final int FLAG_FORCECACHE_READ- See Also:
-
FLAG_NOPAGING
static final int FLAG_NOPAGING- See Also:
-
FLAG_NOPAGING_IO
static final int FLAG_NOPAGING_IO- See Also:
-
FLAG_NOCACHEPUT
static final int FLAG_NOCACHEPUT- See Also:
-
FLAG_CACHE_RECENT_ONLY
static final int FLAG_CACHE_RECENT_ONLY- See Also:
-
FLAG_NO_PREDICTIVE_READ
static final int FLAG_NO_PREDICTIVE_READ- See Also:
-
FLAG_FORCECACHE_READ_DISABLE
static final int FLAG_FORCECACHE_READ_DISABLE- See Also:
-
-
Method Details
-
initializeVmm
Initialize a new MemProcFS instance.- Parameters:
vmmNativeLibraryPath
- path to vmm.dll / vmm.so native binaries, ex: "C:\\Program FIles\\MemProcFS".argv
- VMM/MemProcFS initialization arguments.- Returns:
-
isValid
boolean isValid()Check whether the current VMM instance is active/valid or not.- Returns:
-
getNativeLibraryPath
String getNativeLibraryPath()Retrieve the native library path set at initialization time.- Returns:
-
close
void close()Close the active instance of MemProcFS -
getConfig
long getConfig(long fOption) Get a device specific option value. Please see defines OPT_* for information about valid option values. Please note that option values may overlap between different device types with different meanings.- Parameters:
fOption
-- Returns:
-
setConfig
void setConfig(long fOption, long qw) Set a device specific option value. Please see defines OPT_* for information about valid option values. Please note that option values may overlap between different device types with different meanings.- Parameters:
fOption
-qw
-
-
vfsList
List entries in a virtual directory in the virtual file system.- Parameters:
path
-- Returns:
-
vfsRead
Read a file in the virtual file system.- Parameters:
file
-offset
-size
-- Returns:
-
vfsReadString
Read a file as a String in the virtual file system.- Parameters:
file
-offset
-size
-- Returns:
-
vfsWrite
Write to a file in the virtual file system.- Parameters:
file
-data
-offset
-
-
memRead
byte[] memRead(long pa, int size) Read a single chunk of memory.- Parameters:
pa
- physical address to read.size
- number of bytes to read.- Returns:
-
memRead
byte[] memRead(long pa, int size, int flags) Read a single chunk of memory with the given flags- Parameters:
pa
- physical address to read.size
- number of bytes to read.flags
- flags as specified by IVmm.FLAG_*- Returns:
-
memWrite
void memWrite(long pa, byte[] data) Write data to the memory. NB! writing may fail silently. If important it's recommended to verify a write with a subsequent read.- Parameters:
pa
- physical address to read.data
- data to write.
-
memPrefetchPages
void memPrefetchPages(long[] pas) Prefetch a number of addresses into the internal memory cache. This is used to achieve faster subsequent reading speeds.- Parameters:
pas
- array of physical addresses to prefetch.
-
memScatterInitialize
Create a new IVmmMemScatter object used for efficient reading and writing. Upon completion it's recommended to call Close() to free native resources.- Parameters:
flags
- flags as specified by IVmm.FLAG_*- Returns:
- IVmmMemScatter object used for scatter reading.
-
processGet
Retrieve a process by its pid.- Parameters:
pid
-- Returns:
-
processGet
Retrieve a process by its name. If multiple processes exists with same it's undefined which one will be returned.- Parameters:
name
-- Returns:
-
processGetAll
List<IVmmProcess> processGetAll()Retrieve all processes in the system- Returns:
-
kernelProcess
IVmmProcess kernelProcess()Retrieve the kernel process.- Returns:
-
kernelPdb
IVmmPdb kernelPdb()Retrieve the kernel debug symbols.- Returns:
-
kernelBuildNumber
int kernelBuildNumber()Retrieve the kernel build number.- Returns:
-
mapPhysicalMemory
List<VmmMap_MemMapEntry> mapPhysicalMemory()Retrieve the system physical memory map.- Returns:
-
mapNet
List<VmmMap_NetEntry> mapNet()Retrieve network info.- Returns:
-
mapUser
List<VmmMap_UserEntry> mapUser()Retrieve users.- Returns:
-
mapService
List<VmmMap_ServiceEntry> mapService()Retrieve services.- Returns:
-
mapPool
Retrieve pool allocations sorted by virtual address and pool tag.- Parameters:
isBigPoolOnly
- true=only show entries from bigpool, false=show all entries.- Returns:
-
regHive
List<IVmmRegHive> regHive()Enumerate all the hives in the system and return them in a list.- Returns:
-
regKey
Retrieve a registry key by its full path.- Parameters:
strFullPath
-- Returns:
-
regValue
Retrieve a registry value by its full path.- Parameters:
strFullPath
-- Returns:
-