Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Java: How do I get values from the other programs? [closed]

Tags:

java

To make the question more understandable, there is a software called CheatEngine, and basically what it does is, it collects all the bytes of the software that you're trying to work with and you can select any of those and change the value.

For example you want to change the score of any game. You can search for the value of the current score, and change it to what ever you would like.

Now the question is, is it possible to create something like that using java, that would take all the data from the memory, that the software you're trying to "hack" in to, uses?

Let me know which sources should I look up for.

P.S. If the post got grammar mistakes, I am sorry. I am from Russia and I am not the best in English language.

like image 358
BobTheSatan Avatar asked Sep 29 '22 06:09

BobTheSatan


2 Answers

Java is very restricted in direct memory access (for a good reason), so it is very unlikely this can be done with Java. The JNI can perform (managed or unsafe) OS operations, so you could try calling any C function that returns the data at a given memory location, but I suppose you would be better off with using C in the first place (not Java), then.

like image 91
user1438038 Avatar answered Nov 02 '22 22:11

user1438038


By language definition java runs in a sandbox in the JVM. So it is impossible to access other places in the memory outside of it. Also Java cannot access specific positions in the memory, there are no pointers.

like image 25
andreadi Avatar answered Nov 02 '22 22:11

andreadi