Results 1 to 8 of 8
  1. #1
    edge241 is offline Member
    Join Date
    Jul 2012
    Posts
    6
    Rep Power
    0

    Default Open .exe within Java component

    Hello all,

    I'm new here and this is my first question and post.
    Right my question is, Is it possible to open up a game using java and manipulate it (as a cheat). So i want to open up "chess" Using java (this is fine) But then i want to be able to "read" what is on the screen and act due to different actions, or moves etc.

    Is this possible? And what is the best way to do this?

    What i know so far

    I can open the file by doing
    Process process = Runtime.getRuntime().exec("");

    But i don't know how i can get information from it.

    Thank you

  2. #2
    JosAH's Avatar
    JosAH is offline Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,762
    Blog Entries
    7
    Rep Power
    21

    Default Re: Open .exe within Java component

    It's an entirely different process and it probably doesn't have an API you can use to read information from the process so all you can do is grab pixels from the screen; read about the Robot classs; it can do just that.

    kind regards,

    Jos
    cenosillicaphobia: the fear for an empty beer glass

  3. #3
    kammce's Avatar
    kammce is offline Senior Member
    Join Date
    Dec 2010
    Location
    California
    Posts
    194
    Rep Power
    4

    Default Re: Open .exe within Java component

    sounds like you want to do software exploits. Same as JosAH, I do not believe there is an API that will allow you to read/parse through the binary/Assembly instructions step by step in Java... But now that I think about it, that might be a really cool project!

    If you are intrested in Software Exploits with Binary files and Assembly code, Check this out. Day 1 Part 1: Introduction to Software Exploits - YouTube... This is some advanced stuff, and requires the knowledge of Assembly and is a bit off topic (sorry) from Java. It is still interesting. If you want to automate something, use the Robot Class as JosAH has suggested.
    My API:
    Java Code:
    cat > a.out || cat > main.class

  4. #4
    edge241 is offline Member
    Join Date
    Jul 2012
    Posts
    6
    Rep Power
    0

    Default Re: Open .exe within Java component

    Just had a look at the robot class, It looks like the sort of thing that i need. Now another question that i Need, Is, Is it possible for the chess program to be opened within a GUI that i have, So the pixels and everything are constantly the same. This would also, presumably, make it so i can have the program running underneath what i am doing and still work??

  5. #5
    doWhile is offline Moderator
    Join Date
    Jul 2010
    Location
    California
    Posts
    1,641
    Rep Power
    7

    Default Re: Open .exe within Java component


  6. #6
    edge241 is offline Member
    Join Date
    Jul 2012
    Posts
    6
    Rep Power
    0

    Default Re: Open .exe within Java component

    sorry

  7. #7
    edge241 is offline Member
    Join Date
    Jul 2012
    Posts
    6
    Rep Power
    0

    Default Re: Open .exe within Java component

    Just bumping with my question again.
    Just had a look at the robot class, It looks like the sort of thing that i need. Now another question that i Need, Is, Is it possible for the chess program to be opened within a GUI that i have, So the pixels and everything are constantly the same. This would also, presumably, make it so i can have the program running underneath what i am doing and still work??

  8. #8
    JosAH's Avatar
    JosAH is offline Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,762
    Blog Entries
    7
    Rep Power
    21

    Default Re: Open .exe within Java component

    No, another process has no idea about Java visual components in a parent process. It takes (quite a bit of) native code to 'fool' the other process. The Robot class doesn't care about visual components either, i.e. you can grab rectangular areas from anywhere on the entire screen.

    kind regards,

    Jos
    cenosillicaphobia: the fear for an empty beer glass

Similar Threads

  1. Open .exe within Java component
    By edge241 in forum Advanced Java
    Replies: 1
    Last Post: 07-20-2012, 01:19 PM
  2. Research java charting component
    By ahmedahmed in forum Advanced Java
    Replies: 4
    Last Post: 12-22-2011, 10:40 AM
  3. Calling url from java component
    By cool in forum AWT / Swing
    Replies: 3
    Last Post: 12-07-2010, 11:58 AM
  4. How to use Jacob component in a Java Applet?
    By ollyworks in forum Java Applets
    Replies: 1
    Last Post: 09-09-2009, 05:07 AM
  5. Java Chart Component
    By Jamie in forum AWT / Swing
    Replies: 1
    Last Post: 05-31-2007, 07:07 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •