Results 1 to 2 of 2
Thread: JavaAgents class intercepting
- 07-16-2007, 10:54 PM #1Member
- Join Date
- Jul 2007
- Rep Power
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?
- 07-16-2007, 11:27 PM #2
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..
- By Santoshbk in forum Advanced JavaReplies: 0Last Post: 04-02-2008, 08:04 AM
- By Java Tip in forum Java TipReplies: 0Last Post: 02-17-2008, 10:01 AM
- By kbyrne in forum AWT / SwingReplies: 5Last Post: 01-03-2008, 08:54 AM