phantomscope-mcp
Server Configuration
Describes the environment variables required to run the server.
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Instructions
Guidance the server publishes about itself, which clients place ahead of the tool catalog so the model reads it before choosing anything.
phantomscope is a DMA reverse-engineering toolkit.
Typical workflow
session_open(device="fpga" for a PCILeech FPGA, or a dump path).processesto find a PID (or useattachwith a name).modules/regions/threads/callstackto orient, andhandles/heaps/kernel_moduleswhen the backend has them.read(with dump=True) /read_typed/dump_regionfor memory,scan_aob/scan_value/scan_next/pointer_scanfor discovery,write/patch_list/patch_restorefor edits (journaled).capture_moduleto hand a live module's bytes to the static analyser, thendisassemble/functions/xrefs_to/basic_blocks, andstruct_layout/globals_touchedto infer what the code expects its pointers to point at.decompilefor pseudo-C of one function, withapi_callsandstring_xrefsfor the names it does not have.rename_functionandset_commentmake those names stick: later calls report them.fingerprint/find_similar/match_functions/diff_imagesto recognise code across addresses and builds, andpacking_report/crypto_constants/search_immediatesfor triage.emu_createover a loaded image to snapshot-emulate it:emu_step,emu_run,emu_watchandemu_callstand in for breakpoints, which DMA cannot provide.emu_stubsfirst when the code calls imports.
Static-only workflows (PE files) can start at load_file.
For a raw physical image with no operating system involved, open
session_open(backend="physical", device="<dump>") and use the physical
tools: physical_info / physical_map / physical_read /
physical_write (addresses are physical), translate /
virtual_read / virtual_write / walk (x86-64 page-table walking
with a CR3), physical_images (find PEs by structure alone) and
capture_image (hand a discovered PE to the static engine).
Every dynamic tool needs a session; every static tool needs a loaded image
key (images lists them). Static images and emulators are scoped to the
session that captured them, so pass session="<name>" when several targets
are open; a bare key is still resolved against every engine.
Capabilities
Features and capabilities supported by this server
Protocol revision2025-11-25
| Capability | Details |
|---|---|
| tools | {
"listChanged": false
} |
| prompts | {
"listChanged": false
} |
| resources | {
"subscribe": false,
"listChanged": false
} |
Tools
Functions exposed to the LLM to take actions
| Name | Description |
|---|---|
| session_openC | Open a memory acquisition session. device: "fpga" (PCILeech), a memory dump path, "pmem", "usb3380", a LeechAgent remote ("rpc://host"), or "mock" for a deterministic test target when backend="mock". options is a space-separated list of extra MemProcFS arguments. |
| session_listC | List open sessions. |
| session_closeA | Close a session (all sessions when name is omitted). |
| attachB | Attach to a process by PID or name and make it the default target. |
| processesC | List processes, optionally filtered by name. |
| process_infoC | Detailed information about one process. |
| modulesC | List loaded modules of a process. |
| regionsC | List memory regions (VADs) of a process. |
| threadsC | List threads of a process. |
| callstackC | Return the callstack of a thread. |
| kernel_modulesC | Kernel modules (drivers) loaded on the target, when the backend has a kernel view. |
| kernel_processesC | Processes seen by the kernel, including ones hidden from the user-mode list. |
| handlesD | Handles open in a process; |
| heapsD | Heaps of a process. |
| readC | Read process virtual memory. |
| read_typedC | Read a typed value (int8..uint64, float, double). |
| writeC | Write bytes or a typed value. Every write is journaled and reversible. |
| patch_listC | List every write made through this session. |
| patch_restoreB | Restore one patch by id, or every outstanding patch with all=True. |
| address_infoC | Resolve an address to module/region/function information. |
| dump_regionB | Dump a memory range to a file (or return its hex when out_path is empty). |
| scan_aobC | Scan live process memory for an AOB pattern ( |
| scan_stringsA | Find readable strings in live memory — what the target built at run time.
|
| scan_valueB | First value scan. Returns a scan key used by scan_next. |
| scan_nextC | Narrow a previous scan to addresses still holding (or no longer holding) a value. |
| scan_resultsC | List the addresses currently held by a scan. |
| pointer_scanC | Find module+offset pointer chains that point at a target address. |
| snapshotD | Take a memory snapshot. |
| diffC | Show what changed in a range since now (or watch it for |
| trace_changesB | Poll a range and report every byte that moved, as hex and as typed values. This is the DMA answer to a memory breakpoint: nothing can be stopped, so the range is sampled and diffed. Runs name the changed field, how many samples caught a new value, and the same bytes read as int32/uint32/float/int64/uint64/ double, which is usually enough to tell a flag from a counter from a timer. |
| trace_valueC | Time series for one typed value: the counter/timer/health-bar view. |
| read_objectB | Dump one object: hexdump, aligned qwords with pointer validity, typed fields.
|
| read_arrayC | Read |
| infer_structA | Infer a field layout from sampled values and print a C declaration.
|
| detect_containerC | Decide whether an address holds a std::vector, TArray, std::string, or other. |
| expand_containerC | Detect a container and read its elements in one call (the entity-list workflow). |
| resolve_pointer_chainB | Walk a pointer path and report every hop plus the final value.
|
| pointer_chain_replayC | Re-run chains from |
| snapshot_moduleB | Snapshot every mapped region of a module (baseline for |
| diff_moduleC | Compare a module's regions against a |
| physical_infoC | Geometry of the open physical image: segments, size, CR3, cache state. |
| physical_mapD | Physical address ranges: the dump's segments, or the target's RAM map. |
| physical_readB | Read physical memory. Bytes outside every captured segment read as zeros. |
| physical_writeA | Write bytes into a raw physical dump file on disk. Not a write to a live target: the physical backend backs a dump file, so this
edits that file in place. Use |
| translateB | Translate a virtual address through page tables (defaults to the session CR3). |
| virtual_readC | Read virtual memory through page tables. strict=False zero-fills holes. |
| virtual_writeC | Write virtual memory through page tables (hex). |
| walkC | Report which pages in a virtual range are present (no OS structures used). |
| physical_imagesC | Find PE images in physical memory by structure alone (no module list). |
| physical_scanC | AOB-scan physical memory ( |
| capture_imageC | Capture a PE found at a physical address and load it for static analysis. The loaded image is based at the PE |
| load_fileB | Load a PE file from disk for static analysis. Files loaded without |
| capture_moduleC | Capture a live module through DMA and load it for static analysis. |
| export_moduleA | Dump a live module to a PE file that IDA, Ghidra and pefile will open. The last mile of unpacking: capture the module, then write it somewhere useful. A memory buffer is RVA-indexed, so writing it out verbatim gives a file whose section headers no longer match where the bytes are — every tool rejects it. This demaps it: headers stay, each section moves from its virtual address to its declared raw offset.
|
| save_imageC | Write an already-loaded image to disk (same demap as |
| patch_applyA | Overwrite bytes in a loaded image, remembering the original for rollback. The static twin of
|
| static_patch_listC | Every static image patch made through this engine, oldest first. |
| static_patch_restoreB | Undo one static patch by index, or every outstanding patch with
|
| imagesA | List images loaded for static analysis (all engines when |
| unload_imageC | Forget a loaded image and any emulator built over it. |
| image_summaryC | Header/section/import/export summary of a loaded image. |
| sectionsD | Sections of a loaded image. |
| importsC | Imports of a loaded image (optionally filtered by module). |
| exportsD | Exports of a loaded image. |
| stringsC | Extract strings; |
| functionsC | List discovered functions with callers counts. |
| function_infoD | Function containing an address. |
| disassembleC | Disassemble from an address, or a whole function when function=True. |
| basic_blocksC | Basic blocks of the function containing an address. |
| xrefs_toC | Cross references to an address. |
| xrefs_fromD | Cross references from an address. |
| callersC | Functions that call the function containing |
| calleesC | Functions called by the function containing |
| scan_patternC | Scan a static image for an AOB pattern. |
| rttiD | MSVC RTTI classes and their vtables. |
| static_readC | Read bytes from a loaded image. |
| static_address_infoA | Resolve an address inside a loaded image: section, function, symbol, flags. The static counterpart of |
| struct_layoutB | Infer candidate struct layouts from the memory operands a function uses. Every |
| live_struct_layoutA | Combine a function's field accesses with the live values at those offsets.
|
| globals_touchedC | Module globals (RIP-relative references) read or written by a function. |
| decompileA | Lift one function to readable pseudo-C. Control flow is rebuilt from the basic-block graph: dominators, natural loops
and if/else joins become Heuristics are stated in the response: |
| rename_functionA | Name a function; every later tool reports that name instead of Names persist to |
| set_commentB | Attach a comment to an address; |
| annotationsB | List the names, comments and notes recorded for an image. |
| clear_annotationsA | Drop the annotations for one address, or all of them when |
| api_callsB | Imported APIs called in an image (or in one function), grouped by API. Resolves |
| api_sitesC | Every API reference site with its address, function and reference kind. |
| find_apiC | Functions that call an API matching |
| string_xrefsC | Strings and the code addresses that reference them. Narrow with |
| fingerprintB | Structural fingerprint of a function (normalised hash, constants, imports). Relative branch targets and immediates are abstracted, so the same function
hashes the same at another address or in another build; the immediates are
kept separately in |
| find_similarB | Functions in the same image that look like the one at Similarity is the Jaccard index over mnemonic trigrams: explainable, and good at finding the four copies of the same routine a compiler inlined. |
| match_functionsC | Match the functions of two loaded images (hash first, shape second). |
| diff_imagesB | Structural diff of two builds: identical, similar, removed and added code. Load both versions ( |
| packing_reportB | Evidence for packing or virtualisation, with a 0-10 score. Checks section entropy, writable+executable sections, sections with no file data, the import count, how much code the analyser actually recovered, TLS callbacks, entry-point placement and overlay data. Each hit carries its weight and a one-line reason, so the verdict can be argued with. |
| crypto_constantsA | Locate known crypto/hash tables and round constants by value. AES S-box and its inverse, the CRC-32 table, MD5/SHA initial states, TEA and xxHash primes, FNV offsets, MurmurHash constants, base64 and hex alphabets. A hit means the bytes are there — treat it as a lead, not a proof. |
| search_immediatesB | Where a number is used: instruction immediates and stored data. Pass |
| server_infoD | – |
| emu_availableA | Whether snapshot emulation (Unicorn) is installed. |
| emu_createA | Create an emulator over a loaded image (optionally seeding rip/rsp).
|
| emu_regsC | Read (or set with |
| emu_stepC | Single-step the emulator (count instructions). |
| emu_runC | Run until an address ( |
| emu_readC | Read emulator memory. |
| emu_writeC | Write emulator memory (hex). |
| emu_watchC | Watch an emulator memory range for reads and/or writes. |
| emu_eventsC | Accesses recorded by emulator watchpoints. |
| emu_callA | Call a function in the emulator (x64 Microsoft calling convention). Imported functions fault unless their IAT slots were redirected: call
|
| emu_stubsA | Redirect every import slot to a generated stub, so the code can keep running. A snapshot holds the image, not the module it imports from, so
|
| emu_callsC | Imported functions the emulator actually called, with argument registers. |
| emu_stub_listC | Installed import stubs with the value each one returns. |
| emu_closeB | Release an emulator and its native engine. Worth calling when you are done with a large image: unicorn holds memory per instance, and a session that creates emulators in a loop will grow until they are closed. |
| emu_traceB | Turn instruction/edge recording on, off, or reset it. recording costs a callback per instruction, so it is opt-in: enable it when the question is which path did the run take, not when you need a value. |
| emu_coverageB | What the emulated run executed: unique instructions, hot spots, branch forks.
|
| emu_reachedC | Which of the listed addresses the emulated run actually reached. |
| emu_faultsC | Bad accesses seen in the emulator: unmapped read/write/fetch with rip and address. |
Prompts
Interactive templates invoked by user choice
| Name | Description |
|---|---|
No prompts | |
Resources
Contextual data attached and managed by the client
| Name | Description |
|---|---|
No resources | |
TDQS
Scored across 115 tools
The tool set is partitioned into clear domains (live DMA, static image analysis, physical dump, emulator, annotations), and most tools have a distinct resource+action. The main friction is the five read variants (read, static_read, physical_read, virtual_read, emu_read) and matching write variants, which require careful attention to pick correctly, though descriptions do distinguish them.
Most names are snake_case, but the convention is mixed: bare nouns (read, write, walk, diff, snapshot, handles, threads), verb_noun (capture_image, rename_function, patch_apply), and inconsistent prefix ordering (physical_read vs read vs static_read vs session_open). Readable but not predictable enough to guess a name without consulting the list.
115 tools is far past the threshold where an agent can hold the surface in mind. While each has a role, the sheer count guarantees selection errors and cognitive overhead; this surface should be split into sub-servers or namespaces (live, static, physical, emu).
Coverage across the reverse-engineering domain is exceptional: session/process lifecycle, live reads/writes with patch journaling, static image loading, disassembly/decompilation/xrefs, struct inference, emulator with import stubs and coverage, physical memory, and annotations. No obvious dead ends for the stated purpose.