srounet / Pymem

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

pymem.ressources.structure.EnumProcessModuleEX.LIST_MODULES_ALL ctypes.ArgumentError: argument 1: <class 'OverflowError'>: int too long to convert #21

Closed fernandon00b closed 3 years ago

fernandon00b commented 4 years ago

This is my code import pymem from pymem import pattern


p=pymem.Pymem()
p.open_process_from_name("Main.exe")
pattern.pattern_scan_module(p.process_handle,pymem.process.module_from_name(p.process_handle,"Main.exe"),
                            "\x00 \x09 \x00 \x00 \x00 \x00 \x00 \x00 \x00 \x00 \x00 \x00 \x01 \x00 \x00 \x00 \x00 \x00 \x01 \x00 \x00 \x00 \x00 \x00 \x00 \x00 \x40 \xC0 \x00 \x00 \x40 \xC0 \x00 \x00 \x40 \xC0 \x00 \x00 \x40 \xC0 \x00 \x00 \x40 \xC0 \x00 \x00 \x40 \xC0",
                            "??xxxxxx????????xxxxxxxxxx????xx????xx??????????xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx")

GetContext_pattern = b"\x00 \x09 \x00 \x00 \x00 \x00 \x00 \x00 \x00 \x00 \x00 \x00 \x01 \x00 \x00 \x00 \x00 \x00 \x01 \x00 \x00 \x00 \x00 \x00 \x00 \x00 \x40 \xC0 \x00 \x00 \x40 \xC0 \x00 \x00 \x40 \xC0 \x00 \x00 \x40 \xC0 \x00 \x00 \x40 \xC0 \x00 \x00 \x40 \xC0"
GetContext_mask = "??xxxxxx????????xxxxxxxxxx????xx????xx??????????xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
pymem.pattern.pattern_scan_module(p.)

i want to get the address from this pattern ?? 09 00 00 ?? ?? ?? ?? 00 00 00 00 01 ?? ?? 00 ?? ?? 01 ?? ?? ?? ?? ?? 00 00 40 C0 00 00 40 C0 00 00 40 C0 00 00 40 C0 00 00 40 C0 00 00 40 C0 can someone help me please

when I run the code an error show:

2020-05-12 17:01:13,174 - pymem - DEBUG - Process 25232 is being debugged Traceback (most recent call last): File "terbaru.py", line 6, in module = pymem.process.module_from_name(p.process_handle, "Discord.exe") File "C:\Python37\lib\site-packages\pymem\process.py", line 276, in module_from_name for module in modules: File "C:\Python37\lib\site-packages\pymem\process.py", line 323, in enum_process_module pymem.ressources.structure.EnumProcessModuleEX.LIST_MODULES_ALL ctypes.ArgumentError: argument 1: <class 'OverflowError'>: int too long to convert

srounet commented 4 years ago

Hello, you should come to the discord channel to get some support. It could be python, your os, you debugging a 32 bit process on 64 bit python or many other things.

I highly suggest you to come to discord channel here: https://discord.gg/xaWNac8

fernandon00b commented 4 years ago

I already asked that but no one answered , what is your username in discord

WEGFan commented 3 years ago

You can try to add p.process_handle &= 0xffffffff after p.open_process_from_name("Main.exe")

srounet commented 3 years ago

The pattern method recently got updated you should try the new method and create a new issue if still failing