Results 1 to 3 of 3
- 02-22-2012, 01:36 AM #1Member
- Join Date
- Feb 2012
- Rep Power
Best choice? Edit bytecode (asm) or edit java file before compiling
Detecting where comparisons between and copies of variables are made
Inject code near the line where the operation has happened
The purpose of the code: everytime the class is ran make a counter increase
General purpose: count the amount of comparisons and copies made after execution with certain parameters
Note: I always have a .java file to begin with
1) Edit java file
Find comparisons with regex and inject pieces of code near the line And then compile the class (My application uses JavaCompiler)
2)Use ASM Bytecode engineering
Also detecting where the events i want to track and inject pieces into the bytecode And then use the (already compiled but modified) class
What is the best/cleanest way? Is there a better way to do this?
- 02-22-2012, 03:33 AM #2
Re: Best choice? Edit bytecode (asm) or edit java file before compiling
Can you explain what you are trying to do?
And why changing the source and recompiling is a problem.
- 02-22-2012, 11:09 AM #3
Re: Best choice? Edit bytecode (asm) or edit java file before compilingIf you're forever cleaning cobwebs, it's time to get rid of the spiders.
- By bikashlama in forum New To JavaReplies: 1Last Post: 12-29-2011, 02:02 PM
- By gurpreet.singh in forum JavaServer Pages (JSP) and JSTLReplies: 6Last Post: 03-10-2011, 09:07 AM
- By VinTiger in forum New To JavaReplies: 5Last Post: 05-14-2009, 02:18 AM
- By Ravaa in forum New To JavaReplies: 1Last Post: 03-04-2009, 06:57 PM
- By kalanidhi in forum New To JavaReplies: 1Last Post: 11-10-2008, 10:49 AM