Metadata-Version: 2.4
Name: MemEdit-G3tFun
Version: 0.1.1
Summary: High-performance Windows Memory Scanner/Editor
Home-page: https://github.com/G3tFun/MemEdit
Author: G3tFun
Author-email: contact@g3tfun.com
Project-URL: Bug Tracker, https://github.com/G3tFun/MemEdit/issues
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: C++
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: Microsoft :: Windows
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Requires-Python: >=3.7
Description-Content-Type: text/markdown
Dynamic: author
Dynamic: author-email
Dynamic: classifier
Dynamic: description
Dynamic: description-content-type
Dynamic: home-page
Dynamic: project-url
Dynamic: requires-python
Dynamic: summary

# MemEdit

MemEdit is a high-performance Python library for Windows memory manipulation, built with a C++20 core and `pybind11`. It is designed for speed, efficiency, and ease of use, making it ideal for memory scanning and editing tasks.

## Features

- **C++20 Core**: Leverages modern C++ features for maximum performance.
- **Multi-threaded Scanning**: Uses `std::async` and parallel processing to scan large memory blocks (GBs) in seconds.
- **SIMD-Ready**: Designed for efficient buffer comparisons.
- **AOB Scanning**: Supports "Array of Bytes" searching with wildcards (e.g., `48 8B ?? 05 ?? ?? ?? ??`).
- **Pythonic Interface**: Clean and easy-to-use Python bindings.
- **GIL Management**: Releases the Global Interpreter Lock (GIL) during heavy scanning operations to prevent UI freezing.
- **RAII Memory Management**: Safely handles process handles using modern C++ practices.

## Requirements

- Windows OS
- Python 3.7+
- C++20 compatible compiler (MSVC recommended)
- `pybind11`

## Installation

To compile and install MemEdit, run the following command in the project root:

```bash
pip install .
```

Or for development:

```bash
python setup.py build_ext --inplace
```

## Usage

### Basic Scanning

```python
import MemEdit

# Attach to a process by PID
pid = 1234
scanner = MemEdit.Scanner(pid)

if scanner.is_valid():
    # Perform a first scan for an int32 value
    results = scanner.first_scan_int32(100)
    print(f"Found {len(results)} addresses.")

    # Filter results with a next scan
    results = scanner.next_scan_int32(200)
    print(f"Filtered to {len(results)} addresses.")

    # Write to memory
    if results:
        scanner.write_int32(results[0], 9999)
```

### AOB Scanning

```python
# Scan for a pattern with wildcards
pattern = "48 8B ?? 05 ?? ?? ?? ??"
results = scanner.aob_scan(pattern)
for addr in results:
    print(f"Pattern found at: {hex(addr)}")
```

## Performance Optimization

MemEdit optimizes performance by:
1. **Filtering Regions**: Only scans `MEM_COMMIT` and readable/writable regions (`PAGE_READWRITE`, etc.) using `VirtualQueryEx`.
2. **Parallel Execution**: Distributes scanning tasks across multiple threads.
3. **Efficient I/O**: Minimizes `ReadProcessMemory` calls by reading large chunks into buffers.

## Error Handling

The library includes robust error handling for common issues:
- **Access Denied**: Returns an invalid scanner object if the process cannot be opened.
- **Read/Write Failures**: Throws Python exceptions or returns boolean status for memory operations.

## License

MIT License
