[prev in list] [next in list] [prev in thread] [next in thread]
List: bcel-user
Subject: Re: wrapping native methods
From: Andreas Schlapbach <schlpbch () iam ! unibe ! ch>
Date: 2002-10-08 22:04:55
[Download RAW message or body]
I don't know wether this is still of interest, but I found these two
papers guite illuminating:
[Gon98] Li Gong. Secure java class loading. In IEEE Internet Computing,
volume 2, 1998.
[LB98] Sheng Ling and Gilad Bracha. Dynamic class loading in the java
virtual machine. In Proceedings OOPSLA 98, 1998.
Andreas
Andrew Smallbone wrote:
>>AFAIK, it is not possible to modify core Java classes
>>(not without cheating anyway).
>
>
> OK, if I did cheat (by replacing the system class loader?)
> would it be possible? ie add instructions around a native method?
>
> I want to make sure that _every_ call to System.currentTimeMillis()
> runs our extra code - including our code, 3rd party libraries, and
> system code. Wouldn't scanning classses for calls to the method also
> have the same problem with trying to modify system classes that call
> currentTimeMillis().
>
> Thanks again
> Andrew
>
>
>>You can, however, modify all other classes. For example,
>>scan the classes for calls to invokestatic
>>System.currentTimeMillis (very easy with BCEL), and
>>replace them with invokestatic <your_class.your_method>.
>>This simple replacement (as opposed to adding the code
>>inline) would be your best bet, as it shouldn't require
>>any other changes.
>>You can do this ahead of time, or at run time with your
>>own ClassLoader.
>>
>>
>>------------------------------------------------------------------------
>>
>>--
>>To unsubscribe, e-mail: <mailto:bcel-user-unsubscribe@jakarta.apache.org>
>>For additional commands, e-mail: <mailto:bcel-user-help@jakarta.apache.org>
>
--
Andreas Schlapbach schlpbch@iam.unibe.ch
http://www.iam.unibe.ch/~schlpbch
--
To unsubscribe, e-mail: <mailto:bcel-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:bcel-user-help@jakarta.apache.org>
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic