[Soot-list] Pattern matching in bytecode

Silviu ANDRICA silviu.andrica at epfl.ch
Wed Oct 29 10:10:18 EDT 2008


Hello everybody,
    this list has been extremely helpful in the past so I decided to ask 
for help again.
What I want to do is: given an instruction in java bytecode, say 
monitorenter, and a list of
instructions that should precede it and a list of instructions that 
should follow it, I want to check
if a real java app respects this.

By way of an example,
say I have <before1 before2 before3 monitorenter after1 after2> the 
sequence of instructions that
should be in a real code.

My main concern, and the reason I'm writing to you, is that soot changes 
the bytecode. What I mean is
that if I load a class and then I want to write it back, the bytecode of 
the two versions differ, rendering
my analysis useless.

So, my question is: is there a way I can do this analysis? Is there a 
way I can prevent soot from refactoring the code,
or a way to check for equivalence between two sequences of bytecode?

Best regards,
    Silviu



More information about the Soot-list mailing list