Getting the Process List

How to retrieve the process list

Find the PID of your own program

Before you read memory, you need to pick the right instance of the program. This script logs the local processes at the moment it runs: name and PID. Later you can open a memory reader by PID.

You need desktop EyeAuras on Windows with the EyeAuras.Memory module loaded. The LocalProcess type is described in the SDK metadata, but the module registers its implementation, so a using or an assembly reference alone is not enough.

List local processes

  1. Keep the program whose PID you want open. If several instances share the same name, work out in Task Manager beforehand which one is yours.
  2. Add C# Script to your aura and paste the whole code into Script.csx:
csharp
using System.Linq;
using EyeAuras.Memory;
using PoeShared.Scaffolding;

var processes = LocalProcess.GetProcesses();
Log.Info(processes.OrderBy(x => x.ProcessName).DumpToNamedTable("Processes"));
  1. Click Run and open the script event log. Find the line for your program and write down Id, which is the PID. Every Run gets the list again.

Process list in the event log

Field or operationHow to read the result
ProcessInformation.IdPID from the source of this list. After the process exits, the same PID can go to another process.
ProcessNameProcess name, not the full path to the executable. Names can repeat.
GetProcesses()Returns records as of the call, not open readers. Records have nothing to dispose.
LocalProcess.ByProcessId(pid)The next step: opens a specific local process. Dispose the reader when you are done. Whether it opens depends on permissions and on the state of the process.

Two separate examples show what to do with the PID next: module exports and a first typed read. ByProcessName opens the first process with a matching name, so a PID is more precise when there are several instances. The local list uses .NET process enumeration.

Another source: WinPMEM or Hyper-V

You need these variants only if you already have the EyeAuras.Memory.MPFS integration set up with compatible MemProcFS/LeechCore native libraries and the matching acquisition device or driver. The WinPMEM route needs the configured WinPmem driver.

LeechCore, by Ulf Frisk, picks the memory source by its device arguments. A separate script for WinPMEM:

csharp
using EyeAuras.Memory;
using EyeAuras.Memory.MPFS;
using PoeShared.Scaffolding;

var processes = LCProcess.WinPMEM().GetProcesses();
Log.Info(processes.DumpToNamedTable("Processes"));

If Hyper-V is set up, replace the code with this variant and put in the index of your VM:

csharp
using EyeAuras.Memory;
using EyeAuras.Memory.MPFS;
using PoeShared.Scaffolding;

var processes = LCProcess.HyperV().UseVirtualMachineByIndex(0).GetProcesses();
Log.Info(processes.DumpToNamedTable("Processes"));

This is the process list of the selected guest.

Guest process list

In the Hyper-V setup used for the screenshot, Dynamic Memory was disabled.

Dynamic Memory in the Hyper-V settings

You can check the prepared native plugin with its own command:

MemProcFS.exe -device hvmm://listvm

Old sample output from plugin 1.2.20240329:

text
   Microsoft Hyper-V Virtual Machine plugin 1.2.20240329(beta) for MemProcFS (by Ulf Frisk).

   plugin parameters:
      hvmm://id=<vm id number>
      hvmm://id=<vm id number>,unix
      hvmm://listvm
      hvmm://enumguestosbuild
      hvmm://loglevel=<log level number>
   Example: MemProcFS.exe -device hvmm://listvm

   Virtual Machines:
    --> [id = 0] ShadowForge (PartitionId = 0x2, Full VM)
   You selected the following virtual machine: ShadowForge

Index 0 here is an example. The VM you need is not selected automatically. The managed API also has LCProcess.HyperV().ListVirtualMachines(). GetProcesses() creates a temporary VMM and disposes it once the list is collected. When you open a process, the LCProcess reader has its own separate lifetime. The builders and their limits are described in the current factory source, the earlier source revision and the LCProcess page.

If you embed the SDK in your own application, UseMemory() and awaiting EnsureReadyAsync() belong to host startup, not to an ordinary Script.csx. Log exists only in the top-level script. An ordinary C# class gets its logger passed in explicitly. See script runtime, process contracts and memory primitives.