If I can hook into a Win32 process, will I be able to do:
-
Read variables from inside a Class inside the process?
-
I have a full source code for the Win32 app above, can I use that as reference for this subject?
Cheers.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Yes. As soon as your module is hooked into the process, you share the same address space. That means memory that the process has allocated (e.g. for class instances) will be accessible to you.
If you know the offset of the class instance, then you can either:
See Traversing the Module List on MSDN. Once you have the MODULEENTRY32 of the process you wish to “hook”, you can use the
modBaseAddras a base for your offsets. For example if you know that a global variable which points to a class instance is at 0x000AD421, you can do:or
As stated by other commenters, finding the offset of the class base is the hardest part of this process. However if you have the class definitions handy, this is essentially the only piece of work you have to do (i.e. you don’t also have to find the class member offsets, too).