Need help with with probably a wrong code or smthg

This is the code:

import pymem
import time
import re

pm = pymem.Pymem(‘csgo.exe’)
client = pymem.process.module_from_name(pm.process_handle,
‘client.dll’)

clientModule = pm.read_bytes(client.lpBaseOfDll, client.SizeOfImage)
#address = client.lpBaseOfDll + re.search(rb’\x83\xF8.\x8B\x45\x08\x0F’,

clientModule).start() + 2

address = re.search(rb’\x83\xF8.\x8B\x45\x08\x0F’,
clientModule).start() + 2

print(address)
time.sleep(25)
#pm.write_uchar(address, 2 if pm.read_uchar(address) == 1 else 1)
pm.close_process()

For some reason i get this after i run it:

import pymem
Traceback (most recent call last):
File “”, line 1, in
ModuleNotFoundError: No module named ‘pymem’

import time
import re

pm = pymem.Pymem(‘csgo.exe’)
Traceback (most recent call last):
File “”, line 1, in
NameError: name ‘pymem’ is not defined

client = pymem.process.module_from_name(pm.process_handle,
… ‘client.dll’)
Traceback (most recent call last):
File “”, line 1, in
NameError: name ‘pymem’ is not defined

clientModule = pm.read_bytes(client.lpBaseOfDll, client.SizeOfImage)
Traceback (most recent call last):
File “”, line 1, in
NameError: name ‘pm’ is not defined

#address = client.lpBaseOfDll + re.search(rb’\x83\xF8.\x8B\x45\x08\x0F’,

clientModule).start() + 2

address = re.search(rb’\x83\xF8.\x8B\x45\x08\x0F’,
… clientModule).start() + 2
Traceback (most recent call last):
File “”, line 2, in
NameError: name ‘clientModule’ is not defined

print(address)
Traceback (most recent call last):
File “”, line 1, in
NameError: name ‘address’ is not defined

time.sleep(25)
#pm.write_uchar(address, 2 if pm.read_uchar(address) == 1 else 1)
pm.close_process()

or this:

import pymem
import time
import re

pm = pymem.Pymem(‘csgo.exe’)
client = pymem.process.module_from_name(pm.process_handle,
‘client.dll’)

clientModule = pm.read_bytes(client.lpBaseOfDll, client.SizeOfImage)
#address = client.lpBaseOfDll + re.search(rb’\x83\xF8.\x8B\x45\x08\x0F’,

clientModule).start() + 2

address = re.search(rb’\x83\xF8.\x8B\x45\x08\x0F’,
clientModule).start() + 2

print(address)
time.sleep(25)
#pm.write_uchar(address, 2 if pm.read_uchar(address) == 1 else 1)
pm.close_process()
SyntaxError: multiple statements found while compiling a single statement

Hello Chad,

To get better help it is very helpful if you format your code as described here:
https://discuss.python.org/t/about-the-users-category/42

These two errors are very different.

means that you have not installed pymem or it was installed in a location that Python does not find. Without further information I don’t think anyone will be able to help you. After this error, any reference to pymem will fail. It is not loaded.

What would be very helpful would be to supply:

  1. The OS you are using (Windows, MacOS, Linux etc.)
  2. How you installed pymem
  3. If you have more than one Python version installed

Whitespace (spaces, newlines) is important in Python. I think here you have two statements on one line, not separated by a semicolon. However. I can’t see where. It may also be the consequence of earlier errors.