srounet / Pymem

A python library for windows, providing the needed functions to start working on your own with memory editing.
MIT License
303 stars 45 forks source link

EnumProcessModulesEx - ctypes.ArgumentError: argument 1: OverflowError: int too long to convert #135

Open juzt3 opened 1 month ago

juzt3 commented 1 month ago

Describe the bug When ever i want to read anything using the process_handle i get this error

Your Environment

  1. python version 3.11 64 bits
  2. os version 64 bits
  3. pymem version 1.13.1

Expected behavior get list of modules

Traceback

  File "C:\Users\Paragati\PycharmProjects\TestMem\main.py", line 17, in <module>
    unity_player_addr: int = pymem.process.module_from_name(pm.process_handle, "UnityPlayer.dll").lpBaseOfDll
                             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\Paragati\PycharmProjects\TestMem\.venv\Lib\site-packages\pymem\process.py", line 366, in module_from_name
    for module in modules:
  File "C:\Users\Paragati\PycharmProjects\TestMem\.venv\Lib\site-packages\pymem\process.py", line 415, in enum_process_module
    process_module_success = pymem.ressources.psapi.EnumProcessModulesEx(
                             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
ctypes.ArgumentError: argument 1: OverflowError: int too long to convert

Additional context This is my simple code:

pm = pymem.Pymem("THEGAME.exe")
unity_player_addr: int = pymem.process.module_from_name(pm.process_handle, "UnityPlayer.dll").lpBaseOfDll
print(unity_player_addr)
StarrFox commented 1 month ago

what bitness is your python?

juzt3 commented 1 month ago

64 bits