PyMemoryR-W


NamePyMemoryR-W JSON
Version 0.1.1.4 PyPI version JSON
download
home_pagehttps://github.com/Mahdi-hasan-shuvo/PyMemoryRW
SummaryA library for manipulating memory in a Windows process
upload_time2024-09-01 17:44:13
maintainerNone
docs_urlNone
authorMahdi Hasan Shuvo
requires_python>=3.11
licenseMIT
keywords memory manipulation windows memory management process memory windows api memory injection memory editing windows process memory library process hacking windows utilities memory access system programming memory tools win32 api python memory library process manipulation memory read/write windows programming memory management library python windows api
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            

#### This library provides a set of functions for manipulating memory in a Windows process. It allows you to read and write memory, inject DLLs, and search for byte patterns in memory.

[![Twine Version](https://img.shields.io/pypi/v/twine.svg)](https://pypi.org/project/twine)
[![Python Versions](https://img.shields.io/pypi/pyversions/twine.svg)](https://pypi.org/project/twine)
[![Docs Badge](https://img.shields.io/readthedocs/twine)](https://twine.readthedocs.io)
[![Build Status](https://img.shields.io/github/actions/workflow/status/pypa/twine/main.yml?branch=main)](https://github.com/pypa/twine/actions)







## installation
<pre><code>pip install PyMemoryR-W</code></pre> 
## Functions

### `process_handle(app_name)`

Returns a process handle for the given App name.

**Usage:**
```python
from PyMemoryRW import process_handle

# Get a handle for the Notepad process
handle = process_handle("notepad.exe")
print(handle)  # Output might look like: <Handle pid='1234'>
```
### `inject_dll(process_handle, dll_path)`

Injects a DLL into a running process.

**Usage:**
```
from PyMemoryRW import process_handle, inject_dll

# Get a handle for the target process
handle = process_handle("myapp.exe")

# Path to the DLL to inject
dll_path = "C:\\Path\\To\\MyDLL.dll"

# Inject the DLL into the target process
inject_dll(handle, dll_path)
```

### `write_memory(process_handle, base_address, data) `
Writes data to a chunk of memory in the process.

**Usage:**
```python
from PyMemoryRW import process_handle, write_memory

# Get a handle for the target process
handle = process_handle("myapp.exe")

# Memory address to write to
base_address = 0x1000000

# Data to write (must be bytes)
data = b'Hello, World!'

# Write the data to the process memory
write_memory(handle, base_address, data)
```


### `read_memory(process_handle, base_address, size)`
Reads a valu of memory from the process.

**Usage:**
```python

from PyMemoryRW import process_handle, read_memory


# Open the process (replace with your process ID)
process_handle = process_handle("notepad.exe")

# Memory address to read from
base_address = 0x10000000

# Number of bytes to read
size = 1024

# Read the memory contents
data = read_memory(process_handle, base_address, size)

# Print the contents of the memory region
print(data)

```
### `search_byte_pattern(process_handle, pattern) `
Searches for a byte pattern in the process memory and returns a list of dictionaries containing the addresses where the pattern was found, along with the original data at those addresses.

**Usage:**
```python
from PyMemoryRW import process_handle, search_byte_pattern

# Get a handle for the target process
handle = process_handle("xyz.exe")

# Byte arrry pattern to search for
byte_pattern = bytes.fromhex('A0 42 00 00 C0 3F 33 33 13 40 00 00 F0 3F 00')
# Byte pattern to search for
value=12413414
pattern = value.to_bytes(4, byteorder='little')

# Search for the byte pattern in the process memory
matches = search_byte_pattern(handle, pattern)

# Print the results
print(matches)  # Example output: [{'address': '0x1000000', 'data': '12345678'}, {'address': '0x2000000', 'data': '12345678'}]
```


### `Scan_pattern(process_handle, pattern) `
The Scan_pattern function searches for a given byte pattern in the memory of a specified process. The pattern can include specific bytes and wildcards (??) that match any byte.

**Usage:**
```python
from PyMemoryRW import Scan_pattern

# Get a handle for the target process (example handle value)
handle = process_handle("xyz.exe")

# Byte pattern to search for, with '??' as wildcards
patterns = "12 34 ?? 56 ?? 11"

# Search for the byte pattern in the process memory
matches = Scan_pattern(process_handle, patterns)

# Print the results
print(matches)  # Example output: [{'base_address': '0x1000', 'data': '12 34 78 56 88 11'}, {'base_address': '0x2000', 'data': '12 34 90 56 33 11'}]

```


### Requirements
<h3>Requirements</h3> <p>To use this library, you need the following Python libraries:</p> <ul> <li>pymem</li> <li>pyinjector</li> <li>ctypes (included in the standard library)</li> </ul> <p>You can install the required libraries using pip:</p> <pre><code>pip install pymem pyinjector mahdix</code></pre> 
<h3>Author</h3>
<p>Mahdi Hasan Shuvo</p>
<h3>Contact</h3>
<ul>
  <li>Email: <a href="mailto:shuvobbhh@gmail.com">shuvobbhh@gmail.com</a></li>
  <li>WhatsApp: <a href="https://wa.me/+8801616397082">+8801616397082</a></li>
  <li>GitHub: <a href="https://github.com/Mahdi-hasan-shuvo">Mahdi-hasan-shuvo</a></li>
  <li>Facebook: <a href="https://www.facebook.com/ma4D1">Mahdi Hasan Shuvo</a></li>
</ul>


            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/Mahdi-hasan-shuvo/PyMemoryRW",
    "name": "PyMemoryR-W",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.11",
    "maintainer_email": null,
    "keywords": "memory manipulation Windows memory management process memory Windows API memory injection memory editing Windows process memory library process hacking Windows utilities memory access system programming memory tools Win32 API Python memory library process manipulation memory read/write Windows programming memory management library Python Windows API",
    "author": "Mahdi Hasan Shuvo",
    "author_email": "shuvobbhh@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/de/72/a942dca0ed87364561fa2ca835aa9a5eaa3f8736c75a62f305272fa9fc26/pymemoryr_w-0.1.1.4.tar.gz",
    "platform": null,
    "description": "\n\n#### This library provides a set of functions for manipulating memory in a Windows process. It allows you to read and write memory, inject DLLs, and search for byte patterns in memory.\n\n[![Twine Version](https://img.shields.io/pypi/v/twine.svg)](https://pypi.org/project/twine)\n[![Python Versions](https://img.shields.io/pypi/pyversions/twine.svg)](https://pypi.org/project/twine)\n[![Docs Badge](https://img.shields.io/readthedocs/twine)](https://twine.readthedocs.io)\n[![Build Status](https://img.shields.io/github/actions/workflow/status/pypa/twine/main.yml?branch=main)](https://github.com/pypa/twine/actions)\n\n\n\n\n\n\n\n## installation\n<pre><code>pip install PyMemoryR-W</code></pre> \n## Functions\n\n### `process_handle(app_name)`\n\nReturns a process handle for the given App name.\n\n**Usage:**\n```python\nfrom PyMemoryRW import process_handle\n\n# Get a handle for the Notepad process\nhandle = process_handle(\"notepad.exe\")\nprint(handle)  # Output might look like: <Handle pid='1234'>\n```\n### `inject_dll(process_handle, dll_path)`\n\nInjects a DLL into a running process.\n\n**Usage:**\n```\nfrom PyMemoryRW import process_handle, inject_dll\n\n# Get a handle for the target process\nhandle = process_handle(\"myapp.exe\")\n\n# Path to the DLL to inject\ndll_path = \"C:\\\\Path\\\\To\\\\MyDLL.dll\"\n\n# Inject the DLL into the target process\ninject_dll(handle, dll_path)\n```\n\n### `write_memory(process_handle, base_address, data) `\nWrites data to a chunk of memory in the process.\n\n**Usage:**\n```python\nfrom PyMemoryRW import process_handle, write_memory\n\n# Get a handle for the target process\nhandle = process_handle(\"myapp.exe\")\n\n# Memory address to write to\nbase_address = 0x1000000\n\n# Data to write (must be bytes)\ndata = b'Hello, World!'\n\n# Write the data to the process memory\nwrite_memory(handle, base_address, data)\n```\n\n\n### `read_memory(process_handle, base_address, size)`\nReads a valu of memory from the process.\n\n**Usage:**\n```python\n\nfrom PyMemoryRW import process_handle, read_memory\n\n\n# Open the process (replace with your process ID)\nprocess_handle = process_handle(\"notepad.exe\")\n\n# Memory address to read from\nbase_address = 0x10000000\n\n# Number of bytes to read\nsize = 1024\n\n# Read the memory contents\ndata = read_memory(process_handle, base_address, size)\n\n# Print the contents of the memory region\nprint(data)\n\n```\n### `search_byte_pattern(process_handle, pattern) `\nSearches for a byte pattern in the process memory and returns a list of dictionaries containing the addresses where the pattern was found, along with the original data at those addresses.\n\n**Usage:**\n```python\nfrom PyMemoryRW import process_handle, search_byte_pattern\n\n# Get a handle for the target process\nhandle = process_handle(\"xyz.exe\")\n\n# Byte arrry pattern to search for\nbyte_pattern = bytes.fromhex('A0 42 00 00 C0 3F 33 33 13 40 00 00 F0 3F 00')\n# Byte pattern to search for\nvalue=12413414\npattern = value.to_bytes(4, byteorder='little')\n\n# Search for the byte pattern in the process memory\nmatches = search_byte_pattern(handle, pattern)\n\n# Print the results\nprint(matches)  # Example output: [{'address': '0x1000000', 'data': '12345678'}, {'address': '0x2000000', 'data': '12345678'}]\n```\n\n\n### `Scan_pattern(process_handle, pattern) `\nThe Scan_pattern function searches for a given byte pattern in the memory of a specified process. The pattern can include specific bytes and wildcards (??) that match any byte.\n\n**Usage:**\n```python\nfrom PyMemoryRW import Scan_pattern\n\n# Get a handle for the target process (example handle value)\nhandle = process_handle(\"xyz.exe\")\n\n# Byte pattern to search for, with '??' as wildcards\npatterns = \"12 34 ?? 56 ?? 11\"\n\n# Search for the byte pattern in the process memory\nmatches = Scan_pattern(process_handle, patterns)\n\n# Print the results\nprint(matches)  # Example output: [{'base_address': '0x1000', 'data': '12 34 78 56 88 11'}, {'base_address': '0x2000', 'data': '12 34 90 56 33 11'}]\n\n```\n\n\n### Requirements\n<h3>Requirements</h3> <p>To use this library, you need the following Python libraries:</p> <ul> <li>pymem</li> <li>pyinjector</li> <li>ctypes (included in the standard library)</li> </ul> <p>You can install the required libraries using pip:</p> <pre><code>pip install pymem pyinjector mahdix</code></pre> \n<h3>Author</h3>\n<p>Mahdi Hasan Shuvo</p>\n<h3>Contact</h3>\n<ul>\n  <li>Email: <a href=\"mailto:shuvobbhh@gmail.com\">shuvobbhh@gmail.com</a></li>\n  <li>WhatsApp: <a href=\"https://wa.me/+8801616397082\">+8801616397082</a></li>\n  <li>GitHub: <a href=\"https://github.com/Mahdi-hasan-shuvo\">Mahdi-hasan-shuvo</a></li>\n  <li>Facebook: <a href=\"https://www.facebook.com/ma4D1\">Mahdi Hasan Shuvo</a></li>\n</ul>\n\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "A library for manipulating memory in a Windows process",
    "version": "0.1.1.4",
    "project_urls": {
        "Bug Reports": "https://github.com/Mahdi-hasan-shuvo/PyMemoryRW/issues",
        "Homepage": "https://github.com/Mahdi-hasan-shuvo/PyMemoryRW",
        "Source": "https://github.com/Mahdi-hasan-shuvo/PyMemoryRW"
    },
    "split_keywords": [
        "memory",
        "manipulation",
        "windows",
        "memory",
        "management",
        "process",
        "memory",
        "windows",
        "api",
        "memory",
        "injection",
        "memory",
        "editing",
        "windows",
        "process",
        "memory",
        "library",
        "process",
        "hacking",
        "windows",
        "utilities",
        "memory",
        "access",
        "system",
        "programming",
        "memory",
        "tools",
        "win32",
        "api",
        "python",
        "memory",
        "library",
        "process",
        "manipulation",
        "memory",
        "read/write",
        "windows",
        "programming",
        "memory",
        "management",
        "library",
        "python",
        "windows",
        "api"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "2493e76001579bd0804cf643f8c075f4e57a01f36f1c1000f395cd799a81f7b0",
                "md5": "456f97d3559efc8b4425e62c13e169e8",
                "sha256": "bf918734eaf1264db3ccbae095e2fcbf1eb98a14ee67b925e2803a643af295da"
            },
            "downloads": -1,
            "filename": "PyMemoryR_W-0.1.1.4-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "456f97d3559efc8b4425e62c13e169e8",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.11",
            "size": 2935,
            "upload_time": "2024-09-01T17:44:12",
            "upload_time_iso_8601": "2024-09-01T17:44:12.605609Z",
            "url": "https://files.pythonhosted.org/packages/24/93/e76001579bd0804cf643f8c075f4e57a01f36f1c1000f395cd799a81f7b0/PyMemoryR_W-0.1.1.4-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "de72a942dca0ed87364561fa2ca835aa9a5eaa3f8736c75a62f305272fa9fc26",
                "md5": "ca48095cab506f68eb9623d91ba621fe",
                "sha256": "6922e650386c7569d55494c8b61d4db63216befd182de6e59da8fdcf6460c1af"
            },
            "downloads": -1,
            "filename": "pymemoryr_w-0.1.1.4.tar.gz",
            "has_sig": false,
            "md5_digest": "ca48095cab506f68eb9623d91ba621fe",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.11",
            "size": 3125,
            "upload_time": "2024-09-01T17:44:13",
            "upload_time_iso_8601": "2024-09-01T17:44:13.843046Z",
            "url": "https://files.pythonhosted.org/packages/de/72/a942dca0ed87364561fa2ca835aa9a5eaa3f8736c75a62f305272fa9fc26/pymemoryr_w-0.1.1.4.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-09-01 17:44:13",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "Mahdi-hasan-shuvo",
    "github_project": "PyMemoryRW",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "pymemoryr-w"
}
        
Elapsed time: 0.52582s