srounet / Pymem

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

weird error #75

Closed focat69 closed 1 year ago

focat69 commented 2 years ago

I'm trying to run this code:

import pymem
import subprocess

try:
    mem = pymem.Pymem("mspaint.exe") ### reads memory of mspaint.exe
except:
    subprocess.Popen("mspaint.exe")
    mem = pymem.Pymem("mspaint.exe")

mem.inject_python_interpreter() ### injects the python interpreter to be able to understand python code

### code which we will be injecting
code = """ 
import tkinter as tk
win = tk.Tk()
win.mainloop()
"""

mem.inject_python_shellcode(code) ### injecting the code

but when I run the app it shows:

  File "C:\Users\code1tech\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\pymem\__init__.py", line 178, in start_thread
    pymem.logger.debug('New thread_id: 0x%08x' % thread_h)
TypeError: %x format: an integer is required, not NoneType

can anybody help?

StarrFox commented 1 year ago

this should be the same error as https://github.com/srounet/Pymem/issues/86