i get this error when i try to acces to location in memory*
From Get Pointer:: Could not read memory at: 28, length: 4 - GetLastError: 299
From Get Incress Suns:: Could not read memory at: 0, length: 4 - GetLastError: 299
from pymem import *
from pymem.process import *
class Offsets:
sunsOffsets = [0x48, 0x5C, 0x1C, 0xE0, 0x4, 0x5560]
class Menu:
def __init__(self) -> None:
self.application = 'popcapgame1.exe'
try:
self.mem = Pymem(self.application)
self.module = module_from_name(self.mem.process_handle, self.application).lpBaseOfDll
except Exception as error:
print('From Init:: {0}'.format(error))
def appInfo(self):
print('Address Of ( {0} ):: {1}'.format(self.application,self.mem.base_address))
print('Module:: {0}'.format(self.module))
def incressSunCount(self):
try:
baseAddress = (self.module + 0x000A0C78)
address = self.getPointerAddress(baseAddress, Offsets.sunsOffsets)
self.mem.write_int(address, self.mem.read_int(address) + 100)
except Exception as error:
print('From Get Incress Suns:: {}'.format(error))
def getPointerAddress(self, base, offsets):
try:
addr = self.mem.read_int(base)
for offset in offsets:
if offset != offsets[-1]:
addr = self.mem.read_int(addr + offset)
addr += offsets[-1]
except Exception as error:
print('From Get Pointer:: {}'.format(error))
return addr
if __name__ == '__main__':
menu = Menu()
menu.appInfo()
menu.incressSunCount()