thank you, as it is other's idea, I delete it
Asked
Active
Viewed 142 times
0
-
2What is an "address"? It does not have much meaning at Java layer. If you explain why you need this it will be easier to help. – Miserable Variable Oct 15 '13 at 18:12
-
1forget about the address: one of the main reasons which led to design of Java. Every language has some purpose. Java is not a feasible candidate for these kind of programing needs. – Vaibhav Raj Oct 15 '13 at 18:13
-
One simple question: why? – Arne Burmeister Oct 15 '13 at 18:56
-
But... what vulnerability? There isn't one. – Boann Oct 15 '13 at 19:09
-
@computereasy Java is [immune to buffer overflows](http://stackoverflow.com/questions/479701/does-java-have-buffer-overflows). Unless you're calling C-language routines you don't need to worry about it. – Boann Oct 15 '13 at 19:24
1 Answers
1
One way to see the address of a method it is to use certain VM-specific command-line parameters to print the generated native machine code of a method. The addresses are in the disassembly, among other things: https://wikis.oracle.com/display/HotSpotInternals/PrintAssembly
If you only want to see the code, that's your answer. The addresses themselves don't seem useful though, unless you're debugging the VM itself. You certainly couldn't call them from C like that, as the VM is free to repeatedly re-compile methods and move them about, and it does. (This sounds like a case of the X-Y problem. If you say what you're really trying to accomplish you may get a more useful answer.)

Boann
- 48,794
- 16
- 117
- 146