[python-win32] PyWin32 API

Tim Roberts timr at probo.com
Fri Oct 20 14:16:02 EDT 2017


Michael C wrote:
>
> I am wrestling with my life right now, but I'll post more hopefully by
> tomorrow.
>
> Also, I am trying to write my own 'Cheat Engine' or just a memory
> scanner in general, 
> I am just looking for simple values such as a int or a double.

Wrong thread.

Here is C++ code that does what you asked, based on a StackExchange
article that was trying to cheat on games by increasing the money
level.  This one scans my gvim editor process looking for the "cpp"
extension.  It finds several hundred occurrences:
    https://pastebin.com/BbyrXxsf

It's possible to convert that to Python, but you're using ctypes so much
that you're basically writing C code in Python.  Further, Python doesn't
worry about representations in memory.  If you're searching for a
specific floating point value, then you need to know exactly how it was
stored, bit for bit.  Is it single precision?  Double precision?  Scaled
integer?  Are you sure?

And if you do find the value, you can't change it unless you're sure
it's not a false positive.  You're likely to find any 4-byte random
value somewhere in a process, perhaps even as bytes of machine code. 
You don't want to change it unless you're sure it's a numeric constant
and not, say, a pointer.

-- 
Tim Roberts, timr at probo.com
Providenza & Boekelheide, Inc.



More information about the python-win32 mailing list