Change Log
==========

0.2.0 (02/10/2025)
--------------------

This release makes a milstone in stability and functionality for pyMHF.
The API for hooking functions should be considered "stable" from this point onwards and is unlikely to change significantly in the future (I hope!).
Next release set will focus on UI/UX as well as utilities, both in terms of the GUI and in the code.

- Further improved partial structs to allow nesting references to themselves as a type (must be "indirect", ie. the type of a pointer, or dynamic array for example).
- Added a fallback method to calculate the binary hash in case opening the file fails. Thanks to `@sparrow <https://github.com/samjviana>`_ for implementing this.
- Fixed some inssues around running python files directly with ``pymhf run``
- Added the option to pass command line arguments to the function when ``pymhf`` starts the process itself.
- Added the ``config_overrides`` argument to :py:func:`~pymhf.main.load_mod_file` to allow overriding the static config values.
- Implemented the functionality so that if ``start_paused`` is True, the program will start automatically once injection is completed (no need for manual input any more).

0.1.16 (16/08/2025)
-------------------

- Improved hooking performance by using the bulk enable mode in minhook. (`#26 <https://github.com/monkeyman192/pyMHF/issues/26>`_)
- Fixed an issue running mods where attach to already existing processes.
- Fixed an issue with getting the caller offset address.
- Added the ability to specify an already running processes' PID to attach pyMHF. (`#75 <https://github.com/monkeyman192/pyMHF/issues/75>`_)
- Made :py:func:`~pymhf.main.run_module` a public method as the recommended way to invoke pyMHF from code. (`#76 <https://github.com/monkeyman192/pyMHF/issues/76>`_)
- Added config options to not use the interactive python interpreter and not show the log window. (`#76 <https://github.com/monkeyman192/pyMHF/issues/76>`_)
- Added `pyrun_injected <https://github.com/monkeyman192/pyrun_injected>`_ as a dependency to allow injecting python versions greater than 3.11.
- Improved custom callback functionality by allowing extra arguments to be passed to the called functions.

0.1.15 (16/07/2025)
-------------------

- Fixed an issue where the `this` argument wouldn't get correctly determined to be a pointer.
- Added the configured mod directory to the system path to aide in inter-mod communication.
- Improved support for mod folders which contained sub-folder for each mod. Now each folder is added to the system path if it contains any mods. (`#71 <https://github.com/monkeyman192/pyMHF/issues/71>`_)

0.1.14 (09/07/2025)
-------------------

- Added the ability for partial classes to subclass from another partial struct or ``ctypes.Structure``.
- Change mod folder loading so that it will load from sub-folders as well. (`#64 <https://github.com/monkeyman192/pyMHF/issues/64>`_)
- Implement a offset cache - This will reduce start up times after the initial load for any pattern which has already been found for the same binary. (`#2 <https://github.com/monkeyman192/pyMHF/issues/2>`_)
- Changed the `@disable` decorator so that it can be applied to mods as well as hooks.
- Made some internal changes so that mods which define the same hook (whether by having the same pattern or a different one that resolves to the same offset) will not cause a clash. (`#53 <https://github.com/monkeyman192/pyMHF/issues/53>`_)
- Fixed an issue that meant that the numbers logged for loaded mods and hooks wasn't correct.

0.1.13 (26/06/2025)
-------------------

- Fixed an issue where function definitions defined with a pointer as their ``this`` argument weren't able to be called correctly.
- Fixed an issue where calling a library directly with ``pymhf run <library path>`` wouldn't be able to import the library.
- Improved front-facing type hinting.

0.1.12 (23/06/2025)
--------------------

- Identified and fixed partially by config changes and partially by documentation issues with pyMHF being run with uv. Thanks to `@Foundit3923 <https://github.com/Foundit3923>`_ for helping to figure out the issues.
- Improved inter-mod communication.
- Added the ability to specify the total size of a partial struct using the ``_total_size_`` attribute. This will be utilised more in some upcoming changes which should simplify initialization of structs from memory using hooked functions.
- Added a new way to specify the data required for hooking and calling functions. See :doc:`here </docs/creating_hook_definitions>` for more details. This method will completely replace the old method of using the ``__pymhf_func_offsets__`` etc. "magic" mod attributes.
- Added a :py:func:`~pymhf.extensions.ctypes.c_enum32` type which can be used to construct enums as fields.

0.1.11 (29/04/2025)
--------------------

- Added the :py:func:`pymhf.gui.decorators.gui_combobox` decorator (partial work on `#15 <https://github.com/monkeyman192/pyMHF/issues/15>`_).
- Added the ability for mods to access each others' attributes and methods. (`#5 <https://github.com/monkeyman192/pyMHF/issues/5>`_). See :doc:`this page </docs/inter_mod_functionality>` for more details.
- Fixed a few issues regarding running pyMHF. Thanks to `@Foundit3923 <https://github.com/Foundit3923>`_ for helping to figure out the issues.
- Fixed an issue where hooks of imported functions which have ``_result_`` as an argument work.
- Added :py:func:`pymhf.core.hooking.NOOP` decorator which indicates that the original game function shouldn't be called. (`#20 <https://github.com/monkeyman192/pyMHF/issues/20>`_)
- Added a hex editor to the pyMHF gui. This is accessible from the "Hex Viewer" tab of the gui and allows real time viewing of data, following pointer values, and capturing memory snapshots. (`#43 <https://github.com/monkeyman192/pyMHF/issues/43>`_).
- Fixed an issue with loading hooks. Thanks to `@cengelha <https://github.com/cengelha>`_ for finding the bug.
- Added "always on top" gui setting to the config. Thanks to `@cengelha <https://github.com/cengelha>`_ for adding it.
- Fixed an issue with the debug mode toggle in the GUI. (`#49 <https://github.com/monkeyman192/pyMHF/pull/49>`_).

0.1.10 (26/02/2025)
-------------------

- Added :py:func:`pymhf.core.hooking.get_caller` decorator for detours. When added, this will determine the location the function was called from. (`#34 <https://github.com/monkeyman192/pyMHF/issues/34>`_). NOTE: This currently will only work properly for 64bit applications.
- Added an :py:func:`pymhf.core.hooking.exported` hook to allow hooking functions which are exported by the main exe.
- Added the :py:func:`pymhf.core.calling.call_exported` function which allows exported functions by the game to be called.
- Added the ability to specify in the :py:func:`pymhf.core.hooking.imported` decorator whether the detour time is ``"before"`` or ``"after"``.
- Fixed an issue where hooks defined using the :py:func:`~pymhf.core.hooking.manual_hook` decorator didn't use the ``__pymhf_func_offsets__`` etc. variables defined. (Thanks to `@hashcatHitman <https://www.github.com/hashcatHitman>`_ for finding the bug.)
- Made improvements to the shutting down of pyMHF so that when the process it is attached to exits, so does pyMHF.
- Added a class decorator :py:func:`pymhf.utils.partial_struct.partial_struct` which can be used to create ``ctypes.Structure`` types without needing to know the entire layout of the struct. See :doc:`here </docs/partial_structs>` for details.

0.1.9 (23/01/2025)
------------------

- Added ``cmd`` mode to the configuration to run commands in any registered libraries.
- Added transparency slider and "always on top" options to the pymhf window.
- Made a fix to manual hooks which were being declared with a pattern and name only.

0.1.8 (26/12/2024)
------------------

- Add ability for single-file mods to be run by pymhf. (`#19 <https://github.com/monkeyman192/pyMHF/issues/19>`_)
- Changed the config system to use toml files. (`#27 <https://github.com/monkeyman192/pyMHF/issues/27>`_)
- Added ability for pymhf to be attached to an already running process. (`#28 <https://github.com/monkeyman192/pyMHF/issues/28>`_)

0.1.7 (10/10/2024)
------------------

- Implement ability to call overloaded functions which have patterns.
- Improve safety of hooking functions and keyboard bindings as well as GUI reload fix.
- Added functions to set the main window active (`#6 <https://github.com/monkeyman192/pyMHF/issues/6>`_) - Contributed by `@Foundit3923 <https://github.com/Foundit3923>`_

0.1.6 (08/09/2024)
------------------

- Add ability for GUI widgets to reload when their associated mod gets reloaded (`#4 <https://github.com/monkeyman192/pyMHF/issues/4>`_)
- Add ``extra_args`` option to GUI field type decorators (eg, ``FLOAT``) which are passed through to DearPyGui (`#8 <https://github.com/monkeyman192/pyMHF/issues/8>`_)
- Fix issues with hooking multiple functions which are overloads of the same base function.
- Add the ability for patterns to be hooked up using the ``FUNC_PATTERNS`` data in implementing libraries (`#14 <https://github.com/monkeyman192/pyMHF/issues/14>`_)

0.1.5 (26/08/2024)
------------------

- Allow overriding of function return values.
- Fixed issue with ``after`` manual hooks with a ``_result_`` argument.
- Implement pattern scanning functionality (`#1 <https://github.com/monkeyman192/pyMHF/issues/1>`_)

0.1.4 (14/08/2024)
------------------

- Overhauled config system to provide a more user-friendly experience.
- Fixed a critical bug in hooking which meant that no result was returned.
- Fixed an issue injecting variables into pymhf.

0.1.3 (31/07/2024)
------------------

- Implemented manual hooks. These are a decorator which have the can take an offset, name, and function definition, and allow for hooking a function without having to rely on the underlying library which utilises pymhf.
- Made changes so that libraries can be installed as plugins to pymhf so that they can be run like ``pymhf <libname>``

0.1.2 (15/07/2024)
------------------

- Made improvements to config reading

0.1.1 (05/07/2024)
------------------

- Fixed issues loading applications which aren't loaded with steam.
- Fixed logging number of mods loaded.
- Implemented custom triggers. They can be implemented by libraries which use this framework to enable custom triggers which are specific to the game/application.
- Fixed some issues with reloading of mods when there are multiple mods all contributing to compound hooks, including hooks with completely disabled detours.
- Added ``@no_gui`` decorator which can be applied to a ``Mod`` class to indicate that it doesn't need to be shown in the GUI.

0.1.0 (30/06/2024)
------------------

- Initial release. Much of the functionality has been copied over from `NMS.py <https://github.com/monkeyman192/NMS.py>`_ which was how this project started.
