Skip to main content

memaccess

Python library for Windows giving live access to a program’s memory.

Usage

memaccess exposes one main class to use for memory inspection: MemoryView. It will request all necessary data from Windows to be able to access memory of another application. Just pass to the class the process-id of the application you want to observe:

from memaccess import MemoryView

view = MemoryView(5555)
# Read memory...
view.close()

It’s safer to use the context-manager variant of MemoryView:

from memaccess import MemoryView

with MemoryView(5555) as view:
    pass  # Read memory...

NOTE

Accessing another program’s memory requires elevated privileges, otherwise instantiation of MemoryView will fail.

To read content, memaccess exposes the read function. It takes the number of bytes to read and the address where to start reading.

# Read 8 bytes of memory at address 0x01234560
view.read(8, 0x01234560)

For convenience, MemoryView exposes read methods that convert values in memory to respective C/C++ types.

view.read_int(0x01234560)
view.read_float(0x01234564)
# ... and many others.

You can also write to memory. Note that you have to open the MemoryView in write-mode:

with MemoryView(5555, 'rw') as view:
    view.write_int(33, 0x01234560)
    view.read_int(0x01234564)

Please inspect the MemoryView class for details on all of those functions.

Exceptions

Some exceptions are raised due to internal Windows API errors and show an error code.

>>> from memaccess import MemoryView
>>> MemoryView(5555)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  ...
RuntimeError: Can't open process with pid 5555, error code 87

You can read up on those error codes here:

https://msdn.microsoft.com/de-de/library/windows/desktop/ms681381(v=vs.85).aspx

Metadata

Release files for memaccess 0.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for memaccess 0.2
File Size Uploaded Provenance Actions
memaccess-0.2.tar.gz 5.4 kB Without provenance Details for memaccess-0.2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for memaccess 0.2
File Interpreter ABI Platform Actions
memaccess-0.2-py3-none-any.whl Python 3 none any Details for memaccess-0.2-py3-none-any.whl

Total release size: 13.4 kB

Release files / memaccess-0.2.tar.gz

Download URL memaccess-0.2.tar.gz
Size 5.4 kB
Tags Source
SHA-256 checksum
How to use checksums
0827c857ce23f7ce7f0397f7afc7368368bdff40dd6e0a9f305e1abc55d4da0e
BLAKE2b-256 checksum
How to use checksums
83cc30587ab71e06329cbaae61676474f971fc6f43be936e84bab20d719ab8cc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / memaccess-0.2-py3-none-any.whl

Download URL memaccess-0.2-py3-none-any.whl
Size 8.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
24b34f602cca9ba81c9f8a7226e2b09522c76d41258402edf3e119a5b441ec25
BLAKE2b-256 checksum
How to use checksums
b6e19356dd3cc14130b1aafdbbe0feceec2d7c1283529243063ab36640e5ae18
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Security for memaccess 0.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page