pyMHF


NamepyMHF JSON
Version 0.1.7 PyPI version JSON
download
home_pageNone
Summarypython Modding and Hooking Framework
upload_time2024-10-10 09:19:01
maintainermonkeyman192
docs_urlNone
authormonkeyman192
requires_python>=3.9
licenseNone
keywords hooking games hacking modding
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # pyMHF

*pyMHF* is a python Modding and Hooking Framework.
It is designed to make it very easy to create libraries for any game or application which can then be used to make mods.

## Features

*pyMHF* contains a number of important features to make creatting a modding library as easy as possible:

### Simple hooking

To create a hook, the following pieces of information are required:
- The relative offset of the function from the start of the binary or the byte signature [WIP] of the function.
- The function call signature. This is the return and argument types, specified as would be expected by using Pythons' `ctypes` library.
- A class definition which can be used to indicate the hierarchy of functions to allow for simpler calling of functions from the code.

Once this is provided, hooks can be defined as methods within a `Mod` class, allowing for complex behaviour to be implemented with little effort.

### Ability to hook functions across multiple binaries

Whilst not fully feature complete yet, it will be possible to specify what loaded libraries or binaries the functions reside within, to allow for hook function in both the main executable as well as loaded ones.

### Automatically generated GUI

A GUI (using [DearPyGUI](https://github.com/hoffstadt/DearPyGui)) is automatically generated for the program. All mods will appear automatically as separate tabs, and widgets can be added by way of function decorators within the mod to easily create simple interfaces.

### "Compound hooks"

All hooks are defined as either being run **before** or **after** the original function. This allows *pyMHF* to construct what we call "compound hooks" which may consist of any number of detour methods across any number of mods. This means that two mods which affect the same function may coexist (generally) peacefully.

**Note**: The order of execution of detours is arbitrary, so one must not expect their detour to be run before or after any other detour of the same hook.

### Custom callbacks

Modding libraries can define custom callbacks which can be used to allow methods to be called whenever they are triggered. Examples include *every game tick* or *level change* for example.

### Keyboard callbacks

It is possible to declare methods to be run when a certain key is pressed or released.

### Reloadability

One major annoyance when testing and debugging mods at this level is the requirement to often have to reload the game to reload any mods and hooks which have been created. *pyMHF* has the ability to reload mods (either via the GUI, or via the injected python REPL). This will re-read the python file and reload any hooks or keyboard callbacks which are defined in it.

### Mod states

While reloading mods is great, sometimes objects are instantiated once when the game starts and that is it. To avoid losing these instances across reloads, there is the concept of a `ModState` object which will persist across reloads. These object are bound to the mod itself so it is generally recommended to use these to store any kind of state (and in fact, can be serialized and deserialized to json as a form of saving).

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "pyMHF",
    "maintainer": "monkeyman192",
    "docs_url": null,
    "requires_python": ">=3.9",
    "maintainer_email": null,
    "keywords": "hooking, games, hacking, modding",
    "author": "monkeyman192",
    "author_email": null,
    "download_url": "https://files.pythonhosted.org/packages/7b/6f/ba0301a9af61e6372f2168424f2885ff47f2b2be90a09754bf23820cf659/pymhf-0.1.7.tar.gz",
    "platform": null,
    "description": "# pyMHF\r\n\r\n*pyMHF* is a python Modding and Hooking Framework.\r\nIt is designed to make it very easy to create libraries for any game or application which can then be used to make mods.\r\n\r\n## Features\r\n\r\n*pyMHF* contains a number of important features to make creatting a modding library as easy as possible:\r\n\r\n### Simple hooking\r\n\r\nTo create a hook, the following pieces of information are required:\r\n- The relative offset of the function from the start of the binary or the byte signature [WIP] of the function.\r\n- The function call signature. This is the return and argument types, specified as would be expected by using Pythons' `ctypes` library.\r\n- A class definition which can be used to indicate the hierarchy of functions to allow for simpler calling of functions from the code.\r\n\r\nOnce this is provided, hooks can be defined as methods within a `Mod` class, allowing for complex behaviour to be implemented with little effort.\r\n\r\n### Ability to hook functions across multiple binaries\r\n\r\nWhilst not fully feature complete yet, it will be possible to specify what loaded libraries or binaries the functions reside within, to allow for hook function in both the main executable as well as loaded ones.\r\n\r\n### Automatically generated GUI\r\n\r\nA GUI (using [DearPyGUI](https://github.com/hoffstadt/DearPyGui)) is automatically generated for the program. All mods will appear automatically as separate tabs, and widgets can be added by way of function decorators within the mod to easily create simple interfaces.\r\n\r\n### \"Compound hooks\"\r\n\r\nAll hooks are defined as either being run **before** or **after** the original function. This allows *pyMHF* to construct what we call \"compound hooks\" which may consist of any number of detour methods across any number of mods. This means that two mods which affect the same function may coexist (generally) peacefully.\r\n\r\n**Note**: The order of execution of detours is arbitrary, so one must not expect their detour to be run before or after any other detour of the same hook.\r\n\r\n### Custom callbacks\r\n\r\nModding libraries can define custom callbacks which can be used to allow methods to be called whenever they are triggered. Examples include *every game tick* or *level change* for example.\r\n\r\n### Keyboard callbacks\r\n\r\nIt is possible to declare methods to be run when a certain key is pressed or released.\r\n\r\n### Reloadability\r\n\r\nOne major annoyance when testing and debugging mods at this level is the requirement to often have to reload the game to reload any mods and hooks which have been created. *pyMHF* has the ability to reload mods (either via the GUI, or via the injected python REPL). This will re-read the python file and reload any hooks or keyboard callbacks which are defined in it.\r\n\r\n### Mod states\r\n\r\nWhile reloading mods is great, sometimes objects are instantiated once when the game starts and that is it. To avoid losing these instances across reloads, there is the concept of a `ModState` object which will persist across reloads. These object are bound to the mod itself so it is generally recommended to use these to store any kind of state (and in fact, can be serialized and deserialized to json as a form of saving).\r\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "python Modding and Hooking Framework",
    "version": "0.1.7",
    "project_urls": {
        "Homepage": "https://github.com/monkeyman192/pyMHF",
        "Repository": "https://github.com/monkeyman192/pyMHF.git"
    },
    "split_keywords": [
        "hooking",
        " games",
        " hacking",
        " modding"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "39bf53738664cce584fc430e3c40843a0e286529a978e91a966d29659c87cd32",
                "md5": "ac70ee431aa464e46079fbe34744faac",
                "sha256": "f102cdf5555d5ba98f3692ac23b849a3344a3699a574dab8a169d593efbf8a4c"
            },
            "downloads": -1,
            "filename": "pyMHF-0.1.7-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "ac70ee431aa464e46079fbe34744faac",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.9",
            "size": 50265,
            "upload_time": "2024-10-10T09:18:59",
            "upload_time_iso_8601": "2024-10-10T09:18:59.097569Z",
            "url": "https://files.pythonhosted.org/packages/39/bf/53738664cce584fc430e3c40843a0e286529a978e91a966d29659c87cd32/pyMHF-0.1.7-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "7b6fba0301a9af61e6372f2168424f2885ff47f2b2be90a09754bf23820cf659",
                "md5": "d3c37d55fae19ee751b2b7e16c29b166",
                "sha256": "9d59131668ada595f4249e9e43436fe0921212e494233bf443d7cfc0d106fd75"
            },
            "downloads": -1,
            "filename": "pymhf-0.1.7.tar.gz",
            "has_sig": false,
            "md5_digest": "d3c37d55fae19ee751b2b7e16c29b166",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.9",
            "size": 142329,
            "upload_time": "2024-10-10T09:19:01",
            "upload_time_iso_8601": "2024-10-10T09:19:01.067295Z",
            "url": "https://files.pythonhosted.org/packages/7b/6f/ba0301a9af61e6372f2168424f2885ff47f2b2be90a09754bf23820cf659/pymhf-0.1.7.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-10-10 09:19:01",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "monkeyman192",
    "github_project": "pyMHF",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "pymhf"
}
        
Elapsed time: 0.83933s