I´m going to write an application to modify java bytecode in order to record all the input (files, network, user input) in the exe开发者_开发知识库cution. In order to do this, I only need to wrap the java.io native methods? Is there any other source of input ?
Thank you all!
Check AspectJ. It provides higher level API to what you are going to do.
Other possibility is using conventional tools. For example sockets are created via SocketFactory that can be substituted by calling special static method. So you can substitute real socket by yours own and get access to each byte passed through the socket. Although I implemented a prototype of such system about 6-7 year ago I do not remember by heart all details. I believe you can investigate them yourself. But AspectJ approach is easier (IMHO).
精彩评论