Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
juzt3 opened this issue May 11, 2024 · 2 comments

Comments

@juzt3
Copy link

juzt3 commented May 11, 2024

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
Copy link
Collaborator

what bitness is your python?

@juzt3
Copy link
Author

juzt3 commented May 13, 2024

64 bits

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants