PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Sunday, November 27, 2022

[FIXED] How can I change the value of an memory-address in Python?

 November 27, 2022     cheat-engine, memory, memory-address, module, python     No comments   

Issue

My current code that does not show an error message but also doesn't work:

py import time
from ReadWriteMemory import ReadWriteMemory

process = ReadWriteMemory.get_process_by_name("Tutorial-i386.exe")
process.open()

address = 0x0195A810
health = process.get_pointer(address, offsets=[0])

while True:
    value = process.read(health)
    print(value)
    time.sleep(0.5)

Solution

You can try to use the ctypes library. Try this,

import ctypes

data = (ctypes.c_char).from_address(0x0195A810)

You can read and assign to the data variable. Make sure you select the correct type. I used char in this instance. Not sure what kind of value is stored there. You can see what types are available in the link below.

You can also get a list/array of memory addresses using this,

dataarr = (ctypes.c_char*offset).from_address(0x0195A810)

You can check out the documentation here,

https://docs.python.org/3/library/ctypes.html



Answered By - anarchy
Answer Checked By - Dawn Plyler (PHPFixing Volunteer)
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing