Skip to main content

PyMemoryModule is a Python binding for MemoryModule.

Project description


PyMemoryModule is a Python binding for MemoryModule.

Build status

By this module, you can load DLL completely from memory - without storing on the disk first - all thanks to MemoryModule written by Joachim Bauch.

How to install

pip install pymemorymodule

Packages are available at PyPI and PyPI test.

How to use

import pymemorymodule as pymm
from ctypes import cast, c_int, CFUNCTYPE

with open("path/to/library.dll", "rb") as fp:
    # Load DLL from bytes object
    handle = pymm.MemoryLoadLibrary(

    # __declspec(dllexport) int add(int a, int b)
    add = cast(
        pymm.MemoryGetProcAddress(handle, "add"),
        CFUNCTYPE(c_int, c_int, c_int)

    # Use function exported from DLL
    assert add(1, 2) == 3

    # Free loaded DLL

How to build and test

python build_ext -i test

How to run code check

python -m pip install flake8
python -m flake8 --show-source

How to prepare README.rst

python md2rst



Mozilla Public License Version 2.0 (MPL2.0)

See also license of MemoryModule.

Note: PyMemoryModule also distributes a few lines of MIT licensed codes taken from py3c project.

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution (18.8 kB view hashes)

Uploaded source

Built Distributions

pymemorymodule-0.1.0-cp35-cp35m-win32.whl (11.3 kB view hashes)

Uploaded 3 5

pymemorymodule-0.1.0-cp34-cp34m-win32.whl (10.9 kB view hashes)

Uploaded 3 4

pymemorymodule-0.1.0-cp33-cp33m-win32.whl (10.9 kB view hashes)

Uploaded 3 3

pymemorymodule-0.1.0-cp27-cp27m-win32.whl (11.0 kB view hashes)

Uploaded 2 7

pymemorymodule-0.1.0-cp26-cp26m-win32.whl (11.2 kB view hashes)

Uploaded 2 6

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page