StarrFox / wizwalker

Wizard101 scripting api
https://starrfox.github.io/wizwalker
GNU General Public License v3.0
37 stars 30 forks source link

Memory scanning issue with hooks #5

Closed StarrFox closed 4 years ago

StarrFox commented 4 years ago

Some users are experiencing an error while hooking

Traceback (most recent call last):
  File "c:\users\username\appdata\local\programs\python\python38-32\lib\site-packages\wizwalker\cli\console.py", line 137, in hook_command
    await client.activate_hooks(target_hook.replace(" ", "_"))
  File "c:\users\username\appdata\local\programs\python\python38-32\lib\site-packages\wizwalker\client.py", line 70, in activate_hooks
    await hook()
  File "c:\users\username\appdata\local\programs\python\python38-32\lib\site-packages\wizwalker\windows\memory\handler.py", line 36, in wrapped
    return await function(*args, **kwargs)
  File "c:\users\username\appdata\local\programs\python\python38-32\lib\site-packages\wizwalker\utils.py", line 61, in sync_wrapper
    return await loop.run_in_executor(pool, internal_function)
  File "c:\users\username\appdata\local\programs\python\python38-32\lib\concurrent\futures\thread.py", line 57, in run
    result = self.fn(*self.args, **self.kwargs)
  File "c:\users\username\appdata\local\programs\python\python38-32\lib\site-packages\wizwalker\windows\memory\handler.py", line 283, in hook_player_struct
    player_hook.hook()
  File "c:\users\username\appdata\local\programs\python\python38-32\lib\site-packages\wizwalker\windows\memory\hooks.py", line 67, in hook
    self.jump_bytecode = self.get_jump_bytecode()
  File "c:\users\username\appdata\local\programs\python\python38-32\lib\site-packages\wizwalker\windows\memory\hooks.py", line 118, in get_jump_bytecode
    distance = self.hook_address - self.jump_address
TypeError: unsupported operand type(s) for -: 'int' and 'list'

this is caused by this line in pymem

This seems to be a memory protection issue which is strange because it doesn't affect everyone

StarrFox commented 4 years ago

fixed in fa0232c690bebe7d6c718354cbd4fd9c9ed27dc7