Results 1 to 2 of 2
  1. #1
    zstars is offline Member
    Join Date
    Jul 2007
    Posts
    1
    Rep Power
    0

    Default JavaAgents class intercepting

    Hello, I need to "hook" the Math.random() call, because I need to know the values these calls return. I don't have access to the source of the other programs, and I can't modify them because they may change often.

    I am trying to use a JavaAgent to intercept the Math class and modify it, but, although the JavaAgent intercepts several classes, it doesn't seem to intercept the Math class. Does anyone know how it could be done to either intercept Math, or hook Math.random() in any other way?

  2. #2
    JavaBean's Avatar
    JavaBean is offline Moderator
    Join Date
    May 2007
    Posts
    1,270
    Rep Power
    9

    Default

    I don't know what is JavaAgent but if you have control on the JVM of the target program, you can modify source of Math class and run that program with your modified Math class. Java became open source, so you can easily download it, change its source code and recompile it. As far as you check the license carefully, it will work..

Similar Threads

  1. Replies: 0
    Last Post: 04-02-2008, 07:04 AM
  2. Replies: 0
    Last Post: 02-17-2008, 09:01 AM
  3. Replies: 5
    Last Post: 01-03-2008, 07:54 AM

Posting Permissions

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