Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 8 of 8

Thread: how to access another application

  1. #1
    Junior Member
    Join Date
    Apr 2013
    Posts
    26
    My Mood
    Aggressive
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default how to access another application

    hi guys, im trying to program a java application that can access(read and write) memory of another application. for example, an auto-move application for an online game. How is it done or what is it called or how am i gonna start?


  2. #2
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    SW Missouri
    Posts
    20,422
    Thanks
    49
    Thanked 2,215 Times in 2,188 Posts

    Default Re: how to access another application

    Are you asking about changing the memory of an executing program from another program written in java? I don't think it can be done by java alone.
    I'd think the OS would prevent it.
    If you don't understand my answer, don't ignore it, ask a question.

  3. #3
    Junior Member
    Join Date
    Apr 2013
    Posts
    26
    My Mood
    Aggressive
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default Re: how to access another application

    so you would suggest me to write it in C++?

    the program i wanted to access is (.exe), might help

  4. #4
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    SW Missouri
    Posts
    20,422
    Thanks
    49
    Thanked 2,215 Times in 2,188 Posts

    Default Re: how to access another application

    Sorry, this is a java forum, not C++
    If you don't understand my answer, don't ignore it, ask a question.

  5. #5
    Junior Member
    Join Date
    Apr 2013
    Posts
    26
    My Mood
    Aggressive
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default Re: how to access another application

    Quote Originally Posted by Norm View Post
    Sorry, this is a java forum, not C++
    sorry about that, but i asked for a java code or instructions that i can do in java...

  6. #6
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    SW Missouri
    Posts
    20,422
    Thanks
    49
    Thanked 2,215 Times in 2,188 Posts

    Default Re: how to access another application

    I answered that question. See post#2
    If you don't understand my answer, don't ignore it, ask a question.

  7. #7
    Junior Member
    Join Date
    Apr 2013
    Posts
    26
    My Mood
    Aggressive
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default Re: how to access another application

    sorry but i wasnt satisfied by your answer what else i need to have?

  8. #8
    Forum VIP
    Join Date
    Jun 2011
    Posts
    313
    My Mood
    Bored
    Thanks
    46
    Thanked 87 Times in 73 Posts
    Blog Entries
    4

    Default Re: how to access another application

    As Norm said, you can't do this with Java as the language isn't intended for this kind of low level memory management. More accurately, you can but shouldn't.

    There are two workarounds. You can take a look at sun.misc.Unsafe. It's dangerous, undocumented and specific to sun JVM's but it's possibly to abuse it to gain direct access to memory. You will have to explore the JVM source for how this could be achieved. A better option would be to write the memory accessing function in C++ or C and write wrappers with JNI. Bare in mind that this kind of task is exceptionally complex and the operating system will fight against you.

    an auto-move application for an online game
    Sounds like a Robot is what you want.

Similar Threads

  1. Restrict web application access using IP address(es)
    By Shareefuddin in forum Web Frameworks
    Replies: 1
    Last Post: April 10th, 2013, 08:38 AM
  2. Replies: 21
    Last Post: November 27th, 2012, 09:58 PM
  3. Default Access (package access) confusion
    By gauravrajbehl in forum Java Theory & Questions
    Replies: 1
    Last Post: November 18th, 2009, 03:11 AM
  4. access database connectivity from outside an application
    By suchirag in forum JDBC & Databases
    Replies: 0
    Last Post: October 29th, 2009, 02:03 AM