monkeyman192 / NMS.py

A NMS hooking and modding framework built around pymem and cyminhook
MIT License
15 stars 5 forks source link

Example basic_mod.md is out of date #5

Open cakebread opened 2 months ago

cakebread commented 2 months ago

I'm trying to run the basic_mod example, but it seems out of date.

https://github.com/monkeyman192/NMS.py/tree/master/docs/examples/basic_mod.md

I changed the first line:

import nmspy.data.function_hooks as hooks

to:

import nmspy.data.functions.hooks as hooks

I can't figure out what 'main_loop' in the second line has been renamed to: from pymhf.core.hooking import disable, main_loop, on_key_pressed, on_key_release

>>> import pymhf.core.hooking
>>> dir(pymhf.core.hooking)
['Any', 'CFUNCTYPE', 'CFuncPtr', 'Callable', 'DetourTime', 'FUNCDEF', 'FuncHook', 'HookFactory', 'HookManager', 'HookProtocol', 'ManualHookProtocol', 'ORIGINAL_MAPPING', 'Optional', 'Type', '__annotations__', '__builtins__', '__cached__', '__doc__', '__file__', '__loader__', '__name__', '__package__', '__spec__', '_detour_is_valid', '_internal', 'ast', 'cast', 'cyminhook', 'disable', 'find_pattern_in_binary', 'hook_logger', 'hook_manager', 'inspect', 'logging', 'manual_hook', 'module_data', 'on_key_pressed', 'on_key_release', 'one_shot', 'partial', 'pattern_cache', 'traceback']

Getting to line three, I'm stumped:

from nmspy.memutils import map_struct

Thanks!

cakebread commented 2 months ago

I fixed up all the imports so there are no errors, added in TestModState, and it runs with no errors, but exits immediately without printing anything to stdout/stderr. basicmod.md

monkeyman192 commented 2 months ago

Hi sorry, I haven't had too much time to properly fix up the documentation. I will get to fixing it up soon!

Edit: In fact, actually the example mods will probably actually be moved out of the documentation itself and into a separate folder where they can actually just be run directly. The reason the docs and examples are a bit behind/lacking is because there has been a decent amount of work behind the scenes to migrate NMS.py to use pyMHF, and so I'm still just getting all that finished and into a good state so that it's usable. This is very close so I think it's almost in a state where we can start having some good example mods and start working on improving the documentation.