A library for defining objects in memory
Project description
memobj
A Python library for defining and reading structured objects directly from another process's memory.
Installation
- Using pip:
- pip install memobj
- Using uv:
- uv add memobj
Quickstart
import os
from memobj import WindowsProcess, MemoryObject
from memobj.property import Signed4
class PythonIntObject(MemoryObject):
# note: this offset might be different in future python versions
value: int = Signed4(24)
process = WindowsProcess.from_id(os.getpid())
# id(x) gives the address of the object in cpython
my_int = PythonIntObject(address=id(1), process=process)
# prints 1
print(my_int.value)
See tests for more examples (pointer properties, process/module utilities, etc.).
Development setup
This project uses uv as the build backend and package manager.
- Sync dependencies (including the tests group):
- uv sync --all-groups
- Run tests:
- uv run pytest
- Format code:
- isort . && black .
Optional: A Nix flake provides a dev shell with Python 3.11, just, black, isort, and more:
- nix develop
Support
discord: https://discord.gg/wcftyYm6qe
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file memobj-0.17.0.tar.gz.
File metadata
- Download URL: memobj-0.17.0.tar.gz
- Upload date:
- Size: 19.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.9.12 {"installer":{"name":"uv","version":"0.9.12"},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
608220f909042431526b1d41b9d24a38a4ae89192c12ba2bbfa4eecea3c4d384
|
|
| MD5 |
d5619efe4f11b49cc8959a8663ad648c
|
|
| BLAKE2b-256 |
0f7bb3953795617c61ddbea1581572776b3dc6ef6c2ecbfda71e581c90eda8f9
|
File details
Details for the file memobj-0.17.0-py3-none-any.whl.
File metadata
- Download URL: memobj-0.17.0-py3-none-any.whl
- Upload date:
- Size: 26.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.9.12 {"installer":{"name":"uv","version":"0.9.12"},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a01f2e97d9fef3c72dfb9a24d522cbdda695571d921d2b5d6a087f683b4e2aa1
|
|
| MD5 |
3dfa58919c7c4250e597dcba9c3628e5
|
|
| BLAKE2b-256 |
7da50859af3bcbe428030a2019f4974eb377986034b8e1448ee7b5d1469580b5
|