[Soot-list] Instrument try-catch

Guru Devanla gdevan2 at uic.edu
Wed Feb 26 11:58:42 EST 2014


I don't think there is a set of try-catch exception classes to do this. You
will have to work with Jimple syntax and create equivalent throw/goto
statements. I managed to find an example here ( I just googled for it, not
sure how accurate the code is)

http://soot.googlecode.com/svn/DUA_Forensis/src/profile/CatchWrapInstrumenter.java

There may be other ways to do this.

Thanks
Guru










On Tue, Feb 25, 2014 at 8:48 AM, Aritra Dhar <aritra1204 at iiitd.ac.in> wrote:

> Hi Guru,
>
>
> I want to do some thing like this. Say I have method foo(int,int),
> foo(a,b)
> {
> int c;
> c=a/b;
> }
>
> I want to instrument try-catch block around the expression a/b (because it
> may give ArithmeticException). The instrumented code should be :
> foo(a,b)
> {
> int c;
> try
> {
> c=a/b;
> }
> catch(Exception e)
> {
>  //handle code (this is also a part of instrumentation)
> }
> }
>
> I am getting no way in soot api to do such thing.
>
> Regards,
> Aritra Dhar
> MT12004
> M.Tech (CSE-IS)
> IIIT-Delhi
>
> about.me/aritradhar
> http://in.linkedin.com/in/aritradhar
>
>
> On Tue, Feb 25, 2014 at 12:16 AM, Guru Devanla <gdevan2 at uic.edu> wrote:
>
>> Hi Aritra,
>>
>> You might want to provide us with more information, including what you
>> exactly need, what you have tried so far to get useful information.  Please
>> provide that information and you can receive useful feedback.
>>
>> Regards
>> Guru
>>
>>
>> On Mon, Feb 24, 2014 at 8:34 AM, Aritra Dhar <aritra1204 at iiitd.ac.in>wrote:
>>
>>> Hi all,
>>>
>>> I want to instrument try-catch block in jumple code via soot. I am not
>>> getting any way in the soot-api to do so. Kindly help.
>>>
>>> Thank you.
>>>
>>> Regards,
>>> Aritra Dhar
>>> MT12004
>>> M.Tech (CSE-IS)
>>> IIIT-Delhi
>>>
>>> about.me/aritradhar
>>> http://in.linkedin.com/in/aritradhar
>>>
>>> _______________________________________________
>>> Soot-list mailing list
>>> Soot-list at sable.mcgill.ca
>>> http://mailman.cs.mcgill.ca/mailman/listinfo/soot-list
>>>
>>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.cs.mcgill.ca/pipermail/soot-list/attachments/20140226/a920d84b/attachment.html 


More information about the Soot-list mailing list